Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp187665imu; Fri, 16 Nov 2018 00:40:36 -0800 (PST) X-Google-Smtp-Source: AJdET5e4pDqCIS+9mMDiNCuVzIIuj415YMPgPspeNjrC54YXacxjNEZY3qkvI6OjpNCu3W3v4ejt X-Received: by 2002:a62:d75d:: with SMTP id v29mr6161053pfl.90.1542357636830; Fri, 16 Nov 2018 00:40:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357636; cv=none; d=google.com; s=arc-20160816; b=0c6GujGL9ipHSX1nsWs034A6ndMzwvATyHU5T+xJIuyp0kPq34MqNPnE+KZbYo0yr+ XjImwcm/dVCvUnNzYAmtakiAzcEkiXzGGehGgOZFJi3vQSpcwUQqd0sGJ2YsrmZjTtrS F+edhsBSyb2As8X9mLryogqBrmDeB994E88lr16nrcSkGkn3Ig+N47W6R57pR/rKXVne 5r/exWMP8oBH+n8ua7KZ+9R+nO9biE7E9ilRitIEeEDcMSj0dzuUc384skFwAB4nVFxm 3WHKVMLX7icpsdpCcF/twXrOkvbBbnO8wZVlv0iU7NaJxukOd6H80/6LSBKX5HFUU+iT dl4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=edNFr29QDgxCwtNEjTz9KwifJcQhlKRJUuzkyAoBxX4=; b=MLs3Q4dvR7+5RDGnKf35Pbz0AlqDPnA4k2CB6kJsvCkFmTu4IWpxGd0spBuqY11gbT 4VQOr+qNU4agd9umh3DnVFIbcK9AwfRZe/EqvJVxk2Eq7/nuNolQGYDsFK9J3Mrwzcof UhoP30dLAkcTJPE8Rzc6pDSPK5Mq5Q7j2CFNIW6WIF8ptOwoGMynbqDnZx+lX8QVONyX uhx35TxxRU+pf2uTQa0jKkiEuXS0Mi57x7nvgZjp/32YHb6cBU5ccLfw/biMuZL+FKeh TLik+1aUVjwo2jykB1Xv8LpVRotAI0Y9fqDYZijhHEmIIXUBFEbi/fV5wnZ5niOAzrGh O3rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16-v6si16435481pfm.51.2018.11.16.00.40.22; Fri, 16 Nov 2018 00:40:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbeKPSvG (ORCPT + 99 others); Fri, 16 Nov 2018 13:51:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:52392 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727543AbeKPSvG (ORCPT ); Fri, 16 Nov 2018 13:51:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 31778AB64; Fri, 16 Nov 2018 08:39:44 +0000 (UTC) Date: Fri, 16 Nov 2018 09:39:42 +0100 From: Michal Hocko To: Masahiro Yamada Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slab: fix 'dubious: x & !y' warning from Sparse Message-ID: <20181116083942.GA14767@dhcp22.suse.cz> References: <1542346829-31063-1-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542346829-31063-1-git-send-email-yamada.masahiro@socionext.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-11-18 14:40:29, Masahiro Yamada wrote: > Sparse reports: > ./include/linux/slab.h:332:43: warning: dubious: x & !y JFYI this has been discussed here http://lkml.kernel.org/r/20181105204000.129023-1-bvanassche@acm.org > Signed-off-by: Masahiro Yamada > --- > > include/linux/slab.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/slab.h b/include/linux/slab.h > index 918f374..d395c73 100644 > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -329,7 +329,7 @@ static __always_inline enum kmalloc_cache_type kmalloc_type(gfp_t flags) > * 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; > } > > /* > -- > 2.7.4 -- Michal Hocko SUSE Labs