Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp529588imu; Fri, 9 Nov 2018 01:36:35 -0800 (PST) X-Google-Smtp-Source: AJdET5fv2M7tUQrPFZr2oWvTOw9oAFLSBCte4kcboPatnKmaAf0ydPs9BSIsLhGEKAeh1U3fmBBx X-Received: by 2002:a63:7d0f:: with SMTP id y15-v6mr6778000pgc.171.1541756195868; Fri, 09 Nov 2018 01:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541756195; cv=none; d=google.com; s=arc-20160816; b=wVECiulVrdpUlLNXBX2v8KsGuWAfU7FzNbFkcMFxyYIkvox/hAJ0pzqkzff+urA9xc X8LmxMoXcvOt4UuW0/pgjoaD4L22WLty/zkEDdkKtuluIzL2FPF+ukZd/SAMQn6M/Pyi v3Hw2M0iVDZGGVAst7teHoQzM8wQT2e28k0IoowxFhp0+KqNxjaSWLvLyHFbtSrm9K+D ohFOBbuj84DPuf/F+IxmBpnnrvx80vBMGPpBEzHSfIF/JZifM9L30IOTQBoY6TSSq2Rg M+oxtDqxn3o5ZpaB8xkeCNQiGFGk1mKynTXC1EgAkEWvFLkWWovFlskqF0aV1hPH+tze PFOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=9X0r+mRzQr1gQGLu4SDzs8DgAN4xdKnIMhqADniHkRI=; b=zca5O9zEkSmPoMvHsd9dwspwrYiPKk/LYoOzZg5QjFsoJBeRQ5Q5xUB8LB37nIoSTU ETK8d2QxewaTU1RKp9ZUTTxlyZJOsgogX2b9juZUGzjZtgCCihVsSX8aGhmTPXePQFUx g9y3NM4/aedGxuVkKZGW/plQVnna+ElEv+4SeMiskyJ0kdkVRbubIFNekqOH4AKx3WDf gQdVZ2ThBsT8/6bu3pJVmjlkhxWqiJ1EdJ9wlyCW23X8reuF6/aEEK4Hsh35lz79CzWR i9g0pt0txoyzcXGMD5r6MbRAmSN0yU/OntFcJmyWOZRjZc8AhVtSM5QqeuhGluxF7W96 lPFA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14-v6si5980605pgv.260.2018.11.09.01.36.20; Fri, 09 Nov 2018 01:36:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728016AbeKITPY (ORCPT + 99 others); Fri, 9 Nov 2018 14:15:24 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:55172 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727655AbeKITPY (ORCPT ); Fri, 9 Nov 2018 14:15:24 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1gL3CU-0000te-Qy; Fri, 09 Nov 2018 10:35:39 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: Johannes Berg Subject: [PATCH v2 3/3] slab: use logical instead of bitwise operation in kmalloc_type() Date: Fri, 9 Nov 2018 10:35:34 +0100 Message-Id: <20181109093534.15121-3-johannes@sipsolutions.net> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181109093534.15121-1-johannes@sipsolutions.net> References: <20181109093534.15121-1-johannes@sipsolutions.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg The operation here really is more logical than bitwise, even if due to the setup the bitwise operation works fine. However, this causes a complaint from sparse that the operation doesn't really make sense due to the not. Use a logical and instead of bitwise. In my (somewhat unscientific) test this caused no differences in the generated code. Signed-off-by: Johannes Berg --- 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 918f374e7156..d395c7366312 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.17.2