lkml.org 
[lkml]   [2024]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 18/34] lib: checksum: hide unused expected_csum_ipv6_magic[]
    Date
    From: Arnd Bergmann <arnd@arndb.de>

    When CONFIG_NET is disabled, an extra warning shows up for this
    unused variable:

    lib/checksum_kunit.c:218:18: error: 'expected_csum_ipv6_magic' defined but not used [-Werror=unused-const-variable=]

    Hide it under the same #ifdef as the reference to it.

    Fixes: f24a70106dc1 ("lib: checksum: Fix build with CONFIG_NET=n")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    ---
    lib/checksum_kunit.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/lib/checksum_kunit.c b/lib/checksum_kunit.c
    index bf70850035c7..80dd1e1b71ba 100644
    --- a/lib/checksum_kunit.c
    +++ b/lib/checksum_kunit.c
    @@ -215,6 +215,7 @@ static const u32 init_sums_no_overflow[] = {
    0xffff0000, 0xfffffffb,
    };

    +#ifdef CONFIG_NET
    static const u16 expected_csum_ipv6_magic[] = {
    0x18d4, 0x3085, 0x2e4b, 0xd9f4, 0xbdc8, 0x78f, 0x1034, 0x8422, 0x6fc0,
    0xd2f6, 0xbeb5, 0x9d3, 0x7e2a, 0x312e, 0x778e, 0xc1bb, 0x7cf2, 0x9d1e,
    @@ -240,6 +241,7 @@ static const u16 expected_csum_ipv6_magic[] = {
    0x99aa, 0xb06b, 0xee19, 0xcc2c, 0xf34c, 0x7c49, 0xdac3, 0xa71e, 0xc988,
    0x3845, 0x1014
    };
    +#endif

    static const u16 expected_fast_csum[] = {
    0xda83, 0x45da, 0x4f46, 0x4e4f, 0x34e, 0xe902, 0xa5e9, 0x87a5, 0x7187,
    --
    2.39.2

    \
     
     \ /
      Last update: 2024-05-27 16:20    [W:3.009 / U:0.212 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site