diff mbox series

[-next] usb: host: oxu210hp-hcd: remove set but not used variables 'uframes, transfer_buffer_length'

Message ID 20190215031709.86920-1-yuehaibing@huawei.com (mailing list archive)
State Mainlined
Commit 8e9fd85c59fb22f4dfa55d2d155401aa935d6ab4
Headers show
Series [-next] usb: host: oxu210hp-hcd: remove set but not used variables 'uframes, transfer_buffer_length' | expand

Commit Message

Yue Haibing Feb. 15, 2019, 3:17 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/usb/host/oxu210hp-hcd.c: In function 'scan_periodic':
drivers/usb/host/oxu210hp-hcd.c:2256:13: warning:
 variable 'uframes' set but not used [-Wunused-but-set-variable]

drivers/usb/host/oxu210hp-hcd.c: In function 'oxu_urb_enqueue':
drivers/usb/host/oxu210hp-hcd.c:2835:6: warning:
 variable 'transfer_buffer_length' set but not used [-Wunused-but-set-variable]

It never used since introduction.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/usb/host/oxu210hp-hcd.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Sergei Shtylyov Feb. 15, 2019, 8:11 a.m. UTC | #1
Hello!

On 15.02.2019 6:17, YueHaibing wrote:

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/usb/host/oxu210hp-hcd.c: In function 'scan_periodic':
> drivers/usb/host/oxu210hp-hcd.c:2256:13: warning:
>   variable 'uframes' set but not used [-Wunused-but-set-variable]
> 
> drivers/usb/host/oxu210hp-hcd.c: In function 'oxu_urb_enqueue':
> drivers/usb/host/oxu210hp-hcd.c:2835:6: warning:
>   variable 'transfer_buffer_length' set but not used [-Wunused-but-set-variable]
> 
> It never used since introduction.

    "It's" or even better, "they are"?

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
[...]

MBR, Sergei
Yue Haibing Feb. 15, 2019, 12:18 p.m. UTC | #2
On 2019/2/15 16:11, Sergei Shtylyov wrote:
> Hello!
> 
> On 15.02.2019 6:17, YueHaibing wrote:
> 
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/usb/host/oxu210hp-hcd.c: In function 'scan_periodic':
>> drivers/usb/host/oxu210hp-hcd.c:2256:13: warning:
>>   variable 'uframes' set but not used [-Wunused-but-set-variable]
>>
>> drivers/usb/host/oxu210hp-hcd.c: In function 'oxu_urb_enqueue':
>> drivers/usb/host/oxu210hp-hcd.c:2835:6: warning:
>>   variable 'transfer_buffer_length' set but not used [-Wunused-but-set-variable]
>>
>> It never used since introduction.
> 
>    "It's" or even better, "they are"?

Ok, will fix it, Thanks!

> 
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> [...]
> 
> MBR, Sergei
> 
>
diff mbox series

Patch

diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index f06a291f05f8..47c5515a9ce4 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -2253,16 +2253,12 @@  static void scan_periodic(struct oxu_hcd *oxu)
 	for (;;) {
 		union ehci_shadow	q, *q_p;
 		__le32			type, *hw_p;
-		unsigned		uframes;
 
 		/* don't scan past the live uframe */
 		frame = now_uframe >> 3;
-		if (frame == (clock >> 3))
-			uframes = now_uframe & 0x07;
-		else {
+		if (frame != (clock >> 3)) {
 			/* safe to scan the whole frame at once */
 			now_uframe |= 0x07;
-			uframes = 8;
 		}
 
 restart:
@@ -2832,7 +2828,6 @@  static int oxu_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
 {
 	struct oxu_hcd *oxu = hcd_to_oxu(hcd);
 	int num, rem;
-	int transfer_buffer_length;
 	void *transfer_buffer;
 	struct urb *murb;
 	int i, ret;
@@ -2843,7 +2838,6 @@  static int oxu_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
 
 	/* Otherwise we should verify the USB transfer buffer size! */
 	transfer_buffer = urb->transfer_buffer;
-	transfer_buffer_length = urb->transfer_buffer_length;
 
 	num = urb->transfer_buffer_length / 4096;
 	rem = urb->transfer_buffer_length % 4096;