]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netdev: Add missing __percpu qualifier to a cast
authorUros Bizjak <ubizjak@gmail.com>
Wed, 14 Aug 2024 07:06:38 +0000 (09:06 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 Aug 2024 02:10:01 +0000 (19:10 -0700)
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>
net/core/dev.c

index f66e614078832842e903fc2ee792cd89b8a3572f..e7260889d4cb01dab48610999e8924050ac395a0 100644 (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);