public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] constify hc_driver structures
@ 2017-07-28 20:41 Julia Lawall
  2017-07-28 20:41 ` [PATCH 01/11] isp1362-hcd: " Julia Lawall
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Julia Lawall @ 2017-07-28 20:41 UTC (permalink / raw)
  To: devel
  Cc: kernel-janitors, greybus-dev, linux-kernel, Greg Kroah-Hartman,
	linux-usb

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(-)

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

end of thread, other threads:[~2017-07-31  7:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28 20:41 [PATCH 00/11] constify hc_driver structures Julia Lawall
2017-07-28 20:41 ` [PATCH 01/11] isp1362-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 02/11] usb: host: max3421-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 03/11] usb: r8a66597-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 04/11] usb: host/sl811-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 05/11] usb: host: u132-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 06/11] usb: renesas_usbhs: " Julia Lawall
2017-07-31  7:07   ` Yoshihiro Shimoda
2017-07-28 20:41 ` [PATCH 07/11] isp116x-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 08/11] USB: HWA: " Julia Lawall
2017-07-28 20:41 ` [PATCH 09/11] USB: whci-hcd: " Julia Lawall
2017-07-28 20:41 ` [PATCH 10/11] greybus: usb: " Julia Lawall
2017-07-31  4:25   ` [greybus-dev] " Viresh Kumar
2017-07-31  7:14   ` Johan Hovold
2017-07-28 20:41 ` [PATCH 11/11] c67x00-hcd: " Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox