[U-Boot] [PATCH v5 03/23] spi: altera_spi: Use BIT macro

Thomas Chou thomas at wytron.com.tw
Tue Oct 27 03:45:06 CET 2015


Hi Jagan,

On 10/24/2015 11:38 AM, Jagan Teki wrote:
> Replace numerical bit shift with BIT macro
> in altera_spi
>
> :%s/(1 << nr)/BIT(nr)/g
> where nr = 0, 1, 2 .... 31
>
> Cc: Marek Vasut <marex at denx.de>
> Reviewed-by: Tom Rini <trini at konsulko.com>
> Signed-off-by: Jagan Teki <jteki at openedev.com>
> ---
>   drivers/spi/altera_spi.c | 26 +++++++++++++-------------
>   1 file changed, 13 insertions(+), 13 deletions(-)
>

Failed to merge since the driver is converted to driver model. Please 
rebase. Thanks.

Best regards,
Thomas Chou

> diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
> index a4d03d9..2302117 100644
> --- a/drivers/spi/altera_spi.c
> +++ b/drivers/spi/altera_spi.c
> @@ -29,19 +29,19 @@ struct altera_spi_regs {
>   	u32	slave_sel;
>   };
>
> -#define ALTERA_SPI_STATUS_ROE_MSK	(1 << 3)
> -#define ALTERA_SPI_STATUS_TOE_MSK	(1 << 4)
> -#define ALTERA_SPI_STATUS_TMT_MSK	(1 << 5)
> -#define ALTERA_SPI_STATUS_TRDY_MSK	(1 << 6)
> -#define ALTERA_SPI_STATUS_RRDY_MSK	(1 << 7)
> -#define ALTERA_SPI_STATUS_E_MSK		(1 << 8)
> -
> -#define ALTERA_SPI_CONTROL_IROE_MSK	(1 << 3)
> -#define ALTERA_SPI_CONTROL_ITOE_MSK	(1 << 4)
> -#define ALTERA_SPI_CONTROL_ITRDY_MSK	(1 << 6)
> -#define ALTERA_SPI_CONTROL_IRRDY_MSK	(1 << 7)
> -#define ALTERA_SPI_CONTROL_IE_MSK	(1 << 8)
> -#define ALTERA_SPI_CONTROL_SSO_MSK	(1 << 10)
> +#define ALTERA_SPI_STATUS_ROE_MSK	BIT(3)
> +#define ALTERA_SPI_STATUS_TOE_MSK	BIT(4)
> +#define ALTERA_SPI_STATUS_TMT_MSK	BIT(5)
> +#define ALTERA_SPI_STATUS_TRDY_MSK	BIT(6)
> +#define ALTERA_SPI_STATUS_RRDY_MSK	BIT(7)
> +#define ALTERA_SPI_STATUS_E_MSK		BIT(8)
> +
> +#define ALTERA_SPI_CONTROL_IROE_MSK	BIT(3)
> +#define ALTERA_SPI_CONTROL_ITOE_MSK	BIT(4)
> +#define ALTERA_SPI_CONTROL_ITRDY_MSK	BIT(6)
> +#define ALTERA_SPI_CONTROL_IRRDY_MSK	BIT(7)
> +#define ALTERA_SPI_CONTROL_IE_MSK	BIT(8)
> +#define ALTERA_SPI_CONTROL_SSO_MSK	BIT(10)
>
>   static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
>
>


More information about the U-Boot mailing list