+ slabh-avoid-using-for-logical-and-of-booleans.patch added to -mm tree

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

 



The patch titled
     Subject: include/linux/slab.h: avoid using & for logical and of booleans
has been added to the -mm tree.  Its filename is
     slabh-avoid-using-for-logical-and-of-booleans.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/slabh-avoid-using-for-logical-and-of-booleans.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/slabh-avoid-using-for-logical-and-of-booleans.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Bart Van Assche <bvanassche@xxxxxxx>
Subject: include/linux/slab.h: avoid using & for logical and of booleans

This patch suppresses the following sparse warning:

./include/linux/slab.h:332:43: warning: dubious: x & !y

Link: http://lkml.kernel.org/r/20181105204000.129023-1-bvanassche@xxxxxxx
Fixes: 1291523f2c1d ("mm, slab/slub: introduce kmalloc-reclaimable caches")
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
Cc: Roman Gushchin <guro@xxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/slab.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/slab.h~slabh-avoid-using-for-logical-and-of-booleans
+++ a/include/linux/slab.h
@@ -329,7 +329,7 @@ static __always_inline enum kmalloc_cach
 	 * If an allocation is both __GFP_DMA and __GFP_RECLAIMABLE, return
 	 * KMALLOC_DMA and effectively ignore __GFP_RECLAIMABLE
 	 */
-	return type_dma + (is_reclaimable & !is_dma) * KMALLOC_RECLAIM;
+	return type_dma + is_reclaimable * !is_dma * KMALLOC_RECLAIM;
 }
 
 /*
_

Patches currently in -mm which might be from bvanassche@xxxxxxx are

slabh-avoid-using-for-logical-and-of-booleans.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux