From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59ED7C77B75 for ; Tue, 16 May 2023 05:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbjEPFBD (ORCPT ); Tue, 16 May 2023 01:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjEPFBB (ORCPT ); Tue, 16 May 2023 01:01:01 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48FBC273D; Mon, 15 May 2023 22:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wihNROgq+zlSDzTWmMP9dqi1SJvNx63H4aBgy1GMpNA=; b=eyoSXZiHHHuSOouLtPM248GNxA drIabQFrWdqk81FEunIAYAOGTB3q7Qx9yiPxILsdXC+OGBAEf+9+WJATvH0dhRaRRBJhv3pbZLPXS 1WMWDuS5IvFYSpqBmY50qEq/GAB97tuulcpJYfKnCRslRpD4OhJmEK6T76JgrEMb/3ZUAZIu1ZLv2 /m/Cka7jfi+x8u3uP7Om7dZkQ85lPKrpB9BPFVrBW7xlxRrPEzj8m4eOb5EenD/mGtopb802wR0v7 qaAWTn7Y2UdgrSo6QKub8tyrgkm4Qm/9GdXqV2Jw7tXP/ckSqiSN4FOYRROq/6hTE50oVVhbVHahu qzw8m9/Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pymnw-004NS2-32; Tue, 16 May 2023 05:00:56 +0000 Date: Mon, 15 May 2023 22:00:56 -0700 From: Christoph Hellwig To: Kelvin.Cao@microchip.com Cc: hch@infradead.org, dmaengine@vger.kernel.org, vkoul@kernel.org, George.Ge@microchip.com, linux-kernel@vger.kernel.org, logang@deltatee.com, tglx@linutronix.de, christophe.jaillet@wanadoo.fr Subject: Re: [PATCH v4 1/1] dmaengine: switchtec-dma: Introduce Switchtec DMA engine PCI driver Message-ID: References: <20230423213717.318655-1-kelvin.cao@microchip.com> <20230423213717.318655-2-kelvin.cao@microchip.com> <50e111a3cfecd0f232508d1b03e02d1e25d9d4a9.camel@microchip.com> <0ee5aa616475cc39b04c6b9e84db119bc8fc4d53.camel@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ee5aa616475cc39b04c6b9e84db119bc8fc4d53.camel@microchip.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 06:18:07PM +0000, Kelvin.Cao@microchip.com wrote: > > I find this rather confusing, especially as some code literally > > switches on the op to fill in either set. > > It's a hardware interface, and not possible to change it at the point. > I guess I can make it look slightly better by grouping the related > names together: > > union { > struct { > __le32 saddr_lo; > __le32 saddr_hi; > }; > struct { > __le32 widata_lo; > __le32 widata_hi; > }; > }; The hardware interface is simply: __le32 field_lo; __le32 field_hi; hardware documentation might decide to give those fields two different names just to confuse you :) I think everyone else would be served better by: __le32 addr_lo; /* SADDR_LO/WIADDR_LO */ __le32 addr_hi; /* SADDR_HI/WIADDR_HI */