From patchwork Tue Mar 18 06:17:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 3852141 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 76E25BF540 for ; Wed, 19 Mar 2014 17:36:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FA112011B for ; Wed, 19 Mar 2014 17:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5567420176 for ; Wed, 19 Mar 2014 17:36:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbaCRGSA (ORCPT ); Tue, 18 Mar 2014 02:18:00 -0400 Received: from na3sys010aog109.obsmtp.com ([74.125.245.86]:46239 "HELO na3sys010aog109.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752276AbaCRGR7 (ORCPT ); Tue, 18 Mar 2014 02:17:59 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]) (using TLSv1) by na3sys010aob109.postini.com ([74.125.244.12]) with SMTP ID DSNKUyflFoGK8IgY2n/TF620SqsWHf/N1yD1@postini.com; Mon, 17 Mar 2014 23:17:59 PDT Received: by mail-qg0-f50.google.com with SMTP id q108so19752909qgd.9 for ; Mon, 17 Mar 2014 23:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JCPfE1ggoVaa0w6apoHXWg9cGh6T/C4PVj6wvv2Opc8=; b=DlARkG7rH3kAA4B2QhzoRQYr+UpH3rek5fe+FPU1pxEV3MNwFbj4Vh20YjOgKo+G+O coJwYRqpltm7q3DXtmm7GkZxGNytR/fAq6bs0+1Ht0WH15xE8GW66927UFR4Yc8snWv+ 28AGpeWFrtJA51N4ZhPEd2cvfbPrOn4tpDb3A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=JCPfE1ggoVaa0w6apoHXWg9cGh6T/C4PVj6wvv2Opc8=; b=mWEc03x63HJw3O1GgWt6XBPAigOHuGV0tcZCdk8hYo6EI+0Tu9d2wj2Vzb7B41R8ce FAgDYTH0k5+Q5r5fEyrLWmoyoyTqK1STJeaCC8kLZVG4865LGEgTIBdkls2y/LD2+Acn sZh3ttvHYT8YKGv0dwS+vfrdUIuyHi2qbnDe4yNYrr9RXVaZo5c/GYm7z5QugLbovBQi +WaDAS8AnG0UC8lcuD/vDwVSlNkddc8wubETmk1ZmyzncJbFsCCvHTahjR98SfUxe+Y/ 4ZLxDpXHARgIJ23tZ6BqY6Fh4t9VCO1Hcd6wHgaP/vH66gUJQ1Bk4ulANQZtbIj7qVDh I1Eg== X-Gm-Message-State: ALoCoQmjokMggQ3BkxH5yjhU5qRHjvTAe1VIl6GNWPUyd2xDJW4Je2H3ylDaOgLn0x+bSD4p24iFAYY5TR6hgFmcUzWazxD2WHJz04Lod3Wfx2e1MLYNDQ94Yjvq5mPXHoCaYqDOngCHnWWkR/KeKzGkUXuphvcDjUBjs6e6k+lLiORNBmVI89E= X-Received: by 10.140.42.9 with SMTP id b9mr8247755qga.87.1395123478059; Mon, 17 Mar 2014 23:17:58 -0700 (PDT) X-Received: by 10.140.42.9 with SMTP id b9mr8247749qga.87.1395123477971; Mon, 17 Mar 2014 23:17:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.148.163 with HTTP; Mon, 17 Mar 2014 23:17:37 -0700 (PDT) In-Reply-To: <5327e216.M3hL1E84bxffArYd%fengguang.wu@intel.com> References: <5327e216.M3hL1E84bxffArYd%fengguang.wu@intel.com> From: Roland Dreier Date: Mon, 17 Mar 2014 23:17:37 -0700 Message-ID: Subject: Re: [infiniband:for-next 45/63] drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2030:7: warning: cast to pointer from integer of different size To: kbuild test robot , "linux-rdma@vger.kernel.org" Cc: Devesh Sharma , Selvin Xavier , kbuild-all@01.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY 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 Devesh, Not sure why you made the "clean up" patch that changed ocrdma_dev.stag_arr from an array of ocrdma_mr* to an array of u64 (which doesn't seem to accomplish anything but make the code messier and use more memory on 32-bit archs), but trusting that you have some reason for that, I'll add the following on top to fix the compiler warnings: RDMA/ocrdma: Fix warnings about pointer <-> integer casts We should cast pointers to and from unsigned long to turn them into ints. Signed-off-by: Roland Dreier } @@ -2862,7 +2862,8 @@ struct ib_mr *ocrdma_alloc_frmr(struct ib_pd *ibpd, int max_page_list_len) goto mbx_err; mr->ibmr.rkey = mr->hwmr.lkey; mr->ibmr.lkey = mr->hwmr.lkey; - dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = (u64)mr; + dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = + (unsigned long) mr; return &mr->ibmr; mbx_err: ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr); On Mon, Mar 17, 2014 at 11:05 PM, kbuild test robot wrote: > tree: git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-next > head: 9fc4580d3abdaca6c1d7d54f7f697308af0dc438 > commit: 8c2e221bbbbc071aa0e04acad1cc09d947fe40e1 [45/63] RDMA/ocrdma: Code clean-up > config: make ARCH=i386 allyesconfig > > All warnings: > > drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_build_fr': >>> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2030:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > mr = (struct ocrdma_mr *)qp->dev->stag_arr[(hdr->lkey >> 8) & > ^ > drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_alloc_frmr': >>> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2865:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] > dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = (u64)mr; > ^ > > vim +2030 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c > > 2014 hdr->rsvd_lkey_flags |= OCRDMA_LKEY_FLAG_REMOTE_WR; > 2015 if (wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_READ) > 2016 hdr->rsvd_lkey_flags |= OCRDMA_LKEY_FLAG_REMOTE_RD; > 2017 hdr->lkey = wr->wr.fast_reg.rkey; > 2018 hdr->total_len = wr->wr.fast_reg.length; > 2019 > 2020 fbo = wr->wr.fast_reg.iova_start - > 2021 (wr->wr.fast_reg.page_list->page_list[0] & PAGE_MASK); > 2022 > 2023 fast_reg->va_hi = upper_32_bits(wr->wr.fast_reg.iova_start); > 2024 fast_reg->va_lo = (u32) (wr->wr.fast_reg.iova_start & 0xffffffff); > 2025 fast_reg->fbo_hi = upper_32_bits(fbo); > 2026 fast_reg->fbo_lo = (u32) fbo & 0xffffffff; > 2027 fast_reg->num_sges = wr->wr.fast_reg.page_list_len; > 2028 fast_reg->size_sge = > 2029 get_encoded_page_size(1 << wr->wr.fast_reg.page_shift); >> 2030 mr = (struct ocrdma_mr *)qp->dev->stag_arr[(hdr->lkey >> 8) & > 2031 (OCRDMA_MAX_STAG - 1)]; > 2032 build_frmr_pbes(wr, mr->hwmr.pbl_table, &mr->hwmr); > 2033 return 0; > 2034 } > 2035 > 2036 static void ocrdma_ring_sq_db(struct ocrdma_qp *qp) > 2037 { > 2038 u32 val = qp->sq.dbid | (1 << OCRDMA_DB_SQ_SHIFT); > > --- > 0-DAY kernel build testing backend Open Source Technology Center > http://lists.01.org/mailman/listinfo/kbuild Intel Corporation --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 71e879908d27..875c16f60376 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -2027,8 +2027,8 @@ static int ocrdma_build_fr(struct ocrdma_qp *qp, struct ocrdma_hdr_wqe *hdr, fast_reg->num_sges = wr->wr.fast_reg.page_list_len; fast_reg->size_sge = get_encoded_page_size(1 << wr->wr.fast_reg.page_shift); - mr = (struct ocrdma_mr *)qp->dev->stag_arr[(hdr->lkey >> 8) & - (OCRDMA_MAX_STAG - 1)]; + mr = (struct ocrdma_mr *) (unsigned long) + qp->dev->stag_arr[(hdr->lkey >> 8) & (OCRDMA_MAX_STAG - 1)]; build_frmr_pbes(wr, mr->hwmr.pbl_table, &mr->hwmr); return 0;