i40e: constify i40e_client_ops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 1 May 2016 12:07:23 +0000 (14:07 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 17:47:07 +0000 (13:47 -0400)
The i40e_client_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_main.c
drivers/net/ethernet/intel/i40e/i40e_client.h

index 72a10a19880adda7522c5879aacf55e63d87c5dc..1f41b2c7333ed105e366f8ac4b77212bfbd2c79d 100644 (file)
@@ -1892,7 +1892,7 @@ static enum i40iw_status_code i40iw_virtchnl_send(struct i40iw_sc_dev *dev,
 }
 
 /* client interface functions */
-static struct i40e_client_ops i40e_ops = {
+static const struct i40e_client_ops i40e_ops = {
        .open = i40iw_open,
        .close = i40iw_close,
        .l2_param_change = i40iw_l2param_change,
index bf6b453d93a1a2fbfacb738f02fef36cb6929503..a4601d97fb24155f978ea9bb8de76276a14efc8d 100644 (file)
@@ -217,7 +217,7 @@ struct i40e_client {
 #define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE      BIT(0)
 #define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS      BIT(2)
        enum i40e_client_type type;
-       struct i40e_client_ops *ops;    /* client ops provided by the client */
+       const struct i40e_client_ops *ops; /* client ops provided by the client */
 };
 
 static inline bool i40e_client_is_registered(struct i40e_client *client)