From patchwork Thu Jan 9 22:47:36 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: 3463631 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 9A60AC02DC for ; Thu, 9 Jan 2014 22:48:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98B8920103 for ; Thu, 9 Jan 2014 22:48:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98540200F3 for ; Thu, 9 Jan 2014 22:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756157AbaAIWsj (ORCPT ); Thu, 9 Jan 2014 17:48:39 -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 S1756162AbaAIWr7 (ORCPT ); Thu, 9 Jan 2014 17:47:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=5887; q=dns/txt; s=iport; t=1389307679; x=1390517279; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=IHGhqypr1iBvHeoA7ChPKPKWPd8Agor7NuGCvzfwImg=; b=gh0NxkoJmTanaDfwvTSk9OmJLVYPAuyGA73YvaYK1bPfiNu99+IhZmAG OgA92GPMk2nwEDrMApfO3wJ/V9u6fN/YCibOjROdJ2vZPy3o0gPGXdmHr xTb7vT/nM462wDmpwG5QJ6dsSyWt9xHetkqsOlJiI4R1aetMUiT6w3vNw w=; X-IronPort-AV: E=Sophos;i="4.95,634,1384300800"; d="scan'208";a="102455166" Received: from mtv-core-2.cisco.com ([171.68.58.7]) 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-2.cisco.com (8.14.5/8.14.5) with ESMTP id s09MlvCF022152; Thu, 9 Jan 2014 22:47:57 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id 22FA23F588; 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 08/15] IB/usnic: Remove duplicate and unnecessary consts Date: Thu, 9 Jan 2014 14:47:36 -0800 Message-Id: <1389307663-11296-9-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, https://lists.01.org/pipermail/kbuild/2013-December/000877.html, gave lots of duplicate const warnings. Remove the duplicate const as well as the original const bc both consts are unnecessary. Signed-off-by: Upinder Malhi --- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 19 +++++++++---------- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h | 12 +++++------- drivers/infiniband/hw/usnic/usnic_vnic.c | 12 +++++------- drivers/infiniband/hw/usnic/usnic_vnic.h | 12 +++++------- 4 files changed, 24 insertions(+), 31 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 5165be6..2043c5d 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -332,8 +332,8 @@ int usnic_ib_qp_grp_modify(struct usnic_ib_qp_grp *qp_grp, } struct usnic_vnic_res_chunk** -alloc_res_chunk_list(struct usnic_vnic *vnic, const struct usnic_vnic_res_spec - const *res_spec, void *owner_obj) +alloc_res_chunk_list(struct usnic_vnic *vnic, + struct usnic_vnic_res_spec *res_spec, void *owner_obj) { enum usnic_vnic_res_type res_type; struct usnic_vnic_res_chunk **res_chunk_list; @@ -427,20 +427,19 @@ static void qp_grp_and_vf_unbind(struct usnic_ib_qp_grp *qp_grp) qp_grp->vf = NULL; } -static void log_spec(const struct usnic_vnic_res_spec - const *res_spec) +static void log_spec(struct usnic_vnic_res_spec *res_spec) { char buf[512]; usnic_vnic_spec_dump(buf, sizeof(buf), res_spec); usnic_dbg("%s\n", buf); } -struct usnic_ib_qp_grp *usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, - struct usnic_ib_vf *vf, - struct usnic_ib_pd *pd, - const struct usnic_vnic_res_spec - const *res_spec, - enum usnic_transport_type transport) +struct usnic_ib_qp_grp * +usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, + struct usnic_ib_vf *vf, + struct usnic_ib_pd *pd, + struct usnic_vnic_res_spec *res_spec, + enum usnic_transport_type transport) { struct usnic_ib_qp_grp *qp_grp; u16 port_num; diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h index 37423f8..6416a95 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h @@ -75,13 +75,11 @@ usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX] = { const char *usnic_ib_qp_grp_state_to_string(enum ib_qp_state state); int usnic_ib_qp_grp_dump_hdr(char *buf, int buf_sz); int usnic_ib_qp_grp_dump_rows(void *obj, char *buf, int buf_sz); -struct usnic_ib_qp_grp *usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, - struct usnic_ib_vf *vf, - struct usnic_ib_pd *pd, - const struct usnic_vnic_res_spec - const *res_spec, - enum usnic_transport_type - transport); +struct usnic_ib_qp_grp * +usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, struct usnic_ib_vf *vf, + struct usnic_ib_pd *pd, + struct usnic_vnic_res_spec *res_spec, + enum usnic_transport_type transport); void usnic_ib_qp_grp_destroy(struct usnic_ib_qp_grp *qp_grp); int usnic_ib_qp_grp_modify(struct usnic_ib_qp_grp *qp_grp, enum ib_qp_state new_state, diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.c b/drivers/infiniband/hw/usnic/usnic_vnic.c index 02d66d9..5a50acb 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.c +++ b/drivers/infiniband/hw/usnic/usnic_vnic.c @@ -138,10 +138,8 @@ void usnic_vnic_res_spec_update(struct usnic_vnic_res_spec *spec, WARN_ON(1); } -int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec - const *min_spec, - const struct usnic_vnic_res_spec - const *res_spec) +int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec *min_spec, + struct usnic_vnic_res_spec *res_spec) { int found, i, j; @@ -165,8 +163,8 @@ int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec return 0; } -int usnic_vnic_spec_dump(char *buf, int buf_sz, const struct usnic_vnic_res_spec - const *res_spec) +int usnic_vnic_spec_dump(char *buf, int buf_sz, + struct usnic_vnic_res_spec *res_spec) { enum usnic_vnic_res_type res_type; int res_cnt; @@ -186,7 +184,7 @@ int usnic_vnic_spec_dump(char *buf, int buf_sz, const struct usnic_vnic_res_spec } int usnic_vnic_check_room(struct usnic_vnic *vnic, - const struct usnic_vnic_res_spec const *res_spec) + struct usnic_vnic_res_spec *res_spec) { int i; enum usnic_vnic_res_type res_type; diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.h b/drivers/infiniband/hw/usnic/usnic_vnic.h index 0a69a5d..14d931a 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.h +++ b/drivers/infiniband/hw/usnic/usnic_vnic.h @@ -77,14 +77,12 @@ int usnic_vnic_dump(struct usnic_vnic *vnic, char *buf, int buf_sz, void usnic_vnic_res_spec_update(struct usnic_vnic_res_spec *spec, enum usnic_vnic_res_type trgt_type, u16 cnt); -int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec - const *min_spec, - const struct usnic_vnic_res_spec - const *res_spec); -int usnic_vnic_spec_dump(char *buf, int buf_sz, const struct usnic_vnic_res_spec - const *res_spec); +int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec *min_spec, + struct usnic_vnic_res_spec *res_spec); +int usnic_vnic_spec_dump(char *buf, int buf_sz, + struct usnic_vnic_res_spec *res_spec); int usnic_vnic_check_room(struct usnic_vnic *vnic, - const struct usnic_vnic_res_spec const *res_spec); + struct usnic_vnic_res_spec *res_spec); int usnic_vnic_res_cnt(struct usnic_vnic *vnic, enum usnic_vnic_res_type type); int usnic_vnic_res_free_cnt(struct usnic_vnic *vnic,