Thread (11 messages) 11 messages, 3 authors, 2021-02-24

Re: [PATCH 1/2] leds: bcm6328: improve write and read functions

flat view

From: Pavel Machek <hidden>
Date: 2021-02-23 08:59:25
Also in: lkml

Hi!
quoted
quoted
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.

quoted
-#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.
I just wanted to copy the same comment as the one in bcm2835-rng and bcmgenet…
https://github.com/torvalds/linux/blob/3b9cdafb5358eb9f3790de2f728f765fef100731/drivers/char/hw_random/bcm2835-rng.c#L42-L60
https://github.com/torvalds/linux/blob/3b9cdafb5358eb9f3790de2f728f765fef100731/drivers/net/ethernet/broadcom/genet/bcmgenet.c#L71-L88
Yeah, but ideally you should not be copying comments; there should be
one central place which does it and does it right.

								Pavel

-- 
http://www.livejournal.com/~pavelmachek

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help