From: Markus Armbruster <armbru@redhat.com>
To: Harsh Prateek Bora <harsh.prateek.bora@gmail.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>
Subject: Re: [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector()
Date: Fri, 29 Sep 2023 07:34:20 +0200 [thread overview]
Message-ID: <87zg15k0f7.fsf@pond.sub.org> (raw)
In-Reply-To: <CAEuJdmqPg2TnOBE2q3c+FaP5y9g+fwk=9SG+_u17J8d=5mgp+w@mail.gmail.com> (Harsh Prateek Bora's message of "Tue, 19 Sep 2023 18:31:08 +0530")
Harsh Prateek Bora <harsh.prateek.bora@gmail.com> writes:
> On Tue, 19 Sept, 2023, 5:33 pm Cédric Le Goater, <clg@kaod.org> wrote:
>
>> On 9/19/23 10:29, Harsh Prateek Bora wrote:
>> >
>> >
>> > On 9/18/23 20:28, Cédric Le Goater wrote:
>> >> Remove extra 'drc_index' variable to avoid this warning :
>> >>
>> >> ../hw/ppc/spapr_drc.c: In function ‘rtas_ibm_configure_connector’:
>> >> ../hw/ppc/spapr_drc.c:1240:26: warning: declaration of ‘drc_index’
>> shadows a previous local [-Wshadow=compatible-local]
>> >> 1240 | uint32_t drc_index = spapr_drc_index(drc);
>> >> | ^~~~~~~~~
>> >> ../hw/ppc/spapr_drc.c:1155:14: note: shadowed declaration is here
>> >> 1155 | uint32_t drc_index;
>> >> | ^~~~~~~~~
>> >>
>> >> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> >> ---
>> >> hw/ppc/spapr_drc.c | 2 --
>> >> 1 file changed, 2 deletions(-)
>> >>
>> >> diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
>> >> index b5c400a94d1c..843e318312d3 100644
>> >> --- a/hw/ppc/spapr_drc.c
>> >> +++ b/hw/ppc/spapr_drc.c
>> >> @@ -1237,8 +1237,6 @@ static void
>> rtas_ibm_configure_connector(PowerPCCPU *cpu,
>> >> case FDT_END_NODE:
>> >> drc->ccs_depth--;
>> >> if (drc->ccs_depth == 0) {
>> >> - uint32_t drc_index = spapr_drc_index(drc);
>> >> -
>> > I guess you only wanted to remove re-declaration part. Assigning the
>>
>> value returned by this function doesnt seem to happen before.
>>
>> drc_index is assigned at the top of this large routine with :
>>
>> drc_index = rtas_ld(wa_addr, 0);
>> drc = spapr_drc_by_index(drc_index);
>>
>>
>> So, the extra local variable 'drc_index' is simply redundant because
>> there are no reason for it to change. The drc object is the same AFAICT.
>> Correct ? I should have explained that better in the commit log.
>>
>
> Okay, since both routines were implemented differently, I wasn't sure about
> the impact of reassignment. Better commit log is always welcome.
Do you expect a respin? If not, would you like to give your R-by?
next prev parent reply other threads:[~2023-09-29 5:34 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 14:58 [PATCH 0/8] ppc: Clean up local variable shadowing Cédric Le Goater
2023-09-18 14:58 ` [PATCH 1/8] hw/ppc: Clean up local variable shadowing in _FDT helper routine Cédric Le Goater
2023-09-19 6:53 ` Harsh Prateek Bora
2023-09-18 14:58 ` [PATCH 2/8] pnv/psi: Clean up local variable shadowing Cédric Le Goater
2023-09-19 6:57 ` Harsh Prateek Bora
2023-09-19 9:03 ` Cédric Le Goater
2023-09-29 5:30 ` Markus Armbruster
2023-09-29 6:13 ` Cédric Le Goater
2023-09-18 14:58 ` [PATCH 3/8] spapr: Clean up local variable shadowing in spapr_dt_cpus() Cédric Le Goater
2023-09-19 7:28 ` Harsh Prateek Bora
2023-09-19 11:05 ` Cédric Le Goater
2023-09-19 13:04 ` Harsh Prateek Bora
2023-09-19 14:59 ` Harsh Prateek Bora
2023-09-19 15:05 ` Cédric Le Goater
2023-09-18 14:58 ` [PATCH 4/8] spapr: Clean up local variable shadowing in spapr_init_cpus() Cédric Le Goater
2023-09-19 7:30 ` Harsh Prateek Bora
2023-09-18 14:58 ` [PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path() Cédric Le Goater
2023-09-18 15:29 ` Philippe Mathieu-Daudé
2023-09-19 8:23 ` Harsh Prateek Bora
2023-09-19 11:54 ` Cédric Le Goater
2023-09-18 14:58 ` [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector() Cédric Le Goater
2023-09-19 8:29 ` Harsh Prateek Bora
2023-09-19 12:02 ` Cédric Le Goater
2023-09-19 13:01 ` Harsh Prateek Bora
2023-09-29 5:34 ` Markus Armbruster [this message]
2023-09-29 5:43 ` Harsh Prateek Bora
2023-09-18 14:58 ` [PATCH 7/8] spapr/pci: Clean up local variable shadowing in spapr_phb_realize() Cédric Le Goater
2023-09-19 8:38 ` Harsh Prateek Bora
2023-09-19 12:04 ` Cédric Le Goater
2023-09-18 14:58 ` [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt() Cédric Le Goater
2023-09-18 15:30 ` Philippe Mathieu-Daudé
2023-09-19 8:48 ` Harsh Prateek Bora
2023-09-19 12:07 ` Cédric Le Goater
2023-09-19 12:55 ` Harsh Prateek Bora
2023-09-29 5:39 ` Markus Armbruster
2023-09-29 6:07 ` Cédric Le Goater
2023-09-29 6:18 ` Harsh Prateek Bora
2023-10-04 10:26 ` [PATCH 0/8] ppc: Clean up local variable shadowing Markus Armbruster
2023-10-04 11:56 ` Cédric Le Goater
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=87zg15k0f7.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=harsh.prateek.bora@gmail.com \
--cc=harshpb@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.