Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2201346pxb; Tue, 23 Feb 2021 00:38:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTM6XgzMP3gEmkb5MIlcKNTCJNv5RjJiBHgLhi8wdkEiCVEwc3Kota3DiU8/qS+uVjA3Pp X-Received: by 2002:a05:6402:22a8:: with SMTP id cx8mr27606524edb.376.1614069511779; Tue, 23 Feb 2021 00:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614069511; cv=none; d=google.com; s=arc-20160816; b=n+qDoFTbi2Q6qwOfSq0WlUIGVWdRlW/RcGBHUOLtjXGgQ3rlkfBFge9M3uxCoAVMQk zlGNwaDWl/oTXmSTs1baskI6WodhyivZSIYE841tQet/lo9Yaf4oEYyREWdzLaAVk7u+ 0By8eS49eBQ5bNWVXZeafhG39rlEFl13NV9nDVx6hLLgOhyYG9KlA4ySkx0/ubqPq7pq gK1lZKfXSjgbn30OPtax3DBcIWA931JXBWcLgbC1/d22ITL9AWR88pJyj9Lhis/w0Gxr eZMqJupQm2LOIiiJ+7hPgy39wpMErIDxjWZh5Bxi0YqD0X6oArhvSsihB/FkhqdQfw6J +EcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CcJqIA5aSsmJYIwuqhO71F+WZTyU05eFKYNhmOyowJc=; b=dTuCeJUMkEHcwMD9SBRjtkf+3pKPQbB51Gk7KGtTQdlfgDRQzphE2h7Tp3qR/bIU/l VXYrphlrPAvn/YBL7+NZBbVJ5NsKm/ubmEStMmawzE2OO/HCLw+emEW+4yRBAklL+V+E 1LzM5IpfZaXzO327lvQevA2RnO9niZ+HT5LjGaJBvK9b8zTv6DqQlzBN0afCnKXm5swS O/zbq+EW9kxcGrHsJ4Kw3u430uzvs74f/bY2l1J/3TJh/q2pQruCMflbIFuHNZ3qC5ZP /uxuNNN9ldYydRf1ZRROgbvXfUZLtJJflgeOoiYI2M/ltpjKvci7lf093s+Q4rNJVl5l j7ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si13203836edr.378.2021.02.23.00.37.53; Tue, 23 Feb 2021 00:38:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232133AbhBWIfe (ORCPT + 99 others); Tue, 23 Feb 2021 03:35:34 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:47094 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbhBWIfd (ORCPT ); Tue, 23 Feb 2021 03:35:33 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 57E661C0B82; Tue, 23 Feb 2021 09:34:50 +0100 (CET) Date: Tue, 23 Feb 2021 09:34:49 +0100 From: Pavel Machek To: =?iso-8859-1?Q?=C1lvaro_Fern=E1ndez?= Rojas Cc: f.fainelli@gmail.com, Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] leds: bcm6328: improve write and read functions Message-ID: <20210223083449.GA9750@amd> References: <20210223081732.9362-1-noltari@gmail.com> <20210223081732.9362-2-noltari@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20210223081732.9362-2-noltari@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --DocE+STaALJfprDB Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2021-02-23 09:17:31, =C1lvaro Fern=E1ndez Rojas wrote: > This is proven to work in BMIPS BE/LE and ARM BE/LE, as used in bcm2835-r= ng > and bcmgenet drivers. > Both should also be inline functions. > -#ifdef CONFIG_CPU_BIG_ENDIAN > - iowrite32be(data, reg); > -#else > - writel(data, reg); > -#endif > + /* MIPS chips strapped for BE will automagically configure the > + * peripheral registers for CPU-native byte order. > + */ Bad comment style. > + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) > + __raw_writel(data, reg); > + else > + writel_relaxed(data, reg); > } Code does not match comment (still need to do conversion on non-MIPS?), and it certainly should not be here (do all mipsen behave like that?!), and it really should not be converting to _relaxed at the same time. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --DocE+STaALJfprDB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmA0vikACgkQMOfwapXb+vKMTACgugzKKrfnyzgFO2G+yCZsdLh2 i8oAn006G+WWIcArR+LjGWMnqfAdofio =VWQL -----END PGP SIGNATURE----- --DocE+STaALJfprDB--