Commit 07b272a0 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Simon Horman
Browse files

printk: Use ULL suffix for 64-bit constants



When compiling for 32-bit:

    util_lib/elf_info.c: In function ‘get_desc_state’:
    util_lib/elf_info.c:923:31: warning: left shift count >= width of type [-Wshift-count-overflow]
      923 | #define DESC_FLAGS_MASK  (3UL << DESC_FLAGS_SHIFT)
	  |                               ^~
    util_lib/elf_info.c:925:25: note: in expansion of macro ‘DESC_FLAGS_MASK’
      925 | #define DESC_ID_MASK  (~DESC_FLAGS_MASK)
	  |                         ^~~~~~~~~~~~~~~
    util_lib/elf_info.c:926:30: note: in expansion of macro ‘DESC_ID_MASK’
      926 | #define DESC_ID(sv)  ((sv) & DESC_ID_MASK)
	  |                              ^~~~~~~~~~~~
    util_lib/elf_info.c:947:12: note: in expansion of macro ‘DESC_ID’
      947 |  if (id != DESC_ID(state_val))
	  |            ^~~~~~~
    util_lib/elf_info.c: In function ‘id_inc’:
    util_lib/elf_info.c:923:31: warning: left shift count >= width of type [-Wshift-count-overflow]
      923 | #define DESC_FLAGS_MASK  (3UL << DESC_FLAGS_SHIFT)
	  |                               ^~
    util_lib/elf_info.c:925:25: note: in expansion of macro ‘DESC_FLAGS_MASK’
      925 | #define DESC_ID_MASK  (~DESC_FLAGS_MASK)
	  |                         ^~~~~~~~~~~~~~~
    util_lib/elf_info.c:981:15: note: in expansion of macro ‘DESC_ID_MASK’
      981 |  return (id & DESC_ID_MASK);
	  |               ^~~~~~~~~~~~

Indeed, "unsigned long" constants are 32-bit on 32-bit platforms, and
64-bit on 64-bit platforms.

Fix this by using a "ULL" suffix instead.

Fixes: 4149df90 ("printk: add support for lockless ringbuffer")
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarJohn Ogness <john.ogness@linutronix.de>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 8519b01f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment