All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static
@ 2017-11-02 15:53 ` Colin King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2017-11-02 15:53 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Kazuya Mizuguchi, linux-usb
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array max_packet_array on the stack, instead make
it static. Makes the object code smaller by over 90 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  34337	   5612	    128	  40077	   9c8d	renesas_usb3.o

After:
   text	   data	    bss	    dec	    hex	filename
  34149	   5708	    128	  39985	   9c31	renesas_usb3.o

(gcc version 7.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index ed84f5158a38..cb461b8f4509 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2058,7 +2058,7 @@ static u32 usb3_calc_rammap_val(struct renesas_usb3_ep *usb3_ep,
 				const struct usb_endpoint_descriptor *desc)
 {
 	int i;
-	const u32 max_packet_array[] = {8, 16, 32, 64, 512};
+	static const u32 max_packet_array[] = {8, 16, 32, 64, 512};
 	u32 mpkt = PN_RAMMAP_MPKT(1024);
 
 	for (i = 0; i < ARRAY_SIZE(max_packet_array); i++) {
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static
@ 2017-11-02 15:53 ` Colin King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2017-11-02 15:53 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Kazuya Mizuguchi, linux-usb
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array max_packet_array on the stack, instead make
it static. Makes the object code smaller by over 90 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  34337	   5612	    128	  40077	   9c8d	renesas_usb3.o

After:
   text	   data	    bss	    dec	    hex	filename
  34149	   5708	    128	  39985	   9c31	renesas_usb3.o

(gcc version 7.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index ed84f5158a38..cb461b8f4509 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2058,7 +2058,7 @@ static u32 usb3_calc_rammap_val(struct renesas_usb3_ep *usb3_ep,
 				const struct usb_endpoint_descriptor *desc)
 {
 	int i;
-	const u32 max_packet_array[] = {8, 16, 32, 64, 512};
+	static const u32 max_packet_array[] = {8, 16, 32, 64, 512};
 	u32 mpkt = PN_RAMMAP_MPKT(1024);
 
 	for (i = 0; i < ARRAY_SIZE(max_packet_array); i++) {
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static
  2017-11-02 15:53 ` Colin King
@ 2017-11-06  9:34   ` Yoshihiro Shimoda
  -1 siblings, 0 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2017-11-06  9:34 UTC (permalink / raw)
  To: Colin King, Felipe Balbi, Greg Kroah-Hartman, Geert Uytterhoeven,
	KAZUYA MIZUGUCHI, linux-usb
  Cc: kernel-janitors, linux-kernel

Hi Colin,

> From: Colin King, Sent: Friday, November 3, 2017 12:53 AM
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the const array max_packet_array on the stack, instead make
> it static. Makes the object code smaller by over 90 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   34337	   5612	    128	  40077	   9c8d	renesas_usb3.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   34149	   5708	    128	  39985	   9c31	renesas_usb3.o
> 
> (gcc version 7.2.0 x86_64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thank you for the patch!

Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static
@ 2017-11-06  9:34   ` Yoshihiro Shimoda
  0 siblings, 0 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2017-11-06  9:34 UTC (permalink / raw)
  To: Colin King, Felipe Balbi, Greg Kroah-Hartman, Geert Uytterhoeven,
	KAZUYA MIZUGUCHI, linux-usb
  Cc: kernel-janitors, linux-kernel

SGkgQ29saW4sDQoNCj4gRnJvbTogQ29saW4gS2luZywgU2VudDogRnJpZGF5LCBOb3ZlbWJlciAz
LCAyMDE3IDEyOjUzIEFNDQo+IA0KPiBGcm9tOiBDb2xpbiBJYW4gS2luZyA8Y29saW4ua2luZ0Bj
YW5vbmljYWwuY29tPg0KPiANCj4gRG9uJ3QgcG9wdWxhdGUgdGhlIGNvbnN0IGFycmF5IG1heF9w
YWNrZXRfYXJyYXkgb24gdGhlIHN0YWNrLCBpbnN0ZWFkIG1ha2UNCj4gaXQgc3RhdGljLiBNYWtl
cyB0aGUgb2JqZWN0IGNvZGUgc21hbGxlciBieSBvdmVyIDkwIGJ5dGVzOg0KPiANCj4gQmVmb3Jl
Og0KPiAgICB0ZXh0CSAgIGRhdGEJICAgIGJzcwkgICAgZGVjCSAgICBoZXgJZmlsZW5hbWUNCj4g
ICAzNDMzNwkgICA1NjEyCSAgICAxMjgJICA0MDA3NwkgICA5YzhkCXJlbmVzYXNfdXNiMy5vDQo+
IA0KPiBBZnRlcjoNCj4gICAgdGV4dAkgICBkYXRhCSAgICBic3MJICAgIGRlYwkgICAgaGV4CWZp
bGVuYW1lDQo+ICAgMzQxNDkJICAgNTcwOAkgICAgMTI4CSAgMzk5ODUJICAgOWMzMQlyZW5lc2Fz
X3VzYjMubw0KPiANCj4gKGdjYyB2ZXJzaW9uIDcuMi4wIHg4Nl82NCkNCj4gDQo+IFNpZ25lZC1v
ZmYtYnk6IENvbGluIElhbiBLaW5nIDxjb2xpbi5raW5nQGNhbm9uaWNhbC5jb20+DQoNClRoYW5r
IHlvdSBmb3IgdGhlIHBhdGNoIQ0KDQpBY2tlZC1ieTogWW9zaGloaXJvIFNoaW1vZGEgPHlvc2hp
aGlyby5zaGltb2RhLnVoQHJlbmVzYXMuY29tPg0KDQpCZXN0IHJlZ2FyZHMsDQpZb3NoaWhpcm8g
U2hpbW9kYQ0KDQo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret
  2017-11-02 15:53 ` Colin King
@ 2019-06-26 16:35 ` Colin King
  -1 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2019-06-26 16:35 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Yoshihiro Shimoda, linux-usb
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable ret is being initialized with a value that is never read and
ret is being re-assigned immediately after the initialization in both
paths of an if statement. This is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 5a960fce31c5..87062d22134d 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1168,7 +1168,7 @@ static void usb3_set_status_stage(struct renesas_usb3_ep *usb3_ep,
 static void usb3_p0_xfer(struct renesas_usb3_ep *usb3_ep,
 			 struct renesas_usb3_request *usb3_req)
 {
-	int ret = -EAGAIN;
+	int ret;
 
 	if (usb3_ep->dir_in)
 		ret = usb3_write_pipe(usb3_ep, usb3_req, USB3_P0_WRITE);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret
@ 2019-06-26 16:35 ` Colin King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2019-06-26 16:35 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Yoshihiro Shimoda, linux-usb
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable ret is being initialized with a value that is never read and
ret is being re-assigned immediately after the initialization in both
paths of an if statement. This is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 5a960fce31c5..87062d22134d 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1168,7 +1168,7 @@ static void usb3_set_status_stage(struct renesas_usb3_ep *usb3_ep,
 static void usb3_p0_xfer(struct renesas_usb3_ep *usb3_ep,
 			 struct renesas_usb3_request *usb3_req)
 {
-	int ret = -EAGAIN;
+	int ret;
 
 	if (usb3_ep->dir_in)
 		ret = usb3_write_pipe(usb3_ep, usb3_req, USB3_P0_WRITE);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret
  2019-06-26 16:35 ` Colin King
@ 2019-06-27  1:15   ` Yoshihiro Shimoda
  -1 siblings, 0 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2019-06-27  1:15 UTC (permalink / raw)
  To: Colin King, Felipe Balbi, Greg Kroah-Hartman, linux-usb
  Cc: kernel-janitors, linux-kernel

Hi Colin,

> From: Colin King, Sent: Thursday, June 27, 2019 1:35 AM
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable ret is being initialized with a value that is never read and
> ret is being re-assigned immediately after the initialization in both
> paths of an if statement. This is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret
@ 2019-06-27  1:15   ` Yoshihiro Shimoda
  0 siblings, 0 replies; 8+ messages in thread
From: Yoshihiro Shimoda @ 2019-06-27  1:15 UTC (permalink / raw)
  To: Colin King, Felipe Balbi, Greg Kroah-Hartman, linux-usb
  Cc: kernel-janitors, linux-kernel

SGkgQ29saW4sDQoNCj4gRnJvbTogQ29saW4gS2luZywgU2VudDogVGh1cnNkYXksIEp1bmUgMjcs
IDIwMTkgMTozNSBBTQ0KPiANCj4gRnJvbTogQ29saW4gSWFuIEtpbmcgPGNvbGluLmtpbmdAY2Fu
b25pY2FsLmNvbT4NCj4gDQo+IFZhcmlhYmxlIHJldCBpcyBiZWluZyBpbml0aWFsaXplZCB3aXRo
IGEgdmFsdWUgdGhhdCBpcyBuZXZlciByZWFkIGFuZA0KPiByZXQgaXMgYmVpbmcgcmUtYXNzaWdu
ZWQgaW1tZWRpYXRlbHkgYWZ0ZXIgdGhlIGluaXRpYWxpemF0aW9uIGluIGJvdGgNCj4gcGF0aHMg
b2YgYW4gaWYgc3RhdGVtZW50LiBUaGlzIGlzIHJlZHVuZGFudCBhbmQgY2FuIGJlIHJlbW92ZWQu
DQo+IA0KPiBBZGRyZXNzZXMtQ292ZXJpdHk6ICgiVW51c2VkIHZhbHVlIikNCj4gU2lnbmVkLW9m
Zi1ieTogQ29saW4gSWFuIEtpbmcgPGNvbGluLmtpbmdAY2Fub25pY2FsLmNvbT4NCg0KVGhhbmsg
eW91IGZvciB0aGUgcGF0Y2ghDQoNClJldmlld2VkLWJ5OiBZb3NoaWhpcm8gU2hpbW9kYSA8eW9z
aGloaXJvLnNoaW1vZGEudWhAcmVuZXNhcy5jb20+DQoNCkJlc3QgcmVnYXJkcywNCllvc2hpaGly
byBTaGltb2RhDQoNCg=

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-27  1:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 16:35 [PATCH] usb: gadget: udc: renesas_usb3: remove redundant assignment to ret Colin King
2019-06-26 16:35 ` Colin King
2019-06-27  1:15 ` Yoshihiro Shimoda
2019-06-27  1:15   ` Yoshihiro Shimoda
  -- strict thread matches above, loose matches on Subject: below --
2017-11-02 15:53 [PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static Colin King
2017-11-02 15:53 ` Colin King
2017-11-06  9:34 ` Yoshihiro Shimoda
2017-11-06  9:34   ` Yoshihiro Shimoda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.