From patchwork Thu Jan 9 22:47:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3463611 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 41499C02DC for ; Thu, 9 Jan 2014 22:48:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D7B62010B for ; Thu, 9 Jan 2014 22:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71D0920103 for ; Thu, 9 Jan 2014 22:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756085AbaAIWsC (ORCPT ); Thu, 9 Jan 2014 17:48:02 -0500 Received: from mtv-iport-4.cisco.com ([173.36.130.15]:64839 "EHLO mtv-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756087AbaAIWr6 (ORCPT ); Thu, 9 Jan 2014 17:47:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4496; q=dns/txt; s=iport; t=1389307678; x=1390517278; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=jewrt6In3ZEL6NTrjtDn2CHpgdepWTk+rt9w5cJInhw=; b=Thsd8+lPHvGzWpasOFiNsxSFBlGzXT3pALGdHwvBceGHX6UPqz5Y+xfO XLTTf+tqr44TN9KineJx/zdl5ZHkJ50s/4O9Rj5EgqesNRKrANg28ILKz vE1NNVpu83t552/MO+E7oPoZBKyY9bl0fc6j6vGKMeIsVWSPH2cQ+kO6H 8=; X-IronPort-AV: E=Sophos;i="4.95,634,1384300800"; d="scan'208";a="102455165" Received: from mtv-core-4.cisco.com ([171.68.58.9]) by mtv-iport-4.cisco.com with ESMTP; 09 Jan 2014 22:47:57 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id s09MlvFX011681; Thu, 9 Jan 2014 22:47:57 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id 2B1F43F7CD; Thu, 9 Jan 2014 14:47:57 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH v1 for-next 09/15] IB/usnic: Fix sparse should be static warnings Date: Thu, 9 Jan 2014 14:47:37 -0800 Message-Id: <1389307663-11296-10-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1389307663-11296-1-git-send-email-umalhi@cisco.com> References: <1389307663-11296-1-git-send-email-umalhi@cisco.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sparse spit out few functions should be static warnings. This patch provides a fix for the warnings. Signed-off-by: Upinder Malhi --- drivers/infiniband/hw/usnic/usnic_ib_main.c | 4 +++- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_ib_sysfs.c | 2 +- drivers/infiniband/hw/usnic/usnic_transport.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_transport.h | 1 + drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index bf9c2d7..1cf22d5 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c @@ -423,7 +423,8 @@ static DEFINE_PCI_DEVICE_TABLE(usnic_ib_pci_ids) = { {0,} }; -int usnic_ib_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) +static int usnic_ib_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *id) { int err; struct usnic_ib_dev *pf; @@ -579,6 +580,7 @@ static void __exit usnic_ib_destroy(void) { usnic_dbg("\n"); usnic_debugfs_exit(); + usnic_transport_fini(); unregister_netdevice_notifier(&usnic_ib_netdevice_notifier); pci_unregister_driver(&usnic_ib_pci_driver); usnic_uiom_fini(); diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 2043c5d..e7bec23 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -331,7 +331,7 @@ int usnic_ib_qp_grp_modify(struct usnic_ib_qp_grp *qp_grp, return status; } -struct usnic_vnic_res_chunk** +static struct usnic_vnic_res_chunk** alloc_res_chunk_list(struct usnic_vnic *vnic, struct usnic_vnic_res_spec *res_spec, void *owner_obj) { @@ -377,7 +377,7 @@ out_free_res: return ERR_PTR(err); } -void free_qp_grp_res(struct usnic_vnic_res_chunk **res_chunk_list) +static void free_qp_grp_res(struct usnic_vnic_res_chunk **res_chunk_list) { int i; for (i = 0; res_chunk_list[i]; i++) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c b/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c index e7925e4..bad985e 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_sysfs.c @@ -282,7 +282,7 @@ static struct attribute *usnic_ib_qpn_default_attrs[] = { NULL }; -struct kobj_type usnic_ib_qpn_type = { +static struct kobj_type usnic_ib_qpn_type = { .sysfs_ops = &usnic_ib_qpn_sysfs_ops, .default_attrs = usnic_ib_qpn_default_attrs }; diff --git a/drivers/infiniband/hw/usnic/usnic_transport.c b/drivers/infiniband/hw/usnic/usnic_transport.c index 6f3d245..723bd6c 100644 --- a/drivers/infiniband/hw/usnic/usnic_transport.c +++ b/drivers/infiniband/hw/usnic/usnic_transport.c @@ -26,7 +26,7 @@ static unsigned long *roce_bitmap; static u16 roce_next_port = 1; #define ROCE_BITMAP_SZ ((1 << (8 /*CHAR_BIT*/ * sizeof(u16)))/8 /*CHAR BIT*/) -DEFINE_SPINLOCK(roce_bitmap_lock); +static DEFINE_SPINLOCK(roce_bitmap_lock); static const char *transport_to_str(enum usnic_transport_type type) { @@ -106,7 +106,7 @@ out_roce_custom: } } -int usnic_transport_init() +int usnic_transport_init(void) { roce_bitmap = kzalloc(ROCE_BITMAP_SZ, GFP_KERNEL); if (!roce_bitmap) { diff --git a/drivers/infiniband/hw/usnic/usnic_transport.h b/drivers/infiniband/hw/usnic/usnic_transport.h index e4c924e..091fdaf 100644 --- a/drivers/infiniband/hw/usnic/usnic_transport.h +++ b/drivers/infiniband/hw/usnic/usnic_transport.h @@ -24,4 +24,5 @@ u16 usnic_transport_rsrv_port(enum usnic_transport_type type, u16 port_num); void usnic_transport_unrsrv_port(enum usnic_transport_type type, u16 port_num); int usnic_transport_init(void); +void usnic_transport_fini(void); #endif /* !USNIC_TRANSPORT_H */ diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c index 0477d70..200941f 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -46,7 +46,7 @@ #include "usnic_uiom.h" #include "usnic_uiom_interval_tree.h" -struct workqueue_struct *usnic_uiom_wq; +static struct workqueue_struct *usnic_uiom_wq; #define USNIC_UIOM_PAGE_CHUNK \ ((PAGE_SIZE - offsetof(struct usnic_uiom_chunk, page_list)) /\