Re: [linux-next:master 6345/7161] ipc/util.c:226:13: note: in expansion of macro 'max'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 14 Apr 2019 20:21:30 +0200 Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> wrote:

> 
> With sysctl disabled, ipc_min_cycle is RADIX_TREE_MAP_SIZE, and this is
> 
>  > include/linux/radix-tree.h:#define RADIX_TREE_MAP_SIZE  (1UL << 
> RADIX_TREE_MAP_SHIFT)
> 
> The checker behind max() is not smart enough to notice that 
> RADIX_TREE_MAP_SIZE can be represented as int without an overflow.
> 
> 
> What is the right approach?
> 

Make ipc_min_cycle have the same type in both cases?

--- a/ipc/util.h~ipc-do-cyclic-id-allocation-for-the-ipc-object-fix
+++ a/ipc/util.h
@@ -42,7 +42,7 @@ extern int ipc_min_cycle;
 #else /* CONFIG_SYSVIPC_SYSCTL */
 
 #define ipc_mni			IPCMNI
-#define ipc_min_cycle		RADIX_TREE_MAP_SIZE
+#define ipc_min_cycle		((int)RADIX_TREE_MAP_SIZE)
 #define ipcmni_seq_shift()	IPCMNI_SHIFT
 #define IPCMNI_IDX_MASK		((1 << IPCMNI_SHIFT) - 1)
 #endif /* CONFIG_SYSVIPC_SYSCTL */
_





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux