Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp594814ybh; Thu, 12 Mar 2020 07:38:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vswpxxn2Iuurph86v4Cs2JXHxLaD9aDlWYopFj8LTaAQwh7HTDDqjvcJLyVpo6np4ecg2wk X-Received: by 2002:a9d:3d65:: with SMTP id a92mr6181889otc.326.1584023922624; Thu, 12 Mar 2020 07:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584023922; cv=none; d=google.com; s=arc-20160816; b=mdpKEDZ5dQr9cFKOoOpJd0d+P74Qbn7JGfO+8B5TlPKxgd6JrIqFx5pRgu2asc2SRX jeH9fnC8QLEOOOj6COzQ8hdFn0q0t5GcktLaC9ev1TuE1+Z2zjheoL92cRWT1iS8Q1L5 TireaUwCEnrXiHrSzGXW1L7zlHYX/C7q3zXLmjQ4haP9JE1ARNt21gHsN73im2t4SZtt KoqL81+T+MiSeLZkCVBLpUZ1qAgGNJLQtKmK8/14bmw5KE05Q6yrIZySmKmWonghSu4z I/pcfPmLW3gvFo1UjR5VdP8nyNceLIRlAwR52dyXs8yJU89+oWoNOsAU5JJWCTdG3Y5W Jd1w== 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=qO6J+elO/Vi5D200dNi9EQF2LhEovv85tftwNsIFp68=; b=Itwio1wm2FGxfVkItKF+wPqvjXWUnX+/o9Sft5WoPYAU/68ayn99B2GkWng/sjol4p MzN28QU7bMdXKYw2KreUwx9OUa4rhScKbuvKM8VhTOkVbVk2mMEqb7XvJW5t6pBe5nan 2kv5MWkjpRJNr959YjHMyg7rMqn6O5liF0N3DXt6fN3LQgr5ur2oRZPMdHulOZIbn2Gv jFcxxgAOsZFiUm+WH1+rGYVgDGQb9t1IXVwWVQSDNVb+jm/VYMT+zlYeJDstrR4VAdUq Uf+cN26UeG/vj2Qd+8qIG2elAL9HHvxGr6t6yC+B2F/nMMvw2xKdCmkALVeRVNhAC7bE Jd1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAPR5J0j; 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 h64si2566423oif.215.2020.03.12.07.38.29; Thu, 12 Mar 2020 07:38:42 -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=YAPR5J0j; 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 S1727680AbgCLOiD (ORCPT + 99 others); Thu, 12 Mar 2020 10:38:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbgCLOiC (ORCPT ); Thu, 12 Mar 2020 10:38:02 -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 AF38C20663; Thu, 12 Mar 2020 14:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584023882; bh=0DcC20iLj0N577EVNaLkN4jq6nKFZkDXbAjkEH4vZRc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=YAPR5J0jUgfmVL6WDpJtfYJxBmKXznWHm3NbsyZSAuvkfue0yv0PscM7ujCYwKXcX COBhDT5Mbeo4cigwDSZ0RT8WkiH6PHpN3mob9wzhKFXTFRLoHGcmrKU/N9gFIMGL3Y /1bNyL2KZQrR8i+PwXBtZhw2er5y9xMTljoRZ35c= Date: Thu, 12 Mar 2020 09:38:00 -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: <20200312143800.GA109542@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312140412.32373-1-chenzhou10@huawei.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 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; > --- > 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 >