From: Aishwarya Pant <aishpant@gmail.com>
To: Lidza Louina <lidza.louina@gmail.com>,
Mark Hounschell <markh@compro.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: outreachy-kernel@googlegroups.com
Subject: [PATCH v4] staging: dgnc: replace udelay with usleep_range
Date: Mon, 27 Feb 2017 22:04:45 +0530 [thread overview]
Message-ID: <20170227163445.GA4514@aishwarya> (raw)
Fix checkpatch warning on dgnc_cls.c : CHECK usleep_range
is preferred over udelay. There is one ocurrence of udelay in
function cls_uart_init with non-atomic context that can be safely
replaced by usleep_range(t, t + delta) where delta is t (as t is
between 10 and 20 microseconds). Also replace usleep_range by udelay in
function cls_flush_uart_write as it is called under a channel lock.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
Changes in v4:
- Fix commit message formatting
Changes in v3:
- Replace usleep_range by udelay in cls_flush_uart_write
- Fix diff in commit message
Changes in v2:
- Revert usage of usleep_range in atomic context
- Cleanup the commit message
drivers/staging/dgnc/dgnc_cls.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index c20ffdd..7068c3b 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -609,7 +609,7 @@ static void cls_flush_uart_write(struct channel_t *ch)
writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
&ch->ch_cls_uart->isr_fcr);
- usleep_range(10, 20);
+ udelay(10);
ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
}
@@ -1096,7 +1096,7 @@ static void cls_uart_init(struct channel_t *ch)
writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
&ch->ch_cls_uart->isr_fcr);
- udelay(10);
+ usleep_range(10, 20);
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
--
2.7.4
next reply other threads:[~2017-02-27 16:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 16:34 Aishwarya Pant [this message]
2017-02-28 6:18 ` [PATCH v4] staging: dgnc: replace udelay with usleep_range Aishwarya Pant
2017-03-01 8:02 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170227163445.GA4514@aishwarya \
--to=aishpant@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=lidza.louina@gmail.com \
--cc=markh@compro.net \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.