From patchwork Fri Nov 9 02:28:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darryl T. Agostinelli" X-Patchwork-Id: 10675241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 921B41751 for ; Fri, 9 Nov 2018 02:28:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772732EA89 for ; Fri, 9 Nov 2018 02:28:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A9FA2EC12; Fri, 9 Nov 2018 02:28:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F37A22EA89 for ; Fri, 9 Nov 2018 02:28:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3F5C6B0688; Thu, 8 Nov 2018 21:28:07 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DEE416B068A; Thu, 8 Nov 2018 21:28:07 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB6AF6B068B; Thu, 8 Nov 2018 21:28:07 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 9C73D6B0688 for ; Thu, 8 Nov 2018 21:28:07 -0500 (EST) Received: by mail-ot1-f72.google.com with SMTP id q6so282492otk.4 for ; Thu, 08 Nov 2018 18:28:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=av8B9fXa40TdXDmMB/gn2NuaAc0FYClBRS+FIaCZczs=; b=YM/HyRfZ7TZiTy9N/kHVMAFv5MVeCajunq8V/uoLMIwEh25eCyloDoeWFJNWBTqE4A MjhEjDmkn88qSUBMXzh4RqV7r+AT39EISKWcEzi2Wwg1j+cn5FWeU/sp45b6EvNGk7m5 rU0aGe0Ao0+7uy3ZqJQPRbSdn3b3kM6G42R0Sauv2XZIIEoQ0GyzLnf6D+x7yEaQlldq JJmFU81Vbm0fUv//9a7Nca2h3290zNPfbi4n86vfKG4gphSRfEptRzoZedlBNVY2dmNn 6Owcg+NiAwBdkcrzoJYQbgK1r+1mG5CgwuqLDtnusKhVJIi9tciZ+RVwr9ETXrDJ8n4W 82MQ== X-Gm-Message-State: AGRZ1gJmKMXGBI1crUwdb+FfOrqzWM4Eq1ePZo35uS6usEFdBhb/eKmC b+/GPSxPtGBTzcrqkGljBc7AYU/5gUZ6YYz3JCUyJjs1c0MyZgqFgzWT77qSViRaeMK8i1FuTZX EUblIaWwHAgCHUNrwIRrM8SXiwtMU7adcWeeEKYJVleMW98itwtCVwbOrA86VmmpD8zVpEYujT5 MYrJXpXQlvdRaY9HIwFTQyB+2QRK4+sq287U/jAhkG4IhyvNzUQG4Lo6pe6JrbYkQ4E+jr+wILJ Y49ttIjDS+zgziOaZBnho8THPh22BumI0sxwqnZAUEH/ARaHAHExa7WZLYsg1+1YRt31qddogp5 a2BGKY+TbRnzo3lEBa7SF4Et70vWq8kTtFjomcvWtECSpzM9r9kdbXKAIyNtf8CxmrtqpuLPAyQ J X-Received: by 2002:a9d:4b17:: with SMTP id q23mr4383452otf.121.1541730487264; Thu, 08 Nov 2018 18:28:07 -0800 (PST) X-Received: by 2002:a9d:4b17:: with SMTP id q23mr4383438otf.121.1541730486585; Thu, 08 Nov 2018 18:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541730486; cv=none; d=google.com; s=arc-20160816; b=vUMlTzkbsrTY5ScEBFEQvhZXuLJFtOYQCqRlwpYXDfG1/MUz0+E0q0cnCQdL+33HSv NwOHLPMJA43Hy4fv/TDdV9ZChTkQaEqjZ8MNZBkVhZ+DBSkGxA6h7PaUjEVvuChQchDg RR0+x6FC+jnfHsb0gOlQCO3XcVBGMRnO4Fwe3D1RlAL7vfKjWwAFIJiCiBh+GUXUWxKf YIQwWsE6eHOdNfxlvfmoe/wi/rbKiLBtrpFPZ1QIER0h9KBcR2YK8k2GfHNN/dpyZU1v y35P+dwiguvPWilQVJitYEHRglDIzkXIzuVZap/bNFVkLay/BtIJs/qd2nPoZkmiN9rD vBXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=av8B9fXa40TdXDmMB/gn2NuaAc0FYClBRS+FIaCZczs=; b=n/I8dZTFxyGnxAv/55uhiqCBJ4JUwAgo1EFHhh7eXcvPfbepNbPT9jw0PWue9HkyX7 kdx/OdXzV6vFUIEjoa/sGmThqfo+KPQHnEk9oToemxBWQMIeh61V6zohs4S+vfiFWyHM fKHTpCXJARzhoEXYuIxkYwQ7ux5E50gPAcr9QZ16uvpGw6B1PfVYOWsXDVcmm7T4UB9R N382BBr1bUomgfppR+Qnm+/7HiKtsKmpHguiG5VXjhJw0NWuHqq+LnASgvTSyq74zKac 4fdKp4ilo7RTw0GjrcxCxCSYB7NT75OKDT7fPf1FhYdAN7ZZ7EyB+xhbyZtnyJMOQHPU yu4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cG0/ZKO1"; spf=pass (google.com: domain of dagostinelli@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=dagostinelli@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id q24sor3608389otc.160.2018.11.08.18.28.06 for (Google Transport Security); Thu, 08 Nov 2018 18:28:06 -0800 (PST) Received-SPF: pass (google.com: domain of dagostinelli@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cG0/ZKO1"; spf=pass (google.com: domain of dagostinelli@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=dagostinelli@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=av8B9fXa40TdXDmMB/gn2NuaAc0FYClBRS+FIaCZczs=; b=cG0/ZKO1zqx3LiELe0VOfmiyr/oSB7nFepywC4tJ8SHKskNGarysJjYhUCw5rZ4Viu TIdIwJ5LU5R6oCkTFPk+NKqx5ygQS42RI0R4L4++oqAXJxTHu5wmECIU0Wi10Xl9bHP/ 5DNrMbIlvKfYKbzTti659irrplLSp3jri5At16bORVPZrSILMHzECtRBtzzf4UU/8SZa iel5irQTf6c7zqHDI5rPbqN0FRGur2XVU7VyGdckQT+eM6d5U1hb9jkG2V+8WxFSsa2P 8Fay/bPvZ5LYYR2pgiNIT3TqP+Z54u75n55dtdhbDvEtsUlj0RSJPXh9tjb9LyKjARxE IdBg== X-Google-Smtp-Source: AJdET5fMB2X8Hc94TTvcwS8SSbMHEqj8IAtnaP8+8gqdsB2w+o5ok2D1Dooco5VWUG+uWVhu93tkpQ== X-Received: by 2002:a9d:4a5c:: with SMTP id d28mr4207340otj.25.1541730485653; Thu, 08 Nov 2018 18:28:05 -0800 (PST) Received: from simulacrum.agostinelli.home.saggio.net (cpe-66-68-97-1.austin.res.rr.com. [66.68.97.1]) by smtp.gmail.com with ESMTPSA id v40sm2334565oti.53.2018.11.08.18.28.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 18:28:04 -0800 (PST) From: "Darryl T. Agostinelli" To: linux-mm@kvack.org Cc: cl@linux.com, bvanassche@acm.org, akpm@linux-foundation.org, penberg@kernel.org, vbabka@suse.cz, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, "Darryl T. Agostinelli" Subject: [PATCH] Suppress the sparse warning ./include/linux/slab.h:332:43: warning: dubious: x & !y Date: Thu, 8 Nov 2018 20:28:01 -0600 Message-Id: <20181109022801.29979-1-dagostinelli@gmail.com> X-Mailer: git-send-email 2.17.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Darryl T. Agostinelli --- include/linux/slab.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 918f374e7156..883b7f56bf35 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -317,6 +317,7 @@ static __always_inline enum kmalloc_cache_type kmalloc_type(gfp_t flags) int is_dma = 0; int type_dma = 0; int is_reclaimable; + int y; #ifdef CONFIG_ZONE_DMA is_dma = !!(flags & __GFP_DMA); @@ -329,7 +330,10 @@ 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; + + y = (is_reclaimable & (is_dma == 0 ? 1 : 0)); + + return type_dma + y * KMALLOC_RECLAIM; } /*