Skip to contentSkip to conversation

staging: wilc1000: Fix warning usleep_range() shouldn't use min ==max args.

PATCH Superseded Rakhi Sharma 2 participants 5 messages Feb 27, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Fix warning usleep_range() shouldn't use min ==max args.

As usleep_range should not use min == max args.This patch fixes checkpatch
warning: usleep_range should not use min == max args; see Documentation/timers/timers-howto.txt.

---
 drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +2 -2
index 83af51b..8d6a457 100644
@@ -766,7 +766,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				}
 				PRINT_WRN(GENERIC_DBG, "[wilc txq]: warn, vmm table not clear yet, wait...\n");
 				release_bus(wilc, RELEASE_ALLOW_SLEEP);
-				usleep_range(3000, 3000);
+				usleep_range(3000, 3100);
 				acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
 			}
 		} while (!wilc->quit);
@@ -800,7 +800,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 					break;
 				} else {
 					release_bus(wilc, RELEASE_ALLOW_SLEEP);
-					usleep_range(3000, 3000);
+					usleep_range(3000, 3100);
 					acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
 					PRINT_WRN(GENERIC_DBG, "Can't get VMM entery - reg = %2x\n", reg);
 				}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · Rakhi Sharma

As usleep_range should not use min == max args.This patch fixes checkpatch
warning: usleep_range should not use min == max args; see Documentation/timers/timers-howto.txt.

How did you choose the new values?

julia

Quoted 38 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +2 -2
index 83af51b..8d6a457 100644
@@ -766,7 +766,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				}
 				PRINT_WRN(GENERIC_DBG, "[wilc txq]: warn, vmm table not clear yet, wait...\n");
 				release_bus(wilc, RELEASE_ALLOW_SLEEP);
-				usleep_range(3000, 3000);
+				usleep_range(3000, 3100);
 				acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
 			}
 		} while (!wilc->quit);
@@ -800,7 +800,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 					break;
 				} else {
 					release_bus(wilc, RELEASE_ALLOW_SLEEP);
-					usleep_range(3000, 3000);
+					usleep_range(3000, 3100);
 					acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
 					PRINT_WRN(GENERIC_DBG, "Can't get VMM entery - reg = %2x\n", reg);
 				}
Signature · 8 lines
1.9.1

-- 
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/1456579543-27301-1-git-send-email-rakhish1994%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
#2 lore raw
Quoted 4 lines · Julia Lawall

On Sat, 27 Feb 2016, Rakhi Sharma wrote:

Quoted 8 lines
Quoted 1 line

As usleep_range should not use min == max args.This patch fixes

checkpatch

Quoted 2 lines

warning: usleep_range should not use min == max args; see Documentation/timers/timers-howto.txt.

How did you choose the new values?

Hi,

As usleep_range is generally used when sleeping range is between 10us - 20ms.For
avoiding this checkpatch warning min==max args! if we change the max value little(between 1-100) I don't think it will affect the code.I gone through the
simillar patches submitted by other developer, they did same, so I choose to increase
max by100. Otherwise there is no reason for new values.

Rakhi

julia

Quoted 51 lines

Review

Quoted 8 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/wilc1000/wilc_wlan.c

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32

Quoted 4 lines

index 83af51b..8d6a457 100644

drivers/staging/wilc1000/wilc_wlan.c +0 -0
@@ -766,7 +766,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32

*txq_count)

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 · line 767

Quoted 2 lines
drivers/staging/wilc1000/wilc_wlan.c +0 -0
                              }
                              PRINT_WRN(GENERIC_DBG, "[wilc txq]: warn,

vmm table not clear yet, wait...\n");

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32

Quoted 7 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -1
                              release_bus(wilc, RELEASE_ALLOW_SLEEP);
-                             usleep_range(3000, 3000);
+                             usleep_range(3000, 3100);
                              acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
                      }
              } while (!wilc->quit);
@@ -800,7 +800,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32

*txq_count)

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)

Quoted 3 lines
drivers/staging/wilc1000/wilc_wlan.c +0 -0
                                      break;
                              } else {
                                      release_bus(wilc,

RELEASE_ALLOW_SLEEP);

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)

Quoted 3 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -1
-                                     usleep_range(3000, 3000);
+                                     usleep_range(3000, 3100);
                                      acquire_bus(wilc,

ACQUIRE_AND_WAKEUP);

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 · line 805

Quoted 1 line
drivers/staging/wilc1000/wilc_wlan.c +0 -0
                                      PRINT_WRN(GENERIC_DBG, "Can't get

VMM entery - reg = %2x\n", reg);

Quoted 6 lines
drivers/staging/wilc1000/wilc_wlan.c +0 -1
                              }
--

1.9.1

--
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].

Quoted 2 lines

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/1456579543-27301-1-git-send-email-rakhish1994%40gmail.com
.

Quoted 2 lines

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

#3 lore raw
Quoted 12 lines · RAKHI SHARMA

On Sat, Feb 27, 2016 at 7:09 PM, Julia Lawall <[email protected]> wrote:

On Sat, 27 Feb 2016, Rakhi Sharma wrote:

> As usleep_range should not use min == max args.This patch fixes checkpatch
> warning: usleep_range should not use min == max args; see > Documentation/timers/timers-howto.txt.

How did you choose the new values?

Quoted 9 lines

Hi,
As usleep_range is generally used when sleeping range is between 10us - 20ms.For
avoiding this checkpatch warning min==max args! if we change the max value little(between 1-100) I don't think it will affect the code.I gone through the
simillar patches submitted by other developer, they did same, so I choose to increase
max by100. Otherwise there is no reason for new values.

OK, it would be good to update the patch with such an explanation, ie to say that you chose to increment the minimum value by 100, as done in commits X, Y, and Z.

julia

Quoted 62 lines

Rakhi

      julia

      >
      > Signed-off-by: Rakhi Sharma <[email protected]>
      > ---
      >  drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
      >  1 file changed, 2 insertions(+), 2 deletions(-)
      >
      > diff --git a/drivers/staging/wilc1000/wilc_wlan.c
      b/drivers/staging/wilc1000/wilc_wlan.c
      > index 83af51b..8d6a457 100644
      > --- a/drivers/staging/wilc1000/wilc_wlan.c
      > +++ b/drivers/staging/wilc1000/wilc_wlan.c
      > @@ -766,7 +766,7 @@ int wilc_wlan_handle_txq(struct net_device
      *dev, u32 *txq_count)
      >                               }
      >                               PRINT_WRN(GENERIC_DBG, "[wilc
      txq]: warn, vmm table not clear yet, wait...\n");
      >                               release_bus(wilc,
      RELEASE_ALLOW_SLEEP);
      > -                             usleep_range(3000, 3000);
      > +                             usleep_range(3000, 3100);
      >                               acquire_bus(wilc,
      ACQUIRE_AND_WAKEUP);
      >                       }
      >               } while (!wilc->quit);
      > @@ -800,7 +800,7 @@ int wilc_wlan_handle_txq(struct net_device
      *dev, u32 *txq_count)
      >                                       break;
      >                               } else {
      >                                       release_bus(wilc,
      RELEASE_ALLOW_SLEEP);
      > -                                     usleep_range(3000,
      3000);
      > +                                     usleep_range(3000,
      3100);
      >                                       acquire_bus(wilc,
      ACQUIRE_AND_WAKEUP);
      >                                       PRINT_WRN(GENERIC_DBG,
      "Can't get VMM entery - reg = %2x\n", reg);
      >                               }
      > --
      > 1.9.1
      >
Quoted 2 lines

--
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].

Quoted 1 line

To post to this group, send email to

[email protected].

Quoted 1 line

To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1456579543-27301-1-git-s

end-email-rakhish1994%40gmail.com.

Quoted 2 lines

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

#4 lore raw
Quoted 101 lines · Julia Lawall
Quoted 1 line · RAKHI SHARMA

On Sat, Feb 27, 2016 at 7:09 PM, Julia Lawall <[email protected]>

Quoted 11 lines · wrote:

On Sat, 27 Feb 2016, Rakhi Sharma wrote:

> As usleep_range should not use min == max args.This patch fixes checkpatch
> warning: usleep_range should not use min == max args; see > Documentation/timers/timers-howto.txt.

How did you choose the new values?

Quoted 7 lines

Hi,
As usleep_range is generally used when sleeping range is between 10us - 20ms.For
avoiding this checkpatch warning min==max args! if we change the max value little(between 1-100) I don't think it will affect the code.I gone through the
simillar patches submitted by other developer, they did same, so I

choose to

Quoted 2 lines

increase
max by100. Otherwise there is no reason for new values.

OK, it would be good to update the patch with such an explanation, ie to say that you chose to increment the minimum value by 100, as done in commits X, Y, and Z.

sure, sending v2 with updation :)

julia

Quoted 47 lines

Rakhi

      julia

      >
      > Signed-off-by: Rakhi Sharma <[email protected]>
      > ---
      >  drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
      >  1 file changed, 2 insertions(+), 2 deletions(-)
      >
      > diff --git a/drivers/staging/wilc1000/wilc_wlan.c
      b/drivers/staging/wilc1000/wilc_wlan.c
      > index 83af51b..8d6a457 100644
      > --- a/drivers/staging/wilc1000/wilc_wlan.c
      > +++ b/drivers/staging/wilc1000/wilc_wlan.c
      > @@ -766,7 +766,7 @@ int wilc_wlan_handle_txq(struct net_device
      *dev, u32 *txq_count)
      >                               }
      >                               PRINT_WRN(GENERIC_DBG, "[wilc
      txq]: warn, vmm table not clear yet, wait...\n");
      >                               release_bus(wilc,
      RELEASE_ALLOW_SLEEP);
      > -                             usleep_range(3000, 3000);
      > +                             usleep_range(3000, 3100);
      >                               acquire_bus(wilc,
      ACQUIRE_AND_WAKEUP);
      >                       }
      >               } while (!wilc->quit);
      > @@ -800,7 +800,7 @@ int wilc_wlan_handle_txq(struct net_device
      *dev, u32 *txq_count)
      >                                       break;
      >                               } else {
      >                                       release_bus(wilc,
      RELEASE_ALLOW_SLEEP);
      > -                                     usleep_range(3000,
      3000);
      > +                                     usleep_range(3000,
      3100);
      >                                       acquire_bus(wilc,
      ACQUIRE_AND_WAKEUP);
      >                                       PRINT_WRN(GENERIC_DBG,
      "Can't get VMM entery - reg = %2x\n", reg);
      >                               }
      > --
      > 1.9.1
      >
Quoted 8 lines
Quoted 2 lines

--
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].

Quoted 1 line

To post to this group, send email to

[email protected].

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/1456579543-27301-1-git-s

Quoted 7 lines

end-email-rakhish1994%40gmail.com.

Quoted 2 lines

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