Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp598201ybh; Thu, 12 Mar 2020 07:42:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsEEIU8hi8ZF1FvywNy9/s4ED4pQ94wTXm4TuO1lvlqccl9VzD7N5HjYB3JdaSzSLDOKmfm X-Received: by 2002:a9d:b8f:: with SMTP id 15mr6584981oth.256.1584024151255; Thu, 12 Mar 2020 07:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584024151; cv=none; d=google.com; s=arc-20160816; b=jxgfqi5xm00qmkR3Cv2hoOE8N0s+ztkb0NTBgnTEJWFt6w4FYhWDbrqz544aSBUmJ9 8PxG6/uZf5VixtJMINDmOranfWM1kVQ4xk1aTX2fHlsYgv25YltDLjj0V4qQ5ndZTJMT LQfyfii0EGwrteQSmpOddHzeLInI+fKbMizCVVpt7ggMnRCjxWm/it8oOlVvUQi9kZzH KgHvE9uK0JTKZvkvayo7OqumiV+/JczzIncO3sqqXGq4IDl3XV1LfiETiGMX0fIf+36n S7qLeilwBZ24OTIpJJOOpnRsmA7JH/BSm/u43ALIol+4DJ1H+0fk0bpoR/J9GmWeKzZ/ UyEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=75/gHdmoIV3mnDz2dOxTLNPx7WsQthOuYE1oIMb17hs=; b=Hgtc4nlihDmuydf86XVROX/0V5hI92vRe6p45FxPnfcFRvM0kXH6I1OHtLkAvURe3Y W9rvkPvPW5tKo5ZlVtOFVB4c3F4oHhxRaucUriwxAsZeBK7zk90XiYYR2hg5ln1UVhZg CoSZF25YNasNaBDzM6n8W6VfsZXVQ/K+tRwAzqgkfEWm5NeNbFR0oLxKdziGGC54QTG4 YfiXGiMqoAeMPAdIRlvly60LXpgXEVTXIlFWo4QRiW2qiMNS2v6TBNrjbDLZE2leOgKw xKAI3ROs/4DhtNzhoz2JLbrGgCaSzMXedtQ+C6gV5bZ8vu396krG9Aka4fYUD1UL8uOM 2c5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1XtiEyLN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si2687902oic.183.2020.03.12.07.42.18; Thu, 12 Mar 2020 07:42:31 -0700 (PDT) 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=pass header.i=@kernel.org header.s=default header.b=1XtiEyLN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727662AbgCLOmA (ORCPT + 99 others); Thu, 12 Mar 2020 10:42:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:33954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgCLOl7 (ORCPT ); Thu, 12 Mar 2020 10:41:59 -0400 Received: from localhost (mobile-166-175-186-165.mycingular.net [166.175.186.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DFC5206E7; Thu, 12 Mar 2020 14:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584024119; bh=rwALx85sL9uxz9h24BYrbFnTq6oyh/cOVDhdniakHzk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=1XtiEyLN/mnOQ3bewdx1k97d0rs0nBAo4iMJlADMpY54tvJoyAfqZRVkn+pY3Mear H3fiV7NixjRk6sHXRrkbfsjJ8wm/5LNnZN+pQJKFaS+gH1B2Iw/0gy43OnwJKu+JXo g4f5WXrBhK/85gaNhjO46JDvgsgtlva/prm2iMWw= Date: Thu, 12 Mar 2020 09:41:57 -0500 From: Bjorn Helgaas To: Chen Zhou Cc: paulus@samba.org, mpe@ellerman.id.au, tyreld@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] PCI: rpaphp: remove set but not used variable 'value' Message-ID: <20200312144157.GA110750@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312143800.GA109542@google.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 09:38:02AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 12, 2020 at 10:04:12PM +0800, Chen Zhou wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > > > drivers/pci/hotplug/rpaphp_core.c: In function is_php_type: > > drivers/pci/hotplug/rpaphp_core.c:291:16: warning: > > variable value set but not used [-Wunused-but-set-variable] > > > > Reported-by: Hulk Robot > > Signed-off-by: Chen Zhou > > Michael, if you want this: > > Acked-by: Bjorn Helgaas > > If you don't mind, edit the subject to follow the convention, e.g., > > PCI: rpaphp: Remove unused variable 'value' > > Apparently simple_strtoul() is deprecated and we're supposed to use > kstrtoul() instead. Looks like kstrtoul() might simplify the code a > little, too, e.g., > > if (kstrtoul(drc_type, 0, &value) == 0) > return 1; > > return 0; I guess there are several other uses of simple_strtoul() in this file. Not sure if it's worth changing them all, just this one, or just the patch below as-is. > > --- > > drivers/pci/hotplug/rpaphp_core.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c > > index e408e40..5d871ef 100644 > > --- a/drivers/pci/hotplug/rpaphp_core.c > > +++ b/drivers/pci/hotplug/rpaphp_core.c > > @@ -288,11 +288,10 @@ EXPORT_SYMBOL_GPL(rpaphp_check_drc_props); > > > > static int is_php_type(char *drc_type) > > { > > - unsigned long value; > > char *endptr; > > > > /* PCI Hotplug nodes have an integer for drc_type */ > > - value = simple_strtoul(drc_type, &endptr, 10); > > + simple_strtoul(drc_type, &endptr, 10); > > if (endptr == drc_type) > > return 0; > > > > -- > > 2.7.4 > >