Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1699099 > unrolled thread

[PATCH 00/11] constify hc_driver structures

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2017-07-28 23:10 +0200
Last post2017-07-28 23:20 +0200
Articles 14 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/11] constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 11/11] c67x00-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 01/11] isp1362-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 09/11] USB: whci-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
      RE: [PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2017-07-31 09:10 +0200
    [PATCH 03/11] usb: r8a66597-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 07/11] isp116x-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 10/11] greybus: usb: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
      Re: [greybus-dev] [PATCH 10/11] greybus: usb: constify hc_driver  structures Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-31 06:30 +0200
      Re: [PATCH 10/11] greybus: usb: constify hc_driver structures Johan Hovold <johan@kernel.org> - 2017-07-31 09:20 +0200
    [PATCH 04/11] usb: host/sl811-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 05/11] usb: host: u132-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:10 +0200
    [PATCH 02/11] usb: host: max3421-hcd: constify hc_driver structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-28 23:20 +0200

#1699099 — [PATCH 00/11] constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 00/11] constify hc_driver structures
Message-ID<u8kGd-C9-5@gated-at.bofh.it>
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@

static struct hc_driver i@p = { ... };

@ok1@
identifier r.i;
expression e1;
position p;
@@

usb_create_hcd(&i@p,...)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct hc_driver e;
@@

e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@

static
+const
 struct hc_driver i = { ... };
// </smpl>

---

 drivers/staging/greybus/usb.c        |    2 +-
 drivers/usb/c67x00/c67x00-hcd.c      |    2 +-
 drivers/usb/host/hwa-hc.c            |    2 +-
 drivers/usb/host/isp116x-hcd.c       |    2 +-
 drivers/usb/host/isp1362-hcd.c       |    2 +-
 drivers/usb/host/max3421-hcd.c       |    2 +-
 drivers/usb/host/r8a66597-hcd.c      |    2 +-
 drivers/usb/host/sl811-hcd.c         |    2 +-
 drivers/usb/host/u132-hcd.c          |    2 +-
 drivers/usb/host/whci/hcd.c          |    2 +-
 drivers/usb/renesas_usbhs/mod_host.c |    2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

[toc] | [next] | [standalone]


#1699101 — [PATCH 11/11] c67x00-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 11/11] c67x00-hcd: constify hc_driver structures
Message-ID<u8kGe-C9-15@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/c67x00/c67x00-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/c67x00/c67x00-hcd.c b/drivers/usb/c67x00/c67x00-hcd.c
index c2d1396..30d3f34 100644
--- a/drivers/usb/c67x00/c67x00-hcd.c
+++ b/drivers/usb/c67x00/c67x00-hcd.c
@@ -305,7 +305,7 @@ static int c67x00_hcd_get_frame(struct usb_hcd *hcd)
 	return temp_val ? (temp_val - 1) : HOST_FRAME_MASK;
 }
 
-static struct hc_driver c67x00_hc_driver = {
+static const struct hc_driver c67x00_hc_driver = {
 	.description	= "c67x00-hcd",
 	.product_desc	= "Cypress C67X00 Host Controller",
 	.hcd_priv_size	= sizeof(struct c67x00_hcd),

[toc] | [prev] | [next] | [standalone]


#1699102 — [PATCH 01/11] isp1362-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 01/11] isp1362-hcd: constify hc_driver structures
Message-ID<u8kGe-C9-13@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/isp1362-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 0f2b4b3..9b7e307 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2591,7 +2591,7 @@ static int isp1362_hc_start(struct usb_hcd *hcd)
 
 /*-------------------------------------------------------------------------*/
 
-static struct hc_driver isp1362_hc_driver = {
+static const struct hc_driver isp1362_hc_driver = {
 	.description =		hcd_name,
 	.product_desc =		"ISP1362 Host Controller",
 	.hcd_priv_size =	sizeof(struct isp1362_hcd),

[toc] | [prev] | [next] | [standalone]


#1699104 — [PATCH 09/11] USB: whci-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 09/11] USB: whci-hcd: constify hc_driver structures
Message-ID<u8kGe-C9-17@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/whci/hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/whci/hcd.c b/drivers/usb/host/whci/hcd.c
index 5b3603c..cf84269 100644
--- a/drivers/usb/host/whci/hcd.c
+++ b/drivers/usb/host/whci/hcd.c
@@ -213,7 +213,7 @@ static void whc_endpoint_reset(struct usb_hcd *usb_hcd,
 }
 
 
-static struct hc_driver whc_hc_driver = {
+static const struct hc_driver whc_hc_driver = {
 	.description = "whci-hcd",
 	.product_desc = "Wireless host controller",
 	.hcd_priv_size = sizeof(struct whc) - sizeof(struct usb_hcd),

[toc] | [prev] | [next] | [standalone]


#1699106 — [PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures
Message-ID<u8kGe-C9-21@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/renesas_usbhs/mod_host.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
index dfb346e..e256351 100644
--- a/drivers/usb/renesas_usbhs/mod_host.c
+++ b/drivers/usb/renesas_usbhs/mod_host.c
@@ -1285,7 +1285,7 @@ static int usbhsh_bus_nop(struct usb_hcd *hcd)
 	return 0;
 }
 
-static struct hc_driver usbhsh_driver = {
+static const struct hc_driver usbhsh_driver = {
 	.description =		usbhsh_hcd_name,
 	.hcd_priv_size =	sizeof(struct usbhsh_hpriv),
 

[toc] | [prev] | [next] | [standalone]


#1699752 — RE: [PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures

FromYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date2017-07-31 09:10 +0200
SubjectRE: [PATCH 06/11] usb: renesas_usbhs: constify hc_driver structures
Message-ID<u9cZZ-3eT-19@gated-at.bofh.it>
In reply to#1699106
Hi,

> From: Julia Lawall
> Sent: Saturday, July 29, 2017 5:42 AM
> 
> The hc_driver structure is only passed as the first argument to
> usb_create_hcd, which is declared as const.  Thus the hc_driver structure
> itself can be const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thank you for the patch!

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

Best regards,
Yoshihiro Shimoda

[toc] | [prev] | [next] | [standalone]


#1699107 — [PATCH 03/11] usb: r8a66597-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 03/11] usb: r8a66597-hcd: constify hc_driver structures
Message-ID<u8kGe-C9-25@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/r8a66597-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 7bf78be..5e5fc9d 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -2312,7 +2312,7 @@ static int r8a66597_bus_resume(struct usb_hcd *hcd)
 #define	r8a66597_bus_resume	NULL
 #endif
 
-static struct hc_driver r8a66597_hc_driver = {
+static const struct hc_driver r8a66597_hc_driver = {
 	.description =		hcd_name,
 	.hcd_priv_size =	sizeof(struct r8a66597),
 	.irq =			r8a66597_irq,

[toc] | [prev] | [next] | [standalone]


#1699108 — [PATCH 07/11] isp116x-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 07/11] isp116x-hcd: constify hc_driver structures
Message-ID<u8kGe-C9-29@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/isp116x-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index d089b3f..73fec38 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1511,7 +1511,7 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
 
 #endif
 
-static struct hc_driver isp116x_hc_driver = {
+static const struct hc_driver isp116x_hc_driver = {
 	.description = hcd_name,
 	.product_desc = "ISP116x Host Controller",
 	.hcd_priv_size = sizeof(struct isp116x),

[toc] | [prev] | [next] | [standalone]


#1699109 — [PATCH 10/11] greybus: usb: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 10/11] greybus: usb: constify hc_driver structures
Message-ID<u8kGf-C9-33@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/greybus/usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c
index ccadda0..f93a76d 100644
--- a/drivers/staging/greybus/usb.c
+++ b/drivers/staging/greybus/usb.c
@@ -139,7 +139,7 @@ static int hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
 	return ret;
 }
 
-static struct hc_driver usb_gb_hc_driver = {
+static const struct hc_driver usb_gb_hc_driver = {
 	.description = "greybus-hcd",
 	.product_desc = "Greybus USB Host Controller",
 	.hcd_priv_size = sizeof(struct gb_usb_device),

[toc] | [prev] | [next] | [standalone]


#1699680 — Re: [greybus-dev] [PATCH 10/11] greybus: usb: constify hc_driver structures

FromViresh Kumar <viresh.kumar@linaro.org>
Date2017-07-31 06:30 +0200
SubjectRe: [greybus-dev] [PATCH 10/11] greybus: usb: constify hc_driver structures
Message-ID<u9av8-1yG-3@gated-at.bofh.it>
In reply to#1699109
On 28-07-17, 22:41, Julia Lawall wrote:
> The hc_driver structure is only passed as the first argument to
> usb_create_hcd, which is declared as const.  Thus the hc_driver structure
> itself can be const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/staging/greybus/usb.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c
> index ccadda0..f93a76d 100644
> --- a/drivers/staging/greybus/usb.c
> +++ b/drivers/staging/greybus/usb.c
> @@ -139,7 +139,7 @@ static int hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
>  	return ret;
>  }
>  
> -static struct hc_driver usb_gb_hc_driver = {
> +static const struct hc_driver usb_gb_hc_driver = {
>  	.description = "greybus-hcd",
>  	.product_desc = "Greybus USB Host Controller",
>  	.hcd_priv_size = sizeof(struct gb_usb_device),

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1699754 — Re: [PATCH 10/11] greybus: usb: constify hc_driver structures

FromJohan Hovold <johan@kernel.org>
Date2017-07-31 09:20 +0200
SubjectRe: [PATCH 10/11] greybus: usb: constify hc_driver structures
Message-ID<u9d9D-3ia-5@gated-at.bofh.it>
In reply to#1699109
On Fri, Jul 28, 2017 at 10:41:57PM +0200, Julia Lawall wrote:
> The hc_driver structure is only passed as the first argument to
> usb_create_hcd, which is declared as const.  Thus the hc_driver structure
> itself can be const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Johan Hovold <johan@kernel.org>

Thanks,
Johan

[toc] | [prev] | [next] | [standalone]


#1699114 — [PATCH 04/11] usb: host/sl811-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 04/11] usb: host/sl811-hcd: constify hc_driver structures
Message-ID<u8kGf-C9-43@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/sl811-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index fd2a114..24ad1d6 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1554,7 +1554,7 @@ static void remove_debug_file(struct sl811 *sl811)
 
 /*-------------------------------------------------------------------------*/
 
-static struct hc_driver sl811h_hc_driver = {
+static const struct hc_driver sl811h_hc_driver = {
 	.description =		hcd_name,
 	.hcd_priv_size =	sizeof(struct sl811),
 

[toc] | [prev] | [next] | [standalone]


#1699115 — [PATCH 05/11] usb: host: u132-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:10 +0200
Subject[PATCH 05/11] usb: host: u132-hcd: constify hc_driver structures
Message-ID<u8kGf-C9-47@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/u132-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 43d5293..c38855a 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -2941,7 +2941,7 @@ static int u132_bus_resume(struct usb_hcd *hcd)
 #define u132_bus_suspend NULL
 #define u132_bus_resume NULL
 #endif
-static struct hc_driver u132_hc_driver = {
+static const struct hc_driver u132_hc_driver = {
 	.description = hcd_name,
 	.hcd_priv_size = sizeof(struct u132),
 	.irq = NULL,

[toc] | [prev] | [next] | [standalone]


#1699117 — [PATCH 02/11] usb: host: max3421-hcd: constify hc_driver structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-28 23:20 +0200
Subject[PATCH 02/11] usb: host: max3421-hcd: constify hc_driver structures
Message-ID<u8kPU-GR-7@gated-at.bofh.it>
In reply to#1699099
The hc_driver structure is only passed as the first argument to
usb_create_hcd, which is declared as const.  Thus the hc_driver structure
itself can be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/max3421-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 369869a..0ece9a9 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1811,7 +1811,7 @@ enum {
 {
 }
 
-static struct hc_driver max3421_hcd_desc = {
+static const struct hc_driver max3421_hcd_desc = {
 	.description =		"max3421",
 	.product_desc =		DRIVER_DESC,
 	.hcd_priv_size =	sizeof(struct max3421_hcd),

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web