From: Michael Ellerman <mpe@ellerman.id.au>
To: Bjorn Helgaas <helgaas@kernel.org>, Chen Zhou <chenzhou10@huawei.com>
Cc: paulus@samba.org, 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'
Date: Fri, 13 Mar 2020 21:43:29 +1100 [thread overview]
Message-ID: <877dzoy1pq.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20200312144157.GA110750@google.com>
Bjorn Helgaas <helgaas@kernel.org> writes:
> 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 <hulkci@huawei.com>
>> > Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
>>
>> Michael, if you want this:
>>
>> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>>
>> 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.
I'll take this patch as-is, and someone can send a follow-up to convert
the whole file to kstrtoul().
cheers
next prev parent reply other threads:[~2020-03-13 10:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 14:04 [PATCH -next] PCI: rpaphp: remove set but not used variable 'value' Chen Zhou
2020-03-12 14:38 ` Bjorn Helgaas
2020-03-12 14:41 ` Bjorn Helgaas
2020-03-12 21:36 ` Tyrel Datwyler
2020-03-13 10:43 ` Michael Ellerman [this message]
2020-03-26 12:06 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dzoy1pq.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=chenzhou10@huawei.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=tyreld@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).