Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp162680rwd; Mon, 15 May 2023 22:19:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Gu/oFFCwUJGc+QOY/n/CGbak73RspVCUsA546TBLCES7K6JGU6lS3RnNF32Usj7S0mRfl X-Received: by 2002:a05:6a00:1794:b0:645:b13e:e674 with SMTP id s20-20020a056a00179400b00645b13ee674mr38509108pfg.26.1684214356206; Mon, 15 May 2023 22:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684214356; cv=none; d=google.com; s=arc-20160816; b=MQjBrKAMCfHWEBOD+nlqoHHHLmSDqjxQfZy3HR9BiunzllJpfn8z6XMUq49RzJP5bA Y1y16ZHhpHz4PbBJdtMDiYZbVWHa4tVwaT65Dujux8rkm+AgO0o58Pb6pCnjNxjzzDe8 X0lgJA1bWMyH/rpjJw83MU4OvdxLuRMP369YG1C+as806Uko92wdB87/qbSr9KTlZoO+ Axa9Euz+iBBGS7aDosmG2YxZlY8556OyfgrY0dRyvj9ZR9HpBr+c9DBNCpQOLtxlPqQk 6O6Om4yaBcdthNXh0MUUP2jhJCWWeeJ6Qbua/CIUGtXIhDJ7jDOwI8ycTwdBvTCmA+vT GOGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wihNROgq+zlSDzTWmMP9dqi1SJvNx63H4aBgy1GMpNA=; b=xZHymxQheRWKSdmSfoMkI477uINId0S65QNnEFQVgPv2ZvAXRwlIud/jQW8eEtHYkZ iHbetbivmKxf4qrb2dCCMG6rPt5LGJxCYgcuj/C37fJWJzwtf2HMb9+gSZc16YZRdal8 ic+ucRiXXYvKenIO+rugR9FHzxvSwLRVnze3TyZxW1w/CTnvlA1GHy6T+5tsS9lIuOuo 2O2l4ABpu0mi3c26u/MmADM4S6u2Ke+BWjDvYvDzkuP1clcNdVcFhnduJyYJ1/6+bu8D LbCXm4705qjK++ZydxJOVs7o0q/Kjt1BcpjFJOQL5wwuKkKQ302ScD18AMYn6BNS/il7 02IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eyoSXZiH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d77-20020a621d50000000b006437ddddd2asi17914803pfd.362.2023.05.15.22.19.00; Mon, 15 May 2023 22:19:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eyoSXZiH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbjEPFBC (ORCPT + 99 others); Tue, 16 May 2023 01:01:02 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 */