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


Groups > linux.kernel > #1300265 > unrolled thread

[PATCH] ixgbe: constify ixgbe_mbx_operations structure

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-01-03 08:10 +0100
Last post2016-01-08 09:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ixgbe: constify ixgbe_mbx_operations structure Julia Lawall <Julia.Lawall@lip6.fr> - 2016-01-03 08:10 +0100
    Re: [PATCH] ixgbe: constify ixgbe_mbx_operations structure Jeff Kirsher <jeffrey.t.kirsher@intel.com> - 2016-01-08 09:30 +0100

#1300265 — [PATCH] ixgbe: constify ixgbe_mbx_operations structure

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-01-03 08:10 +0100
Subject[PATCH] ixgbe: constify ixgbe_mbx_operations structure
Message-ID<qMKXE-2eY-5@gated-at.bofh.it>
This ixgbe_mbx_operations structure is never modified, so declare it as
const.  The other structure of this type is already const.

Done with the help of Coccinelle.

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

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c  |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h  |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
index 9993a47..4a769db 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
@@ -446,7 +446,7 @@ void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
 }
 #endif /* CONFIG_PCI_IOV */
 
-struct ixgbe_mbx_operations mbx_ops_generic = {
+const struct ixgbe_mbx_operations mbx_ops_generic = {
 	.read                   = ixgbe_read_mbx_pf,
 	.write                  = ixgbe_write_mbx_pf,
 	.read_posted            = ixgbe_read_posted_mbx,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
index 8daa95f..9119cb8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
@@ -123,6 +123,6 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *, u16);
 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *);
 #endif /* CONFIG_PCI_IOV */
 
-extern struct ixgbe_mbx_operations mbx_ops_generic;
+extern const struct ixgbe_mbx_operations mbx_ops_generic;
 
 #endif /* _IXGBE_MBX_H_ */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 5f53cc6..0edc2c2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -3477,7 +3477,7 @@ struct ixgbe_info {
 	struct ixgbe_mac_operations	*mac_ops;
 	struct ixgbe_eeprom_operations	*eeprom_ops;
 	struct ixgbe_phy_operations	*phy_ops;
-	struct ixgbe_mbx_operations	*mbx_ops;
+	const struct ixgbe_mbx_operations *mbx_ops;
 	const u32			*mvals;
 };
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1304260

FromJeff Kirsher <jeffrey.t.kirsher@intel.com>
Date2016-01-08 09:30 +0100
Message-ID<qOAAN-45F-7@gated-at.bofh.it>
In reply to#1300265

[Multipart message — attachments visible in raw view] — view raw

On Sun, 2016-01-03 at 07:55 +0100, Julia Lawall wrote:
> This ixgbe_mbx_operations structure is never modified, so declare it
> as
> const.  The other structure of this type is already const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c  |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h  |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_type.h |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Dropping this patch since Mark has provided a more in-depth patch to
fix the entire driver.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web