All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFC: pn533: constify pn533_phy_ops structures
@ 2016-08-09 16:11 ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-08-09 16:11 UTC (permalink / raw)
  To: Lauro Ramos Venancio
  Cc: kernel-janitors, Aloisio Almeida Jr, Samuel Ortiz,
	linux-wireless, linux-kernel

The pn533_phy_ops are never modified, so declare them as const.

Done with the help of Coccinelle.

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

---
 drivers/nfc/pn533/i2c.c   |    2 +-
 drivers/nfc/pn533/pn533.c |    2 +-
 drivers/nfc/pn533/pn533.h |    4 ++--
 drivers/nfc/pn533/usb.c   |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c
index 1dc8924..8a7c17e 100644
--- a/drivers/nfc/pn533/i2c.c
+++ b/drivers/nfc/pn533/i2c.c
@@ -176,7 +176,7 @@ static irqreturn_t pn533_i2c_irq_thread_fn(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct pn533_phy_ops i2c_phy_ops = {
+static const struct pn533_phy_ops i2c_phy_ops = {
 	.send_frame = pn533_i2c_send_frame,
 	.send_ack = pn533_i2c_send_ack,
 	.abort_cmd = pn533_i2c_abort_cmd,
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index d9c5583..2f817b3 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -2560,7 +2560,7 @@ struct pn533 *pn533_register_device(u32 device_type,
 				u32 protocols,
 				enum pn533_protocol_type protocol_type,
 				void *phy,
-				struct pn533_phy_ops *phy_ops,
+				const struct pn533_phy_ops *phy_ops,
 				struct pn533_frame_ops *fops,
 				struct device *dev,
 				struct device *parent)
diff --git a/drivers/nfc/pn533/pn533.h b/drivers/nfc/pn533/pn533.h
index 553c7d1..e26d634 100644
--- a/drivers/nfc/pn533/pn533.h
+++ b/drivers/nfc/pn533/pn533.h
@@ -179,7 +179,7 @@ struct pn533 {
 
 	struct device *dev;
 	void *phy;
-	struct pn533_phy_ops *phy_ops;
+	const struct pn533_phy_ops *phy_ops;
 };
 
 typedef int (*pn533_send_async_complete_t) (struct pn533 *dev, void *arg,
@@ -226,7 +226,7 @@ struct pn533 *pn533_register_device(u32 device_type,
 				u32 protocols,
 				enum pn533_protocol_type protocol_type,
 				void *phy,
-				struct pn533_phy_ops *phy_ops,
+				const struct pn533_phy_ops *phy_ops,
 				struct pn533_frame_ops *fops,
 				struct device *dev,
 				struct device *parent);
diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c
index 33ed78b..bcf3f54 100644
--- a/drivers/nfc/pn533/usb.c
+++ b/drivers/nfc/pn533/usb.c
@@ -434,7 +434,7 @@ static void pn533_send_complete(struct urb *urb)
 	}
 }
 
-static struct pn533_phy_ops usb_phy_ops = {
+static const struct pn533_phy_ops usb_phy_ops = {
 	.send_frame = pn533_usb_send_frame,
 	.send_ack = pn533_usb_send_ack,
 	.abort_cmd = pn533_usb_abort_cmd,


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

* [PATCH] NFC: pn533: constify pn533_phy_ops structures
@ 2016-08-09 16:11 ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-08-09 16:11 UTC (permalink / raw)
  To: Lauro Ramos Venancio
  Cc: kernel-janitors, Aloisio Almeida Jr, Samuel Ortiz,
	linux-wireless, linux-kernel

The pn533_phy_ops are never modified, so declare them as const.

Done with the help of Coccinelle.

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

---
 drivers/nfc/pn533/i2c.c   |    2 +-
 drivers/nfc/pn533/pn533.c |    2 +-
 drivers/nfc/pn533/pn533.h |    4 ++--
 drivers/nfc/pn533/usb.c   |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c
index 1dc8924..8a7c17e 100644
--- a/drivers/nfc/pn533/i2c.c
+++ b/drivers/nfc/pn533/i2c.c
@@ -176,7 +176,7 @@ static irqreturn_t pn533_i2c_irq_thread_fn(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct pn533_phy_ops i2c_phy_ops = {
+static const struct pn533_phy_ops i2c_phy_ops = {
 	.send_frame = pn533_i2c_send_frame,
 	.send_ack = pn533_i2c_send_ack,
 	.abort_cmd = pn533_i2c_abort_cmd,
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index d9c5583..2f817b3 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -2560,7 +2560,7 @@ struct pn533 *pn533_register_device(u32 device_type,
 				u32 protocols,
 				enum pn533_protocol_type protocol_type,
 				void *phy,
-				struct pn533_phy_ops *phy_ops,
+				const struct pn533_phy_ops *phy_ops,
 				struct pn533_frame_ops *fops,
 				struct device *dev,
 				struct device *parent)
diff --git a/drivers/nfc/pn533/pn533.h b/drivers/nfc/pn533/pn533.h
index 553c7d1..e26d634 100644
--- a/drivers/nfc/pn533/pn533.h
+++ b/drivers/nfc/pn533/pn533.h
@@ -179,7 +179,7 @@ struct pn533 {
 
 	struct device *dev;
 	void *phy;
-	struct pn533_phy_ops *phy_ops;
+	const struct pn533_phy_ops *phy_ops;
 };
 
 typedef int (*pn533_send_async_complete_t) (struct pn533 *dev, void *arg,
@@ -226,7 +226,7 @@ struct pn533 *pn533_register_device(u32 device_type,
 				u32 protocols,
 				enum pn533_protocol_type protocol_type,
 				void *phy,
-				struct pn533_phy_ops *phy_ops,
+				const struct pn533_phy_ops *phy_ops,
 				struct pn533_frame_ops *fops,
 				struct device *dev,
 				struct device *parent);
diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c
index 33ed78b..bcf3f54 100644
--- a/drivers/nfc/pn533/usb.c
+++ b/drivers/nfc/pn533/usb.c
@@ -434,7 +434,7 @@ static void pn533_send_complete(struct urb *urb)
 	}
 }
 
-static struct pn533_phy_ops usb_phy_ops = {
+static const struct pn533_phy_ops usb_phy_ops = {
 	.send_frame = pn533_usb_send_frame,
 	.send_ack = pn533_usb_send_ack,
 	.abort_cmd = pn533_usb_abort_cmd,


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

* Re: [PATCH] NFC: pn533: constify pn533_phy_ops structures
  2016-08-09 16:11 ` Julia Lawall
@ 2016-09-19  8:34   ` Samuel Ortiz
  -1 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2016-09-19  8:34 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Lauro Ramos Venancio, kernel-janitors, Aloisio Almeida Jr,
	linux-wireless, linux-kernel

Hi Julia,

On Tue, Aug 09, 2016 at 06:11:02PM +0200, Julia Lawall wrote:
> The pn533_phy_ops are never modified, so declare them as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/nfc/pn533/i2c.c   |    2 +-
>  drivers/nfc/pn533/pn533.c |    2 +-
>  drivers/nfc/pn533/pn533.h |    4 ++--
>  drivers/nfc/pn533/usb.c   |    2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
Applied to nfc-next, thanks.

Cheers,
Samuel.

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

* Re: [PATCH] NFC: pn533: constify pn533_phy_ops structures
@ 2016-09-19  8:34   ` Samuel Ortiz
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2016-09-19  8:34 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Lauro Ramos Venancio, kernel-janitors, Aloisio Almeida Jr,
	linux-wireless, linux-kernel

Hi Julia,

On Tue, Aug 09, 2016 at 06:11:02PM +0200, Julia Lawall wrote:
> The pn533_phy_ops are never modified, so declare them as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/nfc/pn533/i2c.c   |    2 +-
>  drivers/nfc/pn533/pn533.c |    2 +-
>  drivers/nfc/pn533/pn533.h |    4 ++--
>  drivers/nfc/pn533/usb.c   |    2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
Applied to nfc-next, thanks.

Cheers,
Samuel.

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

end of thread, other threads:[~2016-09-19  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 16:11 [PATCH] NFC: pn533: constify pn533_phy_ops structures Julia Lawall
2016-08-09 16:11 ` Julia Lawall
2016-09-19  8:34 ` Samuel Ortiz
2016-09-19  8:34   ` Samuel Ortiz

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.