Skip to contentSkip to conversation

staging: nvec: cleanup USLEEP_RANGE checkpatch checks

PATCH In review simran singhal 4 participants 9 messages Mar 2, 2017 – Mar 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: nvec: cleanup USLEEP_RANGE checkpatch checks

Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

---
 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +2 -2
index c1feccf..cd35e64 100644
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		break;
 	case 2:		/* first byte after command */
 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
-			udelay(33);
+			usleep_range(33, 100);
 			if (nvec->rx->data[0] != 0x01) {
 				dev_err(nvec->dev,
 					"Read without prior read command\n");
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 	 * We experience less incomplete messages with this delay than without
 	 * it, but we don't know why. Help is appreciated.
 	 */
-	udelay(100);
+	usleep_range(100, 200);
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.7.4
#1 lore raw
Quoted 16 lines · simran singhal

Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

---
 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +0 -0
index c1feccf..cd35e64 100644

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 634

Quoted 5 lines
drivers/staging/nvec/nvec.c +1 -1
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		break;
 	case 2:		/* first byte after command */
 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
-			udelay(33);
+			usleep_range(33, 100);

How did you choose the upper limit.

I believe that Greg previously suggested not to make these changes if you have no way to test them.

julia

Quoted 22 lines
drivers/staging/nvec/nvec.c +1 -2
 			if (nvec->rx->data[0] != 0x01) {
 				dev_err(nvec->dev,
 					"Read without prior read command\n");
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 	 * We experience less incomplete messages with this delay than without
 	 * it, but we don't know why. Help is appreciated.
 	 */
-	udelay(100);
+	usleep_range(100, 200);
 
 	return IRQ_HANDLED;
 }
--

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/20170302142418.GA16773%40singhal-Inspiron-5558.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 28 lines · Julia Lawall

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 16 lines · simran singhal

Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

Signed-off-by simran singhal <[email protected] <javascript:>>

---

 drivers/staging/nvec/nvec.c | 4 ++-- 
 1 file changed, 2 insertions(+), 2 deletions(-) 
drivers/staging/nvec/nvec.c +0 -0
index c1feccf..cd35e64 100644 
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void 

*dev)

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 634

Quoted 5 lines
drivers/staging/nvec/nvec.c +1 -1
                 break; 
         case 2:                /* first byte after command */ 
                 if (status == (I2C_SL_IRQ | RNW | RCVD)) { 
-                        udelay(33); 
+                        usleep_range(33, 100); 
Quoted 6 lines

How did you choose the upper limit.

I believe that Greg previously suggested not to make these changes if you have no way to test them.

Julia, After going through the reply given by Nicholas Mc Guire

https://www.mail-archive.com/[email protected]/msg16464.html
in this reply he has mentioned that even the range of 10 microsecond is enough,
so I prefer to take 100 as upper limit.

Simran

julia

Quoted 33 lines

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev)

Quoted 5 lines
drivers/staging/nvec/nvec.c +0 -0
                         if (nvec->rx->data[0] != 0x01) { 
                                 dev_err(nvec->dev, 
                                         "Read without prior read 

command\n");

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void 

*dev)

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void · line 718

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
          * We experience less incomplete messages with this delay than 

without

Quoted 12 lines
drivers/staging/nvec/nvec.c +1 -1
          * it, but we don't know why. Help is appreciated. 
          */ 
-        udelay(100); 
+        usleep_range(100, 200); 
 
         return IRQ_HANDLED; 
 } 
Signature · 4 lines
2.7.4 

-- 
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16773%40singhal-Inspiron-5558.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

maintainer
#3 lore raw

Re: [Outreachy kernel] [PATCH] staging: nvec: cleanup USLEEP_RANGEcheckpatch checks

Hi Simran,

Am Donnerstag, 2. März 2017, 15:48:13 CET schrieb SIMRAN SINGHAL:

Quoted 9 lines · Julia Lawall
Quoted 8 lines · simran singhal
Quoted 7 lines

Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

Signed-off-by simran singhal <[email protected] <javascript:>>

I prefer not to change this. The whole interrupt routine is very wonky, and changing some delays might break the communication with the i2c master. Also this is in interrupt context, so a change to usleep_range may not by justified.

Marc

Quoted 29 lines
Quoted 22 lines

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 10 lines

---

 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +0 -0
index c1feccf..cd35e64 100644
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void

*dev)

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 634

Quoted 8 lines
drivers/staging/nvec/nvec.c +1 -1
                 break;
 
         case 2:                /* first byte after command */
 
                 if (status == (I2C_SL_IRQ | RNW | RCVD)) {
 
-                        udelay(33);
+                        usleep_range(33, 100);
Quoted 6 lines

How did you choose the upper limit.

I believe that Greg previously suggested not to make these changes if you have no way to test them.

Julia, After going through the reply given by Nicholas Mc Guire

Quoted 50 lines

https://www.mail-archive.com/[email protected]/msg16464.html
in this reply he has mentioned that even the range of 10 microsecond is enough,
so I prefer to take 100 as upper limit.

Simran

julia

Quoted 41 lines
Quoted 5 lines
                         if (nvec->rx->data[0] != 0x01) {
                         
                                 dev_err(nvec->dev,
                                 
                                         "Read without prior read

command\n");

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void

*dev)

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void · line 718

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
          * We experience less incomplete messages with this delay than

without

Quoted 9 lines
drivers/staging/nvec/nvec.c +1 -1
          * it, but we don't know why. Help is appreciated.
          */
 
-        udelay(100);
+        usleep_range(100, 200);
 
         return IRQ_HANDLED;

}

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16773%
40singhal-Inspiron-5558.>

Quoted 1 line

For more options, visit https://groups.google.com/d/optout.

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#4 lore raw

Re: [Outreachy kernel] [PATCH] staging: nvec: cleanup USLEEP_RANGEcheckpatch checks

Quoted 15 lines · Marc Dietrich

Hi Simran,

Am Donnerstag, 2. März 2017, 15:48:13 CET schrieb SIMRAN SINGHAL:

Quoted 3 lines · Julia Lawall
Quoted 2 lines · simran singhal
Quoted 1 line

Resolve strict checkpatch USLEEP_RANGE checks by converting delays

and

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

Signed-off-by simran singhal <[email protected] <javascript:>>
Quoted 8 lines

I prefer not to change this. The whole interrupt routine is very wonky, and
changing some delays might break the communication with the i2c master. Also
this is in interrupt context, so a change to usleep_range may not by justified.

Thanks, for the explination.

Simran

Quoted 91 lines

Marc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines

---

 drivers/staging/nvec/nvec.c | 4 ++-- 
 1 file changed, 2 insertions(+), 2 deletions(-) 
(quoted diff) +0 -0

b/drivers/staging/nvec/nvec.c

Quoted 11 lines
Quoted 11 lines

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 4 lines

index c1feccf..cd35e64 100644

drivers/staging/nvec/nvec.c +0 -0
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void 

*dev)

Quoted 4 lines
drivers/staging/nvec/nvec.c +0 -0
                 break; 
 
         case 2:                /* first byte after command */ 
 
Quoted 8 lines
Quoted 8 lines

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 634

Quoted 4 lines
drivers/staging/nvec/nvec.c +1 -1
                 if (status == (I2C_SL_IRQ | RNW | RCVD)) { 
 
-                        udelay(33); 
+                        usleep_range(33, 100); 

How did you choose the upper limit.

I believe that Greg previously suggested not to make these changes if

you

Quoted 5 lines
Quoted 3 lines

have no way to test them.

Julia, After going through the reply given by Nicholas Mc Guire

https://www.mail-archive.com/[email protected]/msg16464.html

Quoted 4 lines

in this reply he has mentioned that even the range of 10 microsecond is enough,
so I prefer to take 100 as upper limit.

Quoted 17 lines

Simran

julia

Quoted 13 lines
Quoted 5 lines
                         if (nvec->rx->data[0] != 0x01) { 
                          
                                 dev_err(nvec->dev, 
                                  
                                         "Read without prior read 

command\n");

drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
@@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void 

*dev)

Quoted 1 line
drivers/staging/nvec/nvec.c +0 -0
          * We experience less incomplete messages with this delay 

than

Quoted 9 lines
Quoted 9 lines

without

Quoted 6 lines
drivers/staging/nvec/nvec.c +1 -1
          * it, but we don't know why. Help is appreciated. 
          */ 
 
-        udelay(100); 
+        usleep_range(100, 200); 
 
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
drivers/staging/nvec/nvec.c +0 -0
         return IRQ_HANDLED; 

}

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it,

send

Quoted 10 lines
Quoted 10 lines

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16773%

Quoted 2 lines
Quoted 2 lines

40singhal-Inspiron-5558.>

Quoted 1 line

For more options, visit https://groups.google.com/d/optout.

#5 lore raw

Re: [Outreachy kernel] [PATCH] staging: nvec: cleanup USLEEP_RANGEcheckpatch checks

In reply to Marc Dietrich
Quoted 11 lines · Marc Dietrich

Hi Simran,

Am Donnerstag, 2. März 2017, 15:48:13 CET schrieb SIMRAN SINGHAL:

Quoted 8 lines · Julia Lawall
Quoted 7 lines · simran singhal
Quoted 6 lines

Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt.

CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Signed-off-by simran singhal <[email protected] <javascript:>>

I prefer not to change this. The whole interrupt routine is very wonky, and changing some delays might break the communication with the i2c master. Also this is in interrupt context, so a change to usleep_range may not by justified.

Yeah, I think this is going to trigger a WARN_ON from somewhere in the scheduler because of the interrupt context. I suppose checkpatch could be made smarter about this, though I doubt my perl skills would be up to it.

Thierry

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#6 lore raw
In reply to SIMRAN SINGHAL
Quoted 40 lines · SIMRAN SINGHAL

On Thursday, March 2, 2017 at 8:06:40 PM UTC+5:30, Julia Lawall wrote:

      On Thu, 2 Mar 2017, simran singhal wrote:

      > Resolve strict checkpatch USLEEP_RANGE checks by converting
      delays and
      > sleeps as described in
      ./Documentation/timers/timers-howto.txt.
      >
      > CHECK: usleep_range is preferred over udelay; see
      Documentation/
      > timers/timers-howto.txt
      >
      > Signed-off-by: simran singhal <[email protected]>
      > ---
      >  drivers/staging/nvec/nvec.c | 4 ++--
      >  1 file changed, 2 insertions(+), 2 deletions(-)
      >
      > diff --git a/drivers/staging/nvec/nvec.c
      b/drivers/staging/nvec/nvec.c
      > index c1feccf..cd35e64 100644
      > --- a/drivers/staging/nvec/nvec.c
      > +++ b/drivers/staging/nvec/nvec.c
      > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq,
      void *dev)
      >                  break;
      >          case 2:                /* first byte after command */
      >                  if (status == (I2C_SL_IRQ | RNW | RCVD)) {
      > -                        udelay(33);
      > +                        usleep_range(33, 100);

      How did you choose the upper limit.

      I believe that Greg previously suggested not to make these
      changes if you
      have no way to test them.
Quoted 5 lines

Julia, After going through the reply given by Nicholas Mc Guire
https://www.mail-archive.com/[email protected]/msg16464.html
in this reply he has mentioned that even the range of 10 microsecond is enough,
so I prefer to take 100 as upper limit.

Than you for the link.

It looks like he suggests to change 33 to 30-40, not to 33-100. In any case, you have three choices for this kind of issue:
1. Don't make the change, because you can't test the result
2. Make the change, and explain the commit log what your rationale is
3. Make the change, and explain below the --- that you have no idea what you are doing, and you are just proposing the patch as something concrete to start a discussion.

But your preference is not a suitable justification. The hardware does something, and the choice can only really be made by the person who knows what it does.

julia

Quoted 36 lines


Simran

      julia


      >                          if (nvec->rx->data[0] != 0x01) {
      >                                  dev_err(nvec->dev,
      >                                          "Read without prior
      read command\n");
      > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq,
      void *dev)
      >           * We experience less incomplete messages with this
      delay than without
      >           * it, but we don't know why. Help is appreciated.
      >           */
      > -        udelay(100);
      > +        usleep_range(100, 200);
      >
      >          return IRQ_HANDLED;
      >  }
      > --
      > 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16773%4
      0singhal-Inspiron-5558.
      > For more options, visit https://groups.google.com/d/optout.
      >
Quoted 11 lines

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/b90bc602-cf06-4abb-bea2- 6386d4976864%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#7 lore raw
Quoted 62 lines · Julia Lawall
Quoted 40 lines · SIMRAN SINGHAL

On Thursday, March 2, 2017 at 8:06:40 PM UTC+5:30, Julia Lawall wrote:

      On Thu, 2 Mar 2017, simran singhal wrote: 

      > Resolve strict checkpatch USLEEP_RANGE checks by converting 
      delays and 
      > sleeps as described in 
      ./Documentation/timers/timers-howto.txt. 
      > 
      > CHECK: usleep_range is preferred over udelay; see 
      Documentation/ 
      > timers/timers-howto.txt 
      > 
      > Signed-off-by: simran singhal <[email protected]> 
      > --- 
      >  drivers/staging/nvec/nvec.c | 4 ++-- 
      >  1 file changed, 2 insertions(+), 2 deletions(-) 
      > 
      > diff --git a/drivers/staging/nvec/nvec.c 
      b/drivers/staging/nvec/nvec.c 
      > index c1feccf..cd35e64 100644 
      > --- a/drivers/staging/nvec/nvec.c 
      > +++ b/drivers/staging/nvec/nvec.c 
      > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, 
      void *dev) 
      >                  break; 
      >          case 2:                /* first byte after command */ 
      >                  if (status == (I2C_SL_IRQ | RNW | RCVD)) { 
      > -                        udelay(33); 
      > +                        usleep_range(33, 100); 

      How did you choose the upper limit. 

      I believe that Greg previously suggested not to make these 
      changes if you 
      have no way to test them. 
Quoted 2 lines

Julia, After going through the reply given by Nicholas Mc Guire

https://www.mail-archive.com/[email protected]/msg16464.html

Quoted 3 lines

in this reply he has mentioned that even the range of 10 microsecond is enough,
so I prefer to take 100 as upper limit.

Than you for the link.

It looks like he suggests to change 33 to 30-40, not to 33-100. In any case, you have three choices for this kind of issue:
1. Don't make the change, because you can't test the result
2. Make the change, and explain the commit log what your rationale is
3. Make the change, and explain below the --- that you have no idea what you are doing, and you are just proposing the patch as something concrete to start a discussion.

Quoted 5 lines

But your preference is not a suitable justification. The hardware does something, and the choice can only really be made by the person who knows what it does.

Thanks,
Julia I'll keep this in mind from next time.

I choose the range from 33 to 100 for being on more safer side. Should I make it 30-40 and send v2.

julia

Quoted 53 lines
Quoted 25 lines

Simran

      julia 


      >                          if (nvec->rx->data[0] != 0x01) { 
      >                                  dev_err(nvec->dev, 
      >                                          "Read without prior 
      read command\n"); 
      > @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, 
      void *dev) 
      >           * We experience less incomplete messages with this 
      delay than without 
      >           * it, but we don't know why. Help is appreciated. 
      >           */ 
      > -        udelay(100); 
      > +        usleep_range(100, 200); 
      > 
      >          return IRQ_HANDLED; 
      >  } 
      > -- 
      > 2.7.4 
      > 
Quoted 8 lines
      > -- 
      > 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 visithttps://

groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16773%4

Quoted 6 lines
      0singhal-Inspiron-5558. 
      > For more options, visit https://groups.google.com/d/optout. 
      > 
Signature · 1 line
You received this message because you are subscribed to the Google 

Groups

Quoted 2 lines

"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send

an

Quoted 2 lines

email to [email protected] <javascript:>. To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/b90bc602-cf06-4abb-bea2-

Quoted 4 lines

6386d4976864%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw
Quoted 82 lines · SIMRAN SINGHAL

On Thursday, March 2, 2017 at 8:31:23 PM UTC+5:30, Julia Lawall wrote:

On Thu, 2 Mar 2017, SIMRAN SINGHAL wrote:

>
>
> On Thursday, March 2, 2017 at 8:06:40 PM UTC+5:30, Julia Lawall wrote:
>
>
>       On Thu, 2 Mar 2017, simran singhal wrote:
>
>       > Resolve strict checkpatch USLEEP_RANGE checks by converting
>       delays and
>       > sleeps as described in
>       ./Documentation/timers/timers-howto.txt.
>       >
>       > CHECK: usleep_range is preferred over udelay; see >       Documentation/
>       > timers/timers-howto.txt
>       >
>       > Signed-off-by: simran singhal <[email protected]> >       > ---
>       >  drivers/staging/nvec/nvec.c | 4 ++--
>       >  1 file changed, 2 insertions(+), 2 deletions(-) >       >
>       > diff --git a/drivers/staging/nvec/nvec.c >       b/drivers/staging/nvec/nvec.c
>       > index c1feccf..cd35e64 100644
>       > --- a/drivers/staging/nvec/nvec.c
>       > +++ b/drivers/staging/nvec/nvec.c
>       > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq,
>       void *dev)
>       >                  break;
>       >          case 2:                /* first byte after command */
>       >                  if (status == (I2C_SL_IRQ | RNW | RCVD)) {
>       > -                        udelay(33);
>       > +                        usleep_range(33, 100); >
>       How did you choose the upper limit.
>
>       I believe that Greg previously suggested not to make these
>       changes if you
>       have no way to test them.
>
> Julia, After going through the reply given by Nicholas Mc Guire
>
https://www.mail-archive.com/[email protected]/msg16464.html
> in this reply he has mentioned that even the range of 10 microsecond is
> enough,
> so I prefer to take 100 as upper limit.

Than you for the link.

It looks like he suggests to change 33 to 30-40, not to 33-100. In any
case, you have three choices for this kind of issue:
1. Don't make the change, because you can't test the result
2. Make the change, and explain the commit log what your rationale is
3. Make the change, and explain below the --- that you have no idea what
you are doing, and you are just proposing the patch as something concrete
to start a discussion.

But your preference is not a suitable justification.  The hardware does
something, and the choice can only really be made by the person who knows
what it does.

Quoted 6 lines


Thanks,
Julia I'll keep this in mind from next time.

I choose the range from 33 to 100 for being on more safer side. Should I make it 30-40 and send v2.

I thought that the maintainer already responded saying that one shouldnot change this code?

julia

Quoted 64 lines

julia

>
> Simran
>
>       julia
>
>
>       >                          if (nvec->rx->data[0] !=
0x01) {
>       >                                  dev_err(nvec->dev,
>       >                                          "Read without
prior
>       read command\n");
>       > @@ -718,7 +718,7 @@ static irqreturn_t
nvec_interrupt(int irq,
>       void *dev)
>       >           * We experience less incomplete messages
with this
>       delay than without
>       >           * it, but we don't know why. Help is
appreciated.
>       >           */
>       > -        udelay(100);
>       > +        usleep_range(100, 200);
>       >
>       >          return IRQ_HANDLED;
>       >  }
>       > --
>       > 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 webvisithttps://groups.google.com/d/msgid/outreachy-kernel/20170302142418.GA16 773%4
>       0singhal-Inspiron-5558.
>       > For more options, visit
https://groups.google.com/d/optout.
>       >
>
> --
> 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 webvisithttps://groups.google.com/d/msgid/outreachy-kernel/b90bc602-cf06-4abb- bea2-
> 6386d4976864%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

Quoted 11 lines

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/4958c8a8-4b50-4567-91d8- 9554e9bdf7f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel