All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org,  qemu-ppc@nongnu.org
Subject: Re: [PATCH v2 1/2] cleanup: Tweak and re-run return_directly.cocci
Date: Tue, 22 Nov 2022 16:48:02 +0100	[thread overview]
Message-ID: <87mt8j9ej1.fsf@pond.sub.org> (raw)
In-Reply-To: <8e38e4d1-4b1a-bae7-873b-2ad61489dc77@eik.bme.hu> (BALATON Zoltan's message of "Tue, 22 Nov 2022 15:06:14 +0100 (CET)")

BALATON Zoltan <balaton@eik.bme.hu> writes:

> On Tue, 22 Nov 2022, Markus Armbruster wrote:
>> Tweak the semantic patch to drop redundant parenthesis around the
>> return expression.
>>
>> Coccinelle drops a comment in hw/rdma/vmw/pvrdma_cmd.c; restored
>> manually.
>>
>> Coccinelle messes up vmdk_co_create(), not sure why.  Change dropped,
>> will be done manually in the next commit.
>>
>> Line breaks in target/avr/cpu.h and hw/rdma/vmw/pvrdma_cmd.c tidied up
>> manually.
>>
>> Whitespace in tools/virtiofsd/fuse_lowlevel.c tidied up manually.
>>
>> checkpatch.pl complains "return of an errno should typically be -ve"
>> two times for hw/9pfs/9p-synth.c.  Preexisting, the patch merely makes
>> it visible to checkpatch.pl.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>

[...]

>> diff --git a/hw/ppc/ppc4xx_sdram.c b/hw/ppc/ppc4xx_sdram.c
>> index 8d7137faf3..54bf9a2b44 100644
>> --- a/hw/ppc/ppc4xx_sdram.c
>> +++ b/hw/ppc/ppc4xx_sdram.c
>> @@ -520,13 +520,10 @@ static inline hwaddr sdram_ddr2_base(uint32_t bcr)
>>
>> static hwaddr sdram_ddr2_size(uint32_t bcr)
>> {
>> -    hwaddr size;
>>      int sh;
>>
>>      sh = 1024 - ((bcr >> 6) & 0x3ff);
>> -    size = 8 * MiB * sh;
>> -
>> -    return size;
>> +    return 8 * MiB * sh;
>> }
>>
>> static uint32_t sdram_ddr2_dcr_read(void *opaque, int dcrn)
>
> There's also an sdram_ddr_size() that's similar and could be changed to
>
> return sh == 7 ? -1 : (4 * MiB) << sh;
>
> just to keep these two functions simliar but Coccinelle probably does not catch that. Also while you're at it the assigmment of sh could be moved to 
> the declaration to save even more lines. As this then becomes more of a handwritten patch, maybe it should be a separate patch cleaning these two 
> functions before the rest.

I think it needs to be separate to keep me off Peter's naughty list ;)

> Otherwise for this part (or separate patch as above):
>
> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>

Thanks!



  reply	other threads:[~2022-11-22 15:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 13:49 [PATCH v2 0/2] cleanup: Tweak and re-run return_directly.cocci Markus Armbruster
2022-11-22 13:49 ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:49 ` [PATCH v2 1/2] " Markus Armbruster
2022-11-22 13:49   ` [Virtio-fs] " Markus Armbruster
2022-11-22 14:06   ` BALATON Zoltan
2022-11-22 15:48     ` Markus Armbruster [this message]
2022-11-22 15:10   ` Philippe Mathieu-Daudé
2022-11-22 15:10     ` [Virtio-fs] " Philippe Mathieu-Daudé
2022-11-24 14:24   ` Dr. David Alan Gilbert
2022-11-24 14:24     ` [Virtio-fs] " Dr. David Alan Gilbert
2022-11-24 15:15   ` Greg Kurz
2022-11-24 15:15     ` [Virtio-fs] " Greg Kurz
2022-11-24 15:24     ` Greg Kurz
2022-11-24 15:24       ` [Virtio-fs] " Greg Kurz
2022-11-24 18:41       ` Markus Armbruster
2022-11-24 18:41         ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:49 ` [PATCH v2 2/2] block/vmdk: Simplify vmdk_co_create() to return directly Markus Armbruster
2022-11-22 13:49   ` [Virtio-fs] " Markus Armbruster
2022-11-22 13:52   ` Peter Maydell
2022-11-22 13:52     ` [Virtio-fs] " Peter Maydell
2022-11-22 15:05   ` Philippe Mathieu-Daudé
2022-11-22 15:05     ` [Virtio-fs] " Philippe Mathieu-Daudé
2022-11-23  7:06 ` [PATCH 3/2] ppc4xx_sdram: Simplify sdram_ddr_size() to return Markus Armbruster
2022-11-23 10:44   ` BALATON Zoltan
2022-11-23 11:12     ` Markus Armbruster
2022-11-23 11:17   ` Philippe Mathieu-Daudé

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=87mt8j9ej1.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=balaton@eik.bme.hu \
    --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.