Received: by 10.223.164.202 with SMTP id h10csp116918wrb; Mon, 13 Nov 2017 03:45:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMYG7AFnNSa46rv6459BDrQgfd1d9QsTKDkSWtSLjKjCcywG6hO16AIRJaFELpMcxeOx9BKs X-Received: by 10.99.124.85 with SMTP id l21mr8436703pgn.85.1510573524492; Mon, 13 Nov 2017 03:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510573524; cv=none; d=google.com; s=arc-20160816; b=hoOK8pKMastiaqEu9Ow6sKAHEWXJeOV7JOJcWhC7F1BDqZRsMNv2k1Nk8UuqhS9bjQ +hhbHynJAVhGrxdiKGyONrnY1TlYt5JrhaetfHHFGZZrA1aE1p1ozqWSz2QRJ/eAUjjR tWQCdPS+7b4HcxcIw1+6BZeFUx4PtQ/kzenqkRB57vfxsNM5Q/WktxQ74g1GqsqG2pIM 0fH/PZGsP7zjGrzUxG6J2vhI+fyYrENDdq6rtYwSyTiwq6N/t/dr/vci2Z3TPUfmzkSe X5bvLs9+SvlA+oed/5M8X/0X5qIe3IjPkFzSJQ7ujaLcaok+N3gXHBY5C8HDakenjVQJ fu0w== 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=lUEUVTNppcvUW1R6mhIlNvAT2e95QqOsdxsW6RSihiA=; b=BLvZ+y8JjajONESgf9Ba+c4px8uINKMeqnsZExN8eQ0NuzYUky+WMyYi2mg5DZ9yAh pfQNy8wpRlNKesfmWRfMa3dcukVrhfYFv+jTZ+flemZgVebhsEmjKEL46tAh3O6TJ6RD 7UOTyg4RZky5LeDinB/Y4T0sT1HaJapXjFZvKjq4yGdgOdj9B9wUQQ/F0Jg0PYw7LVzp En/8HrHVDUodgnM6ZEGnPDZL3065h7pVV4bSGj0UnA5hA/I+VBvtXUMp7RlsUjDHMfZ1 NC8z8C0R2v9+ugUfbO6ENO4F54IjL9mHeFt6gslamW3fM5aGOXdIDpd4WbJv8f2jZURg KZZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TlCteDPI; 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 z18si1997197pfd.381.2017.11.13.03.45.11; Mon, 13 Nov 2017 03:45:24 -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=TlCteDPI; 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 S1752660AbdKMLnL (ORCPT + 95 others); Mon, 13 Nov 2017 06:43:11 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:53451 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbdKMLnJ (ORCPT ); Mon, 13 Nov 2017 06:43:09 -0500 Received: by mail-qk0-f194.google.com with SMTP id j202so8366670qke.10; Mon, 13 Nov 2017 03:43:09 -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=lUEUVTNppcvUW1R6mhIlNvAT2e95QqOsdxsW6RSihiA=; b=TlCteDPIl1P8tYVcEkRG7u5YRv9oM2h3n7B4SSbMVma6vJmgZEbZTvF20xde7pT1X2 Qm3ZN+n7L7BaSRPdoCAKwnEa8/UsNuKXsKrdsZ3ROOw1Lc786HO/tGgyFkr4lMNDEzep OJqXGujSv0BDRh5CRHhp912kS/O7GYzU3sEWf4r5JtZE4Dj71zNDwfmIhjeq6g65vf/w Hyw6Rvk6HaXBrv8D/5eUXn/4a0q+AsGiAIUhVG+59SdHS8/5I+lKlKEQ08YGf2gXsFUv Gv6E0OmtFlIFy3GylaXxl+CjNbJrqb7mVJiFfaNDmy/Zv2F3bC2YtTFvLuqxNC/YjFTG 5e7A== 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=lUEUVTNppcvUW1R6mhIlNvAT2e95QqOsdxsW6RSihiA=; b=a6y1k5gtk0fMgQSdsTUJJOuzHUm/sstdFcB5G4nI5VnXzNHatgti4jBzpHljAtdwKX z/V5f+DPyNrXR5vzy8BwizE/OBpPgJlmVgFL6eSAMnnZF/6+JsIQvfY/TbkYBwSSixcY Je+KzG+IeOGvN0uK/tiX81jN4Ge6OzoxqX5D0T4/KwZV6I54gq3pZCAn/uvi0RA4Zz1S D34rUsUuRovxmZi3PA1V2Krt5yJ+7ZB6c/6epBJBCTMs2G4nfGkveUQbCFxXpFtNYG2s aJYR99+i4EeqGYNeGXG+iIdozuH3ys2HS5hDEbqZSEe2Kb8s7Jv82Zj7fT5CruPU9h/j 4jZg== X-Gm-Message-State: AJaThX7drf9VeavExlj4hKE68fXBR1RXrji6owm6xowwTE066LKlI7id xZy8EddS6TaRbqPIDSN0p+ITiWG5NJhN2jKRUBeboA== X-Received: by 10.55.163.17 with SMTP id m17mr13549777qke.304.1510573388764; Mon, 13 Nov 2017 03:43:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.47.182 with HTTP; Mon, 13 Nov 2017 03:43:08 -0800 (PST) In-Reply-To: <20171113080955.zcdzx2p5kzoa4d7s@dhcp22.suse.cz> References: <20171113164206.187a790d@canb.auug.org.au> <20171113080955.zcdzx2p5kzoa4d7s@dhcp22.suse.cz> From: Arnd Bergmann Date: Mon, 13 Nov 2017 12:43:08 +0100 X-Google-Sender-Auth: sxhX3RjVsAK4Tv-Fq7fX0ojBI5Q 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 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 Arnd From 1583938526808388545@xxx Mon Nov 13 08:24:51 +0000 2017 X-GM-THRID: 1583928351761700407 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread