Skip to content

Commit

Permalink
mtd: Avoid comma separated statements
Browse files Browse the repository at this point in the history
Use semicolons and braces.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/ae92f4c0507c470d9461886410dc7030192f9014.1598331149.git.joe@perches.com
  • Loading branch information
JoePerches authored and miquelraynal committed Aug 27, 2020
1 parent 9b21084 commit 1d0e5eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/mtd/devices/lart.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,10 @@ static int flash_read (struct mtd_info *mtd,loff_t from,size_t len,size_t *retle
{
int gap = BUSWIDTH - (from & (BUSWIDTH - 1));

while (len && gap--) *buf++ = read8 (from++), len--;
while (len && gap--) {
*buf++ = read8 (from++);
len--;
}
}

/* now we read dwords until we reach a non-dword boundary */
Expand Down Expand Up @@ -518,7 +521,10 @@ static int flash_write (struct mtd_info *mtd,loff_t to,size_t len,size_t *retlen
i = n = 0;

while (gap--) tmp[i++] = 0xFF;
while (len && i < BUSWIDTH) tmp[i++] = buf[n++], len--;
while (len && i < BUSWIDTH) {
tmp[i++] = buf[n++];
len--;
}
while (i < BUSWIDTH) tmp[i++] = 0xFF;

if (!write_dword (aligned,*((__u32 *) tmp))) return (-EIO);
Expand Down

0 comments on commit 1d0e5eb

Please sign in to comment.