All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qlcnic: constify qlcnic_mbx_ops structure
@ 2015-10-11 11:48 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2015-10-11 11:48 UTC (permalink / raw)
  To: Dept-GELinuxNICDev; +Cc: kernel-janitors, netdev, linux-kernel

The only instance of a qlcnic_mbx_ops structure is never modified.  Thus
the declaration of the structure and all references to the structure type
can be made const.

In the definition of the qlcnic_mailbox structure, the ops field is no
longer lined up with the other fields.  This was left as is, to avoid a lot
of trivial changes on the other lines.

Done with the help of Coccinelle.

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

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h         |    2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 9f0bdd9..37a731b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -4048,7 +4048,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
 	struct qlcnic_mailbox *mbx = container_of(work, struct qlcnic_mailbox,
 						  work);
 	struct qlcnic_adapter *adapter = mbx->adapter;
-	struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
+	const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
 	struct device *dev = &adapter->pdev->dev;
 	atomic_t *rsp_status = &mbx->rsp_status;
 	struct list_head *head = &mbx->cmd_q;
@@ -4098,7 +4098,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
 	}
 }
 
-static struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
+static const struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
 	.enqueue_cmd    = qlcnic_83xx_enqueue_mbx_cmd,
 	.dequeue_cmd    = qlcnic_83xx_dequeue_mbx_cmd,
 	.decode_resp    = qlcnic_83xx_decode_mbx_rsp,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index d6696cf..46bbea8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1092,7 +1092,7 @@ struct qlcnic_filter_hash {
 struct qlcnic_mailbox {
 	struct workqueue_struct	*work_q;
 	struct qlcnic_adapter	*adapter;
-	struct qlcnic_mbx_ops	*ops;
+	const struct qlcnic_mbx_ops *ops;
 	struct work_struct	work;
 	struct completion	completion;
 	struct list_head	cmd_q;


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

* [PATCH] qlcnic: constify qlcnic_mbx_ops structure
@ 2015-10-11 11:48 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2015-10-11 11:48 UTC (permalink / raw)
  To: Dept-GELinuxNICDev; +Cc: kernel-janitors, netdev, linux-kernel

The only instance of a qlcnic_mbx_ops structure is never modified.  Thus
the declaration of the structure and all references to the structure type
can be made const.

In the definition of the qlcnic_mailbox structure, the ops field is no
longer lined up with the other fields.  This was left as is, to avoid a lot
of trivial changes on the other lines.

Done with the help of Coccinelle.

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

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h         |    2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 9f0bdd9..37a731b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -4048,7 +4048,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
 	struct qlcnic_mailbox *mbx = container_of(work, struct qlcnic_mailbox,
 						  work);
 	struct qlcnic_adapter *adapter = mbx->adapter;
-	struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
+	const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
 	struct device *dev = &adapter->pdev->dev;
 	atomic_t *rsp_status = &mbx->rsp_status;
 	struct list_head *head = &mbx->cmd_q;
@@ -4098,7 +4098,7 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
 	}
 }
 
-static struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
+static const struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
 	.enqueue_cmd    = qlcnic_83xx_enqueue_mbx_cmd,
 	.dequeue_cmd    = qlcnic_83xx_dequeue_mbx_cmd,
 	.decode_resp    = qlcnic_83xx_decode_mbx_rsp,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index d6696cf..46bbea8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1092,7 +1092,7 @@ struct qlcnic_filter_hash {
 struct qlcnic_mailbox {
 	struct workqueue_struct	*work_q;
 	struct qlcnic_adapter	*adapter;
-	struct qlcnic_mbx_ops	*ops;
+	const struct qlcnic_mbx_ops *ops;
 	struct work_struct	work;
 	struct completion	completion;
 	struct list_head	cmd_q;


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

* RE: [PATCH] qlcnic: constify qlcnic_mbx_ops structure
  2015-10-11 11:48 ` Julia Lawall
  (?)
@ 2015-10-13  3:40 ` Sony Chacko
  -1 siblings, 0 replies; 5+ messages in thread
From: Sony Chacko @ 2015-10-13  3:40 UTC (permalink / raw)
  To: Julia Lawall, Dept-GE Linux NIC Dev; +Cc: kernel-janitors, netdev, linux-kernel

> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Julia Lawall
> Sent: Sunday, October 11, 2015 4:48 AM
> To: Dept-GE Linux NIC Dev <Dept-GELinuxNICDev@qlogic.com>
> Cc: kernel-janitors@vger.kernel.org; netdev <netdev@vger.kernel.org>; linux-
> kernel <linux-kernel@vger.kernel.org>
> Subject: [PATCH] qlcnic: constify qlcnic_mbx_ops structure
> 
> The only instance of a qlcnic_mbx_ops structure is never modified.  Thus the
> declaration of the structure and all references to the structure type can be made
> const.
> 
> In the definition of the qlcnic_mailbox structure, the ops field is no longer lined
> up with the other fields.  This was left as is, to avoid a lot of trivial changes on
> the other lines.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic.h         |    2 +-
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> index 9f0bdd9..37a731b 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> @@ -4048,7 +4048,7 @@ static void qlcnic_83xx_mailbox_worker(struct
> work_struct *work)
>  	struct qlcnic_mailbox *mbx = container_of(work, struct qlcnic_mailbox,
>  						  work);
>  	struct qlcnic_adapter *adapter = mbx->adapter;
> -	struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
> +	const struct qlcnic_mbx_ops *mbx_ops = mbx->ops;
>  	struct device *dev = &adapter->pdev->dev;
>  	atomic_t *rsp_status = &mbx->rsp_status;
>  	struct list_head *head = &mbx->cmd_q;
> @@ -4098,7 +4098,7 @@ static void qlcnic_83xx_mailbox_worker(struct
> work_struct *work)
>  	}
>  }
> 
> -static struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
> +static const struct qlcnic_mbx_ops qlcnic_83xx_mbx_ops = {
>  	.enqueue_cmd    = qlcnic_83xx_enqueue_mbx_cmd,
>  	.dequeue_cmd    = qlcnic_83xx_dequeue_mbx_cmd,
>  	.decode_resp    = qlcnic_83xx_decode_mbx_rsp,
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
> index d6696cf..46bbea8 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
> @@ -1092,7 +1092,7 @@ struct qlcnic_filter_hash {  struct qlcnic_mailbox {
>  	struct workqueue_struct	*work_q;
>  	struct qlcnic_adapter	*adapter;
> -	struct qlcnic_mbx_ops	*ops;
> +	const struct qlcnic_mbx_ops *ops;
>  	struct work_struct	work;
>  	struct completion	completion;
>  	struct list_head	cmd_q;
> 
Acked-by: Sony Chacko <sony.chacko@qlogic.com>

Thanks,
Sony

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

* Re: [PATCH] qlcnic: constify qlcnic_mbx_ops structure
  2015-10-11 11:48 ` Julia Lawall
@ 2015-10-13 11:18   ` David Miller
  -1 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-10-13 11:18 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: Dept-GELinuxNICDev, kernel-janitors, netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 11 Oct 2015 13:48:05 +0200

> The only instance of a qlcnic_mbx_ops structure is never modified.  Thus
> the declaration of the structure and all references to the structure type
> can be made const.
> 
> In the definition of the qlcnic_mailbox structure, the ops field is no
> longer lined up with the other fields.  This was left as is, to avoid a lot
> of trivial changes on the other lines.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.

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

* Re: [PATCH] qlcnic: constify qlcnic_mbx_ops structure
@ 2015-10-13 11:18   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-10-13 11:18 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: Dept-GELinuxNICDev, kernel-janitors, netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 11 Oct 2015 13:48:05 +0200

> The only instance of a qlcnic_mbx_ops structure is never modified.  Thus
> the declaration of the structure and all references to the structure type
> can be made const.
> 
> In the definition of the qlcnic_mailbox structure, the ops field is no
> longer lined up with the other fields.  This was left as is, to avoid a lot
> of trivial changes on the other lines.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.

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

end of thread, other threads:[~2015-10-13 11:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 11:48 [PATCH] qlcnic: constify qlcnic_mbx_ops structure Julia Lawall
2015-10-11 11:48 ` Julia Lawall
2015-10-13  3:40 ` Sony Chacko
2015-10-13 11:18 ` David Miller
2015-10-13 11:18   ` David Miller

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.