* [PATCH v2] mtd: cfi_util: use DIV_ROUND_UP() in cfi_udelay()
@ 2019-09-27 20:22 Sergei Shtylyov
0 siblings, 0 replies; only message in thread
From: Sergei Shtylyov @ 2019-09-27 20:22 UTC (permalink / raw)
To: David Woodhouse, Brian Norris, Marek Vasut, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, linux-mtd
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>
---
This patch is atop of the 'mtd/next' branch of the MTD 'linux.git' repo.
Changes in version 2:
- rewrote the patch description.
drivers/mtd/chips/cfi_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux/drivers/mtd/chips/cfi_util.c
===================================================================
--- linux.orig/drivers/mtd/chips/cfi_util.c
+++ linux/drivers/mtd/chips/cfi_util.c
@@ -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();
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-27 20:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 20:22 [PATCH v2] mtd: cfi_util: use DIV_ROUND_UP() in cfi_udelay() Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).