Received: by 10.223.164.202 with SMTP id h10csp155934wrb; Mon, 13 Nov 2017 04:25:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMaMRSns38+DuHfDHcJ3GbZ2aCY3a/y+5gFKY3VB11/a+iLg3R5GYE2eWcmzLl2bRxaVqYZ0 X-Received: by 10.84.241.6 with SMTP id a6mr142591pll.318.1510575908786; Mon, 13 Nov 2017 04:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510575908; cv=none; d=google.com; s=arc-20160816; b=Wy5/UdjpGy3zmrCcDj7pvV+p158IcaM/2xVy8BKG/yb0E/nZjQqZyg08w8rWQ91nuJ v1sdHws17XqFyJ273IF/c1o3XwE0uo6HvameYpTTd764taD0RJUaKiNvYcDYdnIEKolC w5L1VXkuGPeA7gyNRYTLodYocddCtZ4FJzQpaMDJAYmlCWmFExXk1q/3aEX3xtz9S4vW 6ZEdDils4WDG8CSmsG68yMQfwrzK9Mdltu54dpMdAqDCzkOUNL3YiYOYPf7Jpkzjwsha krpt5DraGm0HoEA8r8Kw3LWe73roNKKdGVvFnKkcSRUbzjGyGiUTsxeygA6+gbczvmjv iTpw== 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=hE8XIF5cvf/2Mf5kq09ThYsczXHwl/7z2N8SL4wZbpw=; b=QfyKxZf59qe7FkVsOP3C8UVGjXGKyBioINFSaV/zUdACsCXx+/WvSCOu+ayCOCpTMr 4A/OhvM/6ABLKu8mBjxFgFvYMd/jZ8dH2aZTjNSnBy00XgwqSpBTPgFYzyOst7y89LSi DfA+XLgvHFfQZfluAlTpqNUuNtWsJvUZ5hzMQyVX6LIczGYGn19lsYc2/sE5tZL9Dt9G q+SArEO5r+aZl18A01HpGfRRN9sQ789p7TzNJJj8om0fZHF+Sv8zBu/LFJPk/hmAvOAl 3vi8QAHxZPxTw/xWm/3TooA0zdtoDsTUYsNiRVJs2h+vAFZ5pMB5oDFOExA6j/pcMGqn /71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pnEY8dZy; 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 m8si2628280pfi.343.2017.11.13.04.24.54; Mon, 13 Nov 2017 04:25:08 -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=pnEY8dZy; 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 S1752650AbdKMMYS (ORCPT + 95 others); Mon, 13 Nov 2017 07:24:18 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:48787 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbdKMMYQ (ORCPT ); Mon, 13 Nov 2017 07:24:16 -0500 Received: by mail-qk0-f195.google.com with SMTP id a142so19380347qkb.5; Mon, 13 Nov 2017 04:24:16 -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=hE8XIF5cvf/2Mf5kq09ThYsczXHwl/7z2N8SL4wZbpw=; b=pnEY8dZym8I+Lv7DuY8OX4CkyojRtTW1QhuxWTrX4ohb6l3ml2cj/dSOKat6zQS6RK +xk6N9q/0CCZmWWpRGbdTUIJHjMAPUiLlDtNA1E2tqiRcuBfjFb80DLBwRjvs7e/Dgfi Mg9nJBmeCIofoDhr8PCIyH0+J+um3eylJqkkdAg9NkIYABnbuJhwBdRfrujs8cakBv7m t8Mv5g7IVfBamrwaXukPve/kMv9rz14zzTQVTh65R9se+Nk+tlp6NbjmwN7+qLR5Aggu RbJznV91CfC6Qt+6TXHqRRQ+1SduPHgUa4yvxcr0KjmlcLDRB7jNHiRcjrlOoJyqxt4P WZBg== 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=hE8XIF5cvf/2Mf5kq09ThYsczXHwl/7z2N8SL4wZbpw=; b=WwpCZCW8hG2sLfo8Im6eNG3pm6ON8xjEpSmR8E9Y7Jshnt6FX6HVzKbmgaNEkU5kmm 5wxFBn9eUsM2zWvwsWcufThA776qKvNxYqvb38w6X8rLO7ylE5xvuebM9RlZq1DcAA6/ DoLHUY7cQrAQOuagSA0NV1KZ++iAYUy1T0AjrwsdzWkjKMx/3zybv2fc79BavBSPCC/x AKqzuN60KkDwxYCU1k/y+UiKwHKE/OMPwEC7i8/JLMdKDAWtmse51TV11wObwFSksMmD gfyyR25zNNxTn8MBAjjY/OwtM/ZDG/0YmX9G3NRMhjssFL93bYU6QFAIV8W6pfmu+qUi 9mFg== X-Gm-Message-State: AJaThX4S2BAICQxjIsvqzA2HgpYoBHKHmT/3VXasJhFvFQaWYwuZD3Br R4LVLXdzJlPtVO9PG3nzhyp8Lgm+fnGLvfEMgHQ/Dw== X-Received: by 10.55.20.96 with SMTP id e93mr13239234qkh.253.1510575855476; Mon, 13 Nov 2017 04:24:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.47.182 with HTTP; Mon, 13 Nov 2017 04:24:14 -0800 (PST) In-Reply-To: <20171113115430.pms47vgz5uszqsjm@dhcp22.suse.cz> References: <20171113164206.187a790d@canb.auug.org.au> <20171113080955.zcdzx2p5kzoa4d7s@dhcp22.suse.cz> <20171113115430.pms47vgz5uszqsjm@dhcp22.suse.cz> From: Arnd Bergmann Date: Mon, 13 Nov 2017 13:24:14 +0100 X-Google-Sender-Auth: 1F6Y87ubJNurFqNTzDgqcYfn2lo Message-ID: Subject: Re: linux-next: build warning after merge of the akpm-current tree To: Michal Hocko Cc: Stephen Rothwell , 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 Mon, Nov 13, 2017 at 12:54 PM, Michal Hocko wrote: > On Mon 13-11-17 12:43:08, 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: >> >> Hi Andrew, >> >> >> >> 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 > > OK, that is a reasonable workaround. I was talking to our gcc guy and > he suggested to report a bug for this. That might also be useful. Some warnings in gcc get disabled when they show up inside of a macro, and that could presumably be done here too. Arnd From 1583951860249308784@xxx Mon Nov 13 11:56:47 +0000 2017 X-GM-THRID: 1583928351761700407 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread