Skip to contentSkip to conversation

Staging: wfx: CHECK: usleep_range is preferred over udelay

PATCH In review Leonardo Araujo 3 participants 3 messages Feb 7, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: wfx: CHECK: usleep_range is preferred over udelay

Fixes the checks reported by checkpatch.pl for usleep_range.

---
 drivers/staging/wfx/bh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/bh.c +1 -1
index a0f9d1b53019..ebc7eaf93ef0 100644
@@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
 			dev_err(wdev->dev, "time out while polling control register\n");
 			return;
 		}
-		udelay(200);
+		usleep_range(200, 200);
 	}
 	wfx_bh_request_rx(wdev);
 }
Signature · 1 line
2.29.0
maintainer
#1 lore raw
Quoted 12 lines · Leonardo Araujo

Fixes the checks reported by checkpatch.pl for usleep_range.

---
 drivers/staging/wfx/bh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/bh.c +0 -0
index a0f9d1b53019..ebc7eaf93ef0 100644

drivers/staging/wfx/bh.c void wfx_bh_poll_irq(struct wfx_dev *wdev) · line 315

Quoted 5 lines
drivers/staging/wfx/bh.c +1 -1
@@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
 			dev_err(wdev->dev, "time out while polling control register\n");
 			return;
 		}
-		udelay(200);
+		usleep_range(200, 200);

Do you have the hardware to verify that this is the correct fix for this?

You can not just blindly make this type of change here, sorry, otherwise we would have done so long ago with a simple search/replace :)

thanks,

greg k-h

#2 lore raw
Quoted 2 lines · Greg KH
Quoted 1 line · Leonardo Araujo

Fixes the checks reported by checkpatch.pl for usleep_range.

[]

Quoted 1 line

drivers/staging/wfx/bh.c

Quoted 1 line
drivers/staging/wfx/bh.c +0 -0

[]

Quoted 6 lines

drivers/staging/wfx/bh.c void wfx_bh_poll_irq(struct wfx_dev *wdev) · line 315

Quoted 6 lines
drivers/staging/wfx/bh.c +1 -1
@@ -312,7 +312,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
 			dev_err(wdev->dev, "time out while polling control register\n");
 			return;
 		}
-		udelay(200);
+		usleep_range(200, 200);

range with the same low/high values is pretty useless.

And Leonardo, checkpatch should have warned you about this. You, as a novice kernel submitter, should always use it on patches you create before you send them out for review.

Quoted 5 lines

Do you have the hardware to verify that this is the correct fix for this?

You can not just blindly make this type of change here, sorry, otherwise we would have done so long ago with a simple search/replace :)

Greg, you keep writing this but treewide search/replace is almost never done.