qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/20] sdcard: Fix sd_crc*() style


From: Alistair Francis
Subject: Re: [Qemu-devel] [PATCH 08/20] sdcard: Fix sd_crc*() style
Date: Fri, 04 May 2018 23:34:39 +0000

On Fri, May 4, 2018 at 9:03 AM Philippe Mathieu-Daudé <address@hidden>
wrote:

> Fix style to keep patchew/checkpatch happy when moving this code
> in the next patch.

> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>

Reviewed-by: Alistair Francis <address@hidden>

Alistair

> ---
>   hw/sd/sd.c | 16 ++++++++++------
>   1 file changed, 10 insertions(+), 6 deletions(-)

> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 3708ec1d72..a28ef8de5e 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -243,12 +243,14 @@ static uint8_t sd_crc7(const void *message, size_t
width)
>       uint8_t shift_reg = 0x00;
>       const uint8_t *msg = (const uint8_t *)message;

> -    for (i = 0; i < width; i ++, msg ++)
> -        for (bit = 7; bit >= 0; bit --) {
> +    for (i = 0; i < width; i++, msg++) {
> +        for (bit = 7; bit >= 0; bit--) {
>               shift_reg <<= 1;
> -            if ((shift_reg >> 7) ^ ((*msg >> bit) & 1))
> +            if ((shift_reg >> 7) ^ ((*msg >> bit) & 1)) {
>                   shift_reg ^= 0x89;
> +            }
>           }
> +    }

>       return shift_reg;
>   }
> @@ -260,12 +262,14 @@ static uint16_t sd_crc16(const void *message,
size_t width)
>       const uint16_t *msg = (const uint16_t *)message;
>       width <<= 1;

> -    for (i = 0; i < width; i ++, msg ++)
> -        for (bit = 15; bit >= 0; bit --) {
> +    for (i = 0; i < width; i++, msg++) {
> +        for (bit = 15; bit >= 0; bit--) {
>               shift_reg <<= 1;
> -            if ((shift_reg >> 15) ^ ((*msg >> bit) & 1))
> +            if ((shift_reg >> 15) ^ ((*msg >> bit) & 1)) {
>                   shift_reg ^= 0x1011;
> +            }
>           }
> +    }

>       return shift_reg;
>   }
> --
> 2.17.0



reply via email to

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