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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux