From patchwork Fri Dec 20 20:26:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3391721 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE0219F344 for ; Fri, 20 Dec 2013 20:27:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE6D020703 for ; Fri, 20 Dec 2013 20:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E18CE20708 for ; Fri, 20 Dec 2013 20:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753512Ab3LTU1R (ORCPT ); Fri, 20 Dec 2013 15:27:17 -0500 Received: from mtv-iport-4.cisco.com ([173.36.130.15]:17782 "EHLO mtv-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216Ab3LTU1M (ORCPT ); Fri, 20 Dec 2013 15:27:12 -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=1387571231; x=1388780831; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fKcYAr4QIkhqA1liZ9hKAsXc8EDQvDTuXb9NNQiYdzg=; b=LIs+HbuNbEp4LumnwsDZmuMmciRbPHEyiI1Br3B4y0hwiWpixe6rJ9pZ KG2ttjcY5ssVQSLfUUKY6FKRU4LBr79MEcgJEVaR7RZ6LB5dFC9tvljPg T0+G+XSx9kHKT3W+QjKjHWITXhyrGqL4j8nojS/pCEbfhq0e/WkAe8lW9 c=; X-IronPort-AV: E=Sophos;i="4.95,523,1384300800"; d="scan'208";a="101057161" Received: from mtv-core-4.cisco.com ([171.68.58.9]) by mtv-iport-4.cisco.com with ESMTP; 20 Dec 2013 20:27:11 +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 rBKKR9wP012863; Fri, 20 Dec 2013 20:27:10 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id D1D2B3F80B; Fri, 20 Dec 2013 12:27:09 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH for-next 08/15] IB/usnic: Remove duplicate and unnecessary consts Date: Fri, 20 Dec 2013 12:26:39 -0800 Message-Id: <1387571206-8043-9-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1387571206-8043-1-git-send-email-umalhi@cisco.com> References: <1387571206-8043-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=-15.0 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 ad57a77..b5fb4d4 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,