Re: [PATCH v3 05/15] bus: ts-nbus: use bitmap_get_value8()

From: Andy Shevchenko
Date: Thu Feb 20 2025 - 07:07:44 EST


On Thu, Feb 20, 2025 at 12:17 PM Simon Horman <horms@xxxxxxxxxx> wrote:
> On Mon, Feb 10, 2025 at 04:33:31PM -0600, David Lechner wrote:

...

> But when compiling with GCC 14.2.0 I see warnings that values
> is used uninitialised - bitmap_set_value8() appears to rely on
> it being so.

> In file included from drivers/bus/ts-nbus.c:13:
> In function ‘bitmap_write’,
> inlined from ‘ts_nbus_reset_bus’ at drivers/bus/ts-nbus.c:111:2:
> ./include/linux/bitmap.h:818:12: error: ‘values’ is used uninitialized [-Werror=uninitialized]
> 818 | map[index] &= (fit ? (~(mask << offset)) : ~BITMAP_FIRST_WORD_MASK(start));
> | ~~~^~~~~~~

Heh, the compiler is dumb. Even if it's not initialised we do not care.

...

Wondering if the bitmap_write() will work better...

--
With Best Regards,
Andy Shevchenko