From: Pavel Machek <pavel@ucw.cz>
To: "Álvaro Fernández Rojas" <noltari@gmail.com>
Cc: f.fainelli@gmail.com, Dan Murphy <dmurphy@ti.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: bcm6328: improve write and read functions
Date: Tue, 23 Feb 2021 09:34:49 +0100 [thread overview]
Message-ID: <20210223083449.GA9750@amd> (raw)
In-Reply-To: <20210223081732.9362-2-noltari@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 922 bytes --]
On Tue 2021-02-23 09:17:31, Álvaro Fernández Rojas wrote:
> This is proven to work in BMIPS BE/LE and ARM BE/LE, as used in bcm2835-rng
> 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
--
http://www.livejournal.com/~pavelmachek
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2021-02-23 8:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 8:17 [PATCH 0/2] leds: bcm63x8: improve read and write functions Álvaro Fernández Rojas
2021-02-23 8:17 ` [PATCH 1/2] leds: bcm6328: improve write and read functions Álvaro Fernández Rojas
2021-02-23 8:34 ` Pavel Machek [this message]
2021-02-23 8:42 ` Álvaro Fernández Rojas
2021-02-23 8:58 ` Pavel Machek
2021-02-23 9:05 ` Álvaro Fernández Rojas
2021-02-23 17:00 ` Florian Fainelli
2021-02-24 17:36 ` Pavel Machek
2021-02-24 17:45 ` Florian Fainelli
2021-02-24 21:45 ` Pavel Machek
2021-02-23 8:17 ` [PATCH 2/2] leds: bcm6358: " Álvaro Fernández Rojas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210223083449.GA9750@amd \
--to=pavel@ucw.cz \
--cc=dmurphy@ti.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=noltari@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.