netdev: Add missing __percpu qualifier to a cast

Add missing __percpu qualifier to a (void *) cast to fix

dev.c:10863:45: warning: cast removes address space '__percpu' of expression

sparse warning. Also remove now unneeded __force sparse directives.

Found by GCC's named address space checks.

There were no changes in the resulting object file.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://patch.msgid.link/20240814070748.943671-1-ubizjak@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Uros Bizjak 2024-08-14 09:06:38 +02:00 committed by Jakub Kicinski
parent fcb1aa5163
commit d440af37ba

View File

@ -10868,7 +10868,7 @@ noinline void netdev_core_stats_inc(struct net_device *dev, u32 offset)
return;
}
field = (__force unsigned long __percpu *)((__force void *)p + offset);
field = (unsigned long __percpu *)((void __percpu *)p + offset);
this_cpu_inc(*field);
}
EXPORT_SYMBOL_GPL(netdev_core_stats_inc);