Skip to content

Commit

Permalink
mtd: cfi_util: use DIV_ROUND_UP() in cfi_udelay()
Browse files Browse the repository at this point in the history
Use DIV_ROUND_UP() in cfi_udelay() instead of open-coding it...

Doing this also helpfully gets rid of two complaints from
'scripts/checkpatch.pl --strict':

CHECK: spaces preferred around that '+' (ctx:VxV)
#29: FILE: drivers/mtd/chips/cfi_util.c:29:
+		msleep((us+999)/1000);
 		          ^

CHECK: spaces preferred around that '/' (ctx:VxV)
#29: FILE: drivers/mtd/chips/cfi_util.c:29:
+		msleep((us+999)/1000);
			       ^

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
  • Loading branch information
Sergei Shtylyov authored and r-vignesh committed Nov 9, 2019
1 parent 54ecb8f commit d532c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/chips/cfi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
void cfi_udelay(int us)
{
if (us >= 1000) {
msleep((us+999)/1000);
msleep(DIV_ROUND_UP(us, 1000));
} else {
udelay(us);
cond_resched();
Expand Down

0 comments on commit d532c28

Please sign in to comment.