From patchwork Wed Oct 25 14:46:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 10026803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5172E60375 for ; Wed, 25 Oct 2017 14:46:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46F7B28BB3 for ; Wed, 25 Oct 2017 14:46:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BAF828BB5; Wed, 25 Oct 2017 14:46:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D228F28BB3 for ; Wed, 25 Oct 2017 14:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbdJYOqP (ORCPT ); Wed, 25 Oct 2017 10:46:15 -0400 Received: from opengridcomputing.com ([70.118.0.34]:56590 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbdJYOqO (ORCPT ); Wed, 25 Oct 2017 10:46:14 -0400 Received: from cody (cody.ogc.int [10.10.0.239]) by smtp.opengridcomputing.com (Postfix) with ESMTPSA id 18BB9223F0; Wed, 25 Oct 2017 09:46:14 -0500 (CDT) From: "Steve Wise" To: "'Leon Romanovsky'" Cc: "'Doug Ledford'" , References: <20171024182848.7945-1-leon@kernel.org> <067301d34cf7$d0872ff0$71958fd0$@opengridcomputing.com> <20171024185956.GL16127@mtr-leonro.local> In-Reply-To: <20171024185956.GL16127@mtr-leonro.local> Subject: RE: [PATCH rdma-next] RDMA/cxgb4: Remove unnecessary conversion from __be32 to cpu format Date: Wed, 25 Oct 2017 09:46:18 -0500 Message-ID: <020c01d34da0$04115ff0$0c341fd0$@opengridcomputing.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Content-Language: en-us Thread-Index: AQFkmafdicvztco3i3vzKXUN/r/cQQFMoElqAicnpMajtmz+gA== Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > > > @@ -234,7 +234,7 @@ struct t4_cqe { > > > > > > /* used for SQ completion processing */ > > > #define CQE_WRID_SQ_IDX(x) ((x)->u.scqe.cidx) > > > -#define CQE_WRID_FR_STAG(x) (be32_to_cpu((x)->u.scqe.stag)) > > > +#define CQE_WRID_FR_STAG(x) ((x)->u.scqe.stag) > > > > This is incorrect. The stag is filled in by HW which is BE. The declaration of > > scqe.stag needs to be __be32. > > So why do you declare stag as u32? I'm saying it is a bug that stag is declared as u32. t4_cqe.u.scqe.stag should be declared as __be32. So the fix for the sparse warning should be something like this: Steve. --- 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/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h index e765c00..bcb80ca6 100644 --- a/drivers/infiniband/hw/cxgb4/t4.h +++ b/drivers/infiniband/hw/cxgb4/t4.h @@ -171,7 +171,7 @@ struct t4_cqe { __be32 msn; } rcqe; struct { - u32 stag; + __be32 stag; u16 nada2; u16 cidx; } scqe;