staging: dgnc: replace udelay with usleep_range
PATCH v3 1/1 staging: dgnc: replace udelay with usleep_range
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.
---
Changes in v3:
- Replace usleep_range by udelay in cls_flush_uart_write
- Fix diff in the commit message
--- drivers/staging/dgnc/dgnc_cls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
@@ -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 );
Signature · 1 line
2.7.4
Quoted 6 lines · Aishwarya Pant
Fix checkpatch warning on
dgnc_cls.c: CHECKusleep_range
is preferred over udelay. There is one ocurrence of udelay in functioncls_uart_initwith non-atomic context that can be safely replaced byusleep_range(t, t + delta)where delta is t (as t is between 10 and 20 microseconds). Also replaceusleep_rangeby udelay in functioncls_flush_uart_writeas it is called under a channel lock.
I have the impression that these are two separate issues that should be treated in two separate patches.
Quoted 7 lines
Signed-off-by Aishwarya Pant <[email protected]>---
Changes in v3:
- Replaceusleep_rangeby udelay incls_flush_uart_write
- Fix diff in the commit message
---
You don't need a --- below your v3 comments, only above.
julia
Quoted 35 lines
drivers/staging/dgnc/dgnc_cls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/dgnc/dgnc_cls.c +2
-3@@ -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
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170227155229.GA4214%40aishwarya.
For more options, visit https://groups.google.com/d/optout.
Greg Kroah-Hartman
maintainerQuoted 11 lines · Julia Lawall
Quoted 6 lines · Aishwarya Pant
Fix checkpatch warning on
dgnc_cls.c: CHECKusleep_range
is preferred over udelay. There is one ocurrence of udelay in functioncls_uart_initwith non-atomic context that can be safely replaced byusleep_range(t, t + delta)where delta is t (as t is between 10 and 20 microseconds). Also replaceusleep_rangeby udelay in functioncls_flush_uart_writeas it is called under a channel lock.
Quoted 2 lines
I have the impression that these are two separate issues that should be treated in two separate patches.
I agree, this needs to be two different patches.
thanks,
greg k-h