Received: by 10.223.164.202 with SMTP id h10csp892824wrb; Fri, 17 Nov 2017 10:18:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMaXsYUfxMt8THWOkT/wGlwSwuyGJRfe8xgc+x9P/Uq8ewb2da+FglNtGwXYd47y4syUTTsM X-Received: by 10.84.230.135 with SMTP id e7mr5851729plk.299.1510942700579; Fri, 17 Nov 2017 10:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510942700; cv=none; d=google.com; s=arc-20160816; b=u0D1SkBCpsJNc29Hdy+2prAgw2oufQ86FzokHkeDRPsYsZdM4QrSvSqAglmmIhmBRr EivTFYvluizS3vr2LVfTSwVhuu32w27vqe2c5KGHz1PtxULYCCaI4d3T94CHQjCXfJ8L VuQTlqTZuqVCJH80tRxzglP4WDp+yYxFeJnIst1ECN8OD4YbZIDGNOfiuGDKf29uik6e T0Rtug9dXE0eB7sVafgqLDTqUGSDJu8mydaN6/Qxyqa/eG0qjSQvT0H+UfIK9mw0ksRz B9NKC/BS0x1btPstj724dulosmZeoJWJFtIarf6CNW6IcWN0Phzz+O8pEPY62P3R2KRI ZsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=x7C1BhRWKtYZYzyfvfOzGdCRWwVBFvxh+ViucY4FIL4=; b=cp6wxCWVDKzXyAxwV7+SS1n5PjPSa/G5oo2zSUkUh0hWee6L8QV7mHyT4nQvCn0OSL 2VVMlQNp0hghqQhuwkDX/TAyuczRpXYUYnYziaqsiJVwbRWAMsnKS/u5DCvdHCfqg51l CA8+FR3ztxE3NEYTltq7FZeLf27p4INLrJwEJpe0yLudhvjZImANyMP6R7b9M4KPfLNh TSYjgIZT27PW6IOY6+my4oITxZjgRtNMHsH3uFcftpWQ/bmj44OI82UA4O7rphgY7XBG IBH9IVjZ0RXXo8PEyeNcqd4lWdwwqQZleJyv0+7MEsxxvAXUFlAiaTc7KuBTtCJqRScM +0yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eJfr90iX; 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 q7si3095923pgc.464.2017.11.17.10.18.06; Fri, 17 Nov 2017 10:18:20 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eJfr90iX; 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 S1752418AbdKQJ4m (ORCPT + 91 others); Fri, 17 Nov 2017 04:56:42 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:41464 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbdKQJ4g (ORCPT ); Fri, 17 Nov 2017 04:56:36 -0500 Received: by mail-oi0-f68.google.com with SMTP id h81so1269749oib.8; Fri, 17 Nov 2017 01:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=x7C1BhRWKtYZYzyfvfOzGdCRWwVBFvxh+ViucY4FIL4=; b=eJfr90iXWzDq8jPnAF4eGaVAqfdnldmw0OmTK12BQNAuoljXPOYpVwDMJ5sbfrv+qz 8Si6S9xbVhiUqHRzFnS8+4cfx7hWZhJNydSYCdHvWujRW8ixU8hLEgJRVD9mNumK/UGb AMYwcp3yApRolKI3LHCKa7/4Am7BxLjmUirHV7mPsCdzzxLQ8Ik5ya2G4QNfYxy6VHKM OUm4rBBNC7oSSVGbNuinekE3zfTniNxziFba6KQDzm5a31DYcsIQw35zYCMXl6W0uqsU mogXe+xpJczrrIIjV87VAOWnFAAe5CAVHNiq/rMOJfk+FAXIsddNIpuI2pkwfX0Dmn00 yJQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=x7C1BhRWKtYZYzyfvfOzGdCRWwVBFvxh+ViucY4FIL4=; b=szsCafglxWy5vU2R2Y6EgdeJAM3kUJDX1N6Q69e2feLvIpJ0jTdp72QzdKkPA++7Wt otrRp/yngfxryUOxMXZTlrIr3IvdZViWRDOgbEMOECeIltXI8Y1zZqpiEKuFmv8CffDn GeoEcajRKT0gC73obgxfZAfbYGFnzY15xwfBEeyCb9lyctyjIQGI1scDWPPxXWW7OmzZ Q+IcTuo0fD1epD56kxDNA36++KJ3RMubwtmne8qzKKPuPYS0cD3dF/BZMlTpyeVpOjZI 9TfFLPYSDYlGzlT3rlmpijy4rUlUGDbmITAaT7HKhTTp6E5qM0RUInWFC87aJmMluwEK ctPQ== X-Gm-Message-State: AJaThX70xbxIa9V71C7a0PpErDtTez3gRz9AtaQ31WdIeG6moOBV0zVY SfZgElOmBYq6jNqiboN8Mk7nGD2/dvVU/OkciWA= X-Received: by 10.202.228.70 with SMTP id b67mr705808oih.283.1510912595416; Fri, 17 Nov 2017 01:56:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.43.3 with HTTP; Fri, 17 Nov 2017 01:56:34 -0800 (PST) In-Reply-To: <20171117145320.714972ca@canb.auug.org.au> References: <20171113164206.187a790d@canb.auug.org.au> <20171113080955.zcdzx2p5kzoa4d7s@dhcp22.suse.cz> <20171117094439.5287c715@canb.auug.org.au> <20171117145320.714972ca@canb.auug.org.au> From: Arnd Bergmann Date: Fri, 17 Nov 2017 10:56:34 +0100 X-Google-Sender-Auth: Rg1hUiIQg3wykmxrsvzBBvmIM_k Message-ID: Subject: Re: linux-next: build warning after merge of the akpm-current tree To: Stephen Rothwell Cc: Michal Hocko , Andrew Morton , Linux-Next Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 17, 2017 at 4:53 AM, Stephen Rothwell wrote: > Hi all, > > On Fri, 17 Nov 2017 09:44:39 +1100 Stephen Rothwell wrote: >> >> On Mon, 13 Nov 2017 12:43:08 +0100 Arnd Bergmann wrote: >> > >> > On Mon, Nov 13, 2017 at 9:09 AM, Michal Hocko wrote: >> > > On Mon 13-11-17 16:42:06, Stephen Rothwell wrote: >> > >> >> > >> After merging the akpm-current tree, today's linux-next build (powerpc >> > >> ppc64_defconfig) produced this warning: >> > >> >> > >> In file included from include/linux/mmzone.h:17:0, >> > >> from include/linux/mempolicy.h:10, >> > >> from mm/mempolicy.c:70: >> > >> mm/mempolicy.c: In function 'mpol_to_str': >> > >> include/linux/nodemask.h:107:41: warning: the address of 'nodes' will always evaluate as 'true' [-Waddress] >> > >> #define nodemask_pr_args(maskp) (maskp) ? MAX_NUMNODES : 0, (maskp) ? (maskp)->bits : NULL >> > >> ^ >> > >> mm/mempolicy.c:2817:11: note: in expansion of macro 'nodemask_pr_args' >> > >> nodemask_pr_args(&nodes)); >> > >> ^ >> > > >> > > Hmm, this warning is quite surprising to me. Sure in this particular >> > > case maskp will always be non-NULL so we always expand to >> > > MAX_NUMNODES, maskp->bits >> > > which is what we want. But we have other users which may be NULL. Does >> > > anybody understan why this warns at all? >> > >> > As I understand it, the warning tries to address a common typo of accidentally >> > testing the pointer to a stack object for being non-NULL, rather than the object >> > pointed to for being non-zero. >> > >> > Adding an extra '!= NULL' comparison gets rid of the warning for me: >> > >> > #define nodemask_pr_args(maskp) \ >> > ((maskp) != NULL) ? MAX_NUMNODES : 0, \ >> > ((maskp) != NULL) ?(maskp)->bits : NULL >> > >> > Arnd >> >> This warning now exists in Linus' tree :-( > > Looking closer, it seems that the above workaround doesn't work for my > compiler (gcc v5.2.0): Right, I see now that all versions from gcc-4.6 to gcc-6 are affected by this, while 4.5 and earlier as well as 7 and 8 are not. I'll try to come up with an alternative workaround, it will probably be even uglier. Arnd From 1584334275927656646@xxx Fri Nov 17 17:15:07 +0000 2017 X-GM-THRID: 1583928351761700407 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread