[U-Boot] [PATCH] dwc_ahsata: use bitwise operator in sata_port_status

Jeroen Hofstee jeroen at myspectrum.nl
Tue Oct 28 19:20:18 CET 2014


Hello Nikita,

On 28-10-14 13:59, Nikita Kiryanov wrote:
> The logic of the return statement in sata_port_status() calls for a
> bitwise 'AND' operator, not logical 'AND'. Fix the typo.
>
> Reported-by: Jeroen Hofstee <jeroen at myspectrum.nl>
> Cc: Jeroen Hofstee <jeroen at myspectrum.nl>
> Cc: Stefano Babic <sbabic at denx.de>
> Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
> ---
>   drivers/block/dwc_ahsata.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
> index 29f478b..c68fd2f 100644
> --- a/drivers/block/dwc_ahsata.c
> +++ b/drivers/block/dwc_ahsata.c
> @@ -878,7 +878,7 @@ int sata_port_status(int dev, int port)
>   	probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
>   	port_mmio = (struct sata_port_regs *)probe_ent->port[port].port_mmio;
>   
> -	return readl(&(port_mmio->ssts)) && SATA_PORT_SSTS_DET_MASK;
> +	return readl(&(port_mmio->ssts)) & SATA_PORT_SSTS_DET_MASK;
>   }
>   
>   /*

And squashes a warning ;)

Acked-By: Jeroen Hofstee <jeroen at myspectrum.nl>

Regards,
Jeroen



More information about the U-Boot mailing list