Re: [PATCH 4/8] staging: rts5208: Logical continuation fixes

From: Joe Perches
Date: Mon Oct 03 2016 - 19:26:09 EST


On Mon, 2016-10-03 at 23:17 +0000, Wayne Porter wrote:
> Checkpatch detected multiple instances of logical continuation warnings
[]
> diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
[]
> @@ -819,11 +819,11 @@ static int reset_xd(struct rtsx_chip *chip)
> }
>
> if ((buf[0] == 0x01) && (buf[1] == 0x03) &&
> - (buf[2] == 0xD9)
> - && (buf[3] == 0x01) && (buf[4] == 0xFF)
> - && (buf[5] == 0x18) && (buf[6] == 0x02)
> - && (buf[7] == 0xDF) && (buf[8] == 0x01)
> - && (buf[9] == 0x20)) {
> + (buf[2] == 0xD9) &&
> + (buf[3] == 0x01) && (buf[4] == 0xFF) &&
> + (buf[5] == 0x18) && (buf[6] == 0x02) &&
> + (buf[7] == 0xDF) && (buf[8] == 0x01) &&
> + (buf[9] == 0x20)) {

memcmp might be easier to read

if (!memcmp(buf, "\x01\x03\xd9\x01\xff\x18\x02\xdf\x01\x20", 10))