qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/block: replace TABs with space Bring the block files in l


From: Eric Blake
Subject: Re: [PATCH] hw/block: replace TABs with space Bring the block files in line with the QEMU coding style, with spaces for indentation. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/371
Date: Fri, 10 Mar 2023 13:13:16 -0600
User-agent: NeoMutt/20220429

Missing the blank line between the one-line summary and the rest of
the commit body, which killed the subject line.

You now have multiple threads referencing gitlab issue 371; maybe
instead of saying 'Resolves:', you should just mention that each patch
is a partial resolution (since one patch in isolation is obviously not
resolving it tree-wide, if you have other series referencing the same
bug).

On Fri, Mar 10, 2023 at 06:31:49PM +0800, Yeqi Fu wrote:
> Signed-off-by: Yeqi Fu <fufuyqqqqqq@gmail.com>
> ---
>  hw/block/fdc.c     |   4 +-
>  hw/block/nand.c    | 222 ++++++++++++++++++++++-----------------------
>  hw/block/onenand.c | 126 ++++++++++++-------------
>  hw/block/tc58128.c | 136 +++++++++++++--------------
>  4 files changed, 244 insertions(+), 244 deletions(-)
> 

> +++ b/hw/block/onenand.c
> @@ -35,10 +35,10 @@
>  #include "qom/object.h"
>  
>  /* 11 for 2kB-page OneNAND ("2nd generation") and 10 for 1kB-page chips */
> -#define PAGE_SHIFT   11
> +#define PAGE_SHIFT 11
>  
>  /* Fixed */
> -#define BLOCK_SHIFT  (PAGE_SHIFT + 6)
> +#define BLOCK_SHIFT (PAGE_SHIFT + 6)
>  
>  #define TYPE_ONE_NAND "onenand"
>  OBJECT_DECLARE_SIMPLE_TYPE(OneNANDState, ONE_NAND)
> @@ -408,23 +408,23 @@ static void onenand_command(OneNANDState *s)
>      int b;
>      int sec;
>      void *buf;
> -#define SETADDR(block, page)                 \
> -    sec = (s->addr[page] & 3) +                      \
> -            ((((s->addr[page] >> 2) & 0x3f) +        \
> -              (((s->addr[block] & 0xfff) |   \
> -                (s->addr[block] >> 15 ?              \

The old code had aligned '\' (harder to see when diff's prefix messes
up tab stops)...

> +#define SETADDR(block, page)    \
> +    sec = (s->addr[page] & 3) + \
> +            ((((s->addr[page] >> 2) & 0x3f) +   \
> +              (((s->addr[block] & 0xfff) |  \
> +                (s->addr[block] >> 15 ?     \
>                   s->density_mask : 0)) << 6)) << (PAGE_SHIFT - 9));

...but the spacing on the new-code is inconsistent.  Whereas I'm
ambivalent on aligned '=' in struct initializations, when it comes to
preprocessor macros, I'm very much a fan of using aligned '\'.

You may also want to mention that 'git diff -w ...' shows no change,
proving that the patch is whitespace only (or if it does show change,
that it is because you rewrapped lines).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]