Thread (50 messages) 50 messages, 10 authors, 2025-02-22

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

From: David Lechner <dlechner@baylibre.com>
Date: 2025-02-20 17:16:48
Also in: linux-gpio, linux-iio, linux-mmc, linux-phy, linux-sound, lkml

On 2/20/25 6:06 AM, Andy Shevchenko wrote:
On Thu, Feb 20, 2025 at 12:17 PM Simon Horman [off-list ref] wrote:
quoted
On Mon, Feb 10, 2025 at 04:33:31PM -0600, David Lechner wrote:
...
quoted
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.
quoted
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...
It is already using that:

#define bitmap_set_value8(map, value, start)		\
	bitmap_write(map, value, start, BITS_PER_BYTE)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help