Fix source code warnings generated by Sparse

Signed-off-by: Tatyana Nikolova <[email protected]>
Signed-off-by: Faisal Latif <[email protected]>
---
 kernel_patches/fixes/nes_0065_sparse_fix.patch |  217 ++++++++++++++++++++++++
 1 files changed, 217 insertions(+), 0 deletions(-)
 create mode 100644 kernel_patches/fixes/nes_0065_sparse_fix.patch

diff --git a/kernel_patches/fixes/nes_0065_sparse_fix.patch 
b/kernel_patches/fixes/nes_0065_sparse_fix.patch
new file mode 100644
index 0000000..e1daf3f
--- /dev/null
+++ b/kernel_patches/fixes/nes_0065_sparse_fix.patch
@@ -0,0 +1,217 @@
+diff --git a/drivers/infiniband/hw/nes/nes_cm.c 
b/drivers/infiniband/hw/nes/nes_cm.c
+index 3fb164d..47713f2 100644
+--- a/drivers/infiniband/hw/nes/nes_cm.c
++++ b/drivers/infiniband/hw/nes/nes_cm.c
+@@ -2802,7 +2802,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
+       u16 last_ae;
+       u8 original_hw_tcp_state;
+       u8 original_ibqp_state;
+-      enum iw_cm_event_type disconn_status = IW_CM_EVENT_STATUS_OK;
++      enum iw_cm_event_status disconn_status = IW_CM_EVENT_STATUS_OK;
+       int issue_disconn = 0;
+       int issue_close = 0;
+       int issue_flush = 0;
+diff --git a/drivers/infiniband/hw/nes/nes_hw.c 
b/drivers/infiniband/hw/nes/nes_hw.c
+index 1b4d61d..2398c2d 100644
+--- a/drivers/infiniband/hw/nes/nes_hw.c
++++ b/drivers/infiniband/hw/nes/nes_hw.c
+@@ -1305,7 +1305,7 @@ int nes_destroy_cqp(struct nes_device *nesdev)
+ /**
+  * nes_init_1g_phy
+  */
+-int nes_init_1g_phy(struct nes_device *nesdev, u8 phy_type, u8 phy_index)
++static int nes_init_1g_phy(struct nes_device *nesdev, u8 phy_type, u8 
phy_index)
+ {
+       u32 counter = 0;
+       u16 phy_data;
+@@ -1359,7 +1359,7 @@ int nes_init_1g_phy(struct nes_device *nesdev, u8 
phy_type, u8 phy_index)
+ /**
+  * nes_init_2025_phy
+  */
+-int nes_init_2025_phy(struct nes_device *nesdev, u8 phy_type, u8 phy_index)
++static int nes_init_2025_phy(struct nes_device *nesdev, u8 phy_type, u8 
phy_index)
+ {
+       u32 temp_phy_data = 0;
+       u32 temp_phy_data2 = 0;
+diff --git a/drivers/infiniband/hw/nes/nes_mgt.c 
b/drivers/infiniband/hw/nes/nes_mgt.c
+index e46b000..8d95ed2 100644
+--- a/drivers/infiniband/hw/nes/nes_mgt.c
++++ b/drivers/infiniband/hw/nes/nes_mgt.c
+@@ -40,7 +40,7 @@
+ #include "nes.h"
+ #include "nes_mgt.h"
+
+-void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic)
++static void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic)
+ {
+       unsigned long flags;
+       dma_addr_t bus_address;
+@@ -119,7 +119,7 @@ void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic)
+ /**
+  * nes_mgt_rq_wqes_timeout
+  */
+-void nes_mgt_rq_wqes_timeout(unsigned long parm)
++static void nes_mgt_rq_wqes_timeout(unsigned long parm)
+ {
+       struct nes_vnic_mgt *mgtvnic = (struct nes_vnic_mgt *)parm;
+
+@@ -131,7 +131,7 @@ void nes_mgt_rq_wqes_timeout(unsigned long parm)
+ /**
+  * nes_mgt_free_skb - unmap and free skb
+  */
+-void nes_mgt_free_skb(struct nes_device *nesdev, struct sk_buff *skb, u32 dir)
++static void nes_mgt_free_skb(struct nes_device *nesdev, struct sk_buff *skb, 
u32 dir)
+ {
+       struct nes_rskb_cb *cb;
+
+@@ -144,7 +144,7 @@ void nes_mgt_free_skb(struct nes_device *nesdev, struct 
sk_buff *skb, u32 dir)
+ /**
+  * nes_download_callback - handle download completions
+  */
+-void nes_download_callback(struct nes_device *nesdev, struct nes_cqp_request 
*cqp_request)
++static void nes_download_callback(struct nes_device *nesdev, struct 
nes_cqp_request *cqp_request)
+ {
+       struct pau_fpdu_info *fpdu_info = cqp_request->cqp_callback_pointer;
+       struct nes_qp *nesqp = fpdu_info->nesqp;
+@@ -168,7 +168,7 @@ void nes_download_callback(struct nes_device *nesdev, 
struct nes_cqp_request *cq
+ /**
+  * nes_get_seq - Get the seq, ack_seq and window from the packet
+  */
+-u32 nes_get_seq(struct sk_buff *skb, u32 *ack, u16 *wnd, u32 *fin_rcvd, u32 
*rst_rcvd)
++static u32 nes_get_seq(struct sk_buff *skb, u32 *ack, u16 *wnd, u32 
*fin_rcvd, u32 *rst_rcvd)
+ {
+       struct nes_rskb_cb *cb = (struct nes_rskb_cb *)&skb->cb[0];
+       struct iphdr *iph = (struct iphdr *)(cb->data_start + ETH_HLEN);
+@@ -184,7 +184,7 @@ u32 nes_get_seq(struct sk_buff *skb, u32 *ack, u16 *wnd, 
u32 *fin_rcvd, u32 *rst
+ /**
+  * nes_get_next_skb - Get the next skb based on where current skb is in the 
queue
+  */
+-struct sk_buff *nes_get_next_skb(struct nes_device *nesdev, struct nes_qp 
*nesqp, struct sk_buff *skb,
++static struct sk_buff *nes_get_next_skb(struct nes_device *nesdev, struct 
nes_qp *nesqp, struct sk_buff *skb,
+                                u32 nextseq, u32 *ack, u16 *wnd, u32 
*fin_rcvd, u32 *rst_rcvd)
+ {
+       u32 seq;
+@@ -232,7 +232,7 @@ out:
+ /**
+  * get_fpdu_info - Find the next complete fpdu and return its fragments.
+  */
+-int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp, struct 
pau_fpdu_info **pau_fpdu_info)
++static int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp, 
struct pau_fpdu_info **pau_fpdu_info)
+ {
+       struct sk_buff *skb;
+       struct iphdr *iph;
+@@ -403,7 +403,7 @@ out:
+ /**
+  * forward_fpdu - send complete fpdus, one at a time
+  */
+-int forward_fpdus(struct nes_vnic *nesvnic, struct nes_qp *nesqp)
++static int forward_fpdus(struct nes_vnic *nesvnic, struct nes_qp *nesqp)
+ {
+       struct nes_device *nesdev = nesvnic->nesdev;
+       struct pau_fpdu_info *fpdu_info;
+@@ -475,7 +475,7 @@ int forward_fpdus(struct nes_vnic *nesvnic, struct nes_qp 
*nesqp)
+       return 0;
+ }
+
+-void process_fpdus(struct nes_vnic *nesvnic, struct nes_qp *nesqp)
++static void process_fpdus(struct nes_vnic *nesvnic, struct nes_qp *nesqp)
+ {
+       int again = 1;
+       unsigned long flags;
+@@ -499,7 +499,7 @@ void process_fpdus(struct nes_vnic *nesvnic, struct nes_qp 
*nesqp)
+ /**
+  * queue_fpdus - Handle fpdu's that hw passed up to sw
+  */
+-void queue_fpdus(struct sk_buff *skb, struct nes_vnic *nesvnic, struct nes_qp 
*nesqp)
++static void queue_fpdus(struct sk_buff *skb, struct nes_vnic *nesvnic, struct 
nes_qp *nesqp)
+ {
+       struct sk_buff *tmpskb;
+       struct nes_rskb_cb *cb;
+@@ -570,7 +570,7 @@ void queue_fpdus(struct sk_buff *skb, struct nes_vnic 
*nesvnic, struct nes_qp *n
+ /**
+  * mgt_thread - Handle mgt skbs in a safe context
+  */
+-int mgt_thread(void *context)
++static int mgt_thread(void *context)
+ {
+       struct nes_vnic *nesvnic = context;
+       struct sk_buff *skb;
+@@ -628,7 +628,7 @@ void nes_destroy_pau_qp(struct nes_device *nesdev, struct 
nes_qp *nesqp)
+       spin_unlock_irqrestore(&nesqp->pau_lock, flags);
+ }
+
+-void nes_chg_qh_handler(struct nes_device *nesdev, struct nes_cqp_request 
*cqp_request)
++static void nes_chg_qh_handler(struct nes_device *nesdev, struct 
nes_cqp_request *cqp_request)
+ {
+       struct pau_qh_chg *qh_chg = cqp_request->cqp_callback_pointer;
+       struct nes_cqp_request *new_request;
+@@ -708,7 +708,7 @@ void nes_chg_qh_handler(struct nes_device *nesdev, struct 
nes_cqp_request *cqp_r
+ /**
+  * nes_change_quad_hash
+  */
+-int nes_change_quad_hash(struct nes_device *nesdev,
++static int nes_change_quad_hash(struct nes_device *nesdev,
+                        struct nes_vnic *nesvnic, struct nes_qp *nesqp)
+ {
+       struct nes_cqp_request *cqp_request = NULL;
+@@ -766,7 +766,7 @@ chg_qh_err:
+  * This management code deals with any packed and unaligned (pau) fpdu's
+  * that the hardware cannot handle.
+  */
+-void nes_mgt_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
++static void nes_mgt_ce_handler(struct nes_device *nesdev, struct 
nes_hw_nic_cq *cq)
+ {
+       struct nes_vnic_mgt *mgtvnic = container_of(cq, struct nes_vnic_mgt, 
mgt_cq);
+       struct nes_adapter *nesadapter = nesdev->nesadapter;
+diff --git a/drivers/infiniband/hw/nes/nes_utils.c 
b/drivers/infiniband/hw/nes/nes_utils.c
+index 8f00511..1b1a4c2 100644
+--- a/drivers/infiniband/hw/nes/nes_utils.c
++++ b/drivers/infiniband/hw/nes/nes_utils.c
+@@ -55,7 +55,7 @@ static u16 nes_read16_eeprom(void __iomem *addr, u16 offset);
+ u32 mh_detected;
+ u32 mh_pauses_sent;
+
+-u32 nes_set_pau(struct nes_device *nesdev)
++static u32 nes_set_pau(struct nes_device *nesdev)
+ {
+       u32 ret = 0;
+       u32 counter;
+diff --git a/drivers/infiniband/hw/nes/nes_verbs.c 
b/drivers/infiniband/hw/nes/nes_verbs.c
+index 5fc5418..d33f563 100644
+--- a/drivers/infiniband/hw/nes/nes_verbs.c
++++ b/drivers/infiniband/hw/nes/nes_verbs.c
+@@ -375,7 +375,7 @@ static int alloc_fast_reg_mr(struct nes_device *nesdev, 
struct nes_pd *nespd,
+ /*
+  * nes_alloc_fast_reg_mr
+  */
+-struct ib_mr *nes_alloc_fast_reg_mr(struct ib_pd *ibpd, int max_page_list_len)
++static struct ib_mr *nes_alloc_fast_reg_mr(struct ib_pd *ibpd, int 
max_page_list_len)
+ {
+       struct nes_pd *nespd = to_nespd(ibpd);
+       struct nes_vnic *nesvnic = to_nesvnic(ibpd->device);
+@@ -1598,11 +1598,11 @@ static int nes_destroy_qp(struct ib_qp *ibqp)
+                       /* destroy send and rcv  QPs */
+                       if (nesqp->rx_ud_wq)
+                               nes_ud_destroy_wq(nesqp->rx_ud_wq);
+-                      nesqp->rx_ud_wq = 0;
++                      nesqp->rx_ud_wq = NULL;
+
+                       if (nesqp->tx_ud_wq)
+                               nes_ud_destroy_wq(nesqp->tx_ud_wq);
+-                      nesqp->tx_ud_wq = 0;
++                      nesqp->tx_ud_wq = NULL;
+                       atomic_inc(&qps_destroyed);
+
+                       /* to prevent the destroy of cq before QP
+@@ -2128,7 +2128,7 @@ static int nes_reg_mr(struct nes_device *nesdev, struct 
nes_pd *nespd,
+       u8  use_256_pbls = 0;
+       u8  use_4k_pbls = 0;
+       u16 use_two_level = (pbl_count_4k > 1) ? 1 : 0;
+-      struct nes_root_vpbl new_root = {0, 0, 0};
++      struct nes_root_vpbl new_root = {0, NULL, NULL};
+       u32 opcode = 0;
+       u16 major_code;
+
+--
+1.7.1
+
-- 
1.7.1

_______________________________________________
ewg mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

Reply via email to