Re: [PATCH 2/4] can: cc770: Fix likely misuse of | for &

From: Marc Kleine-Budde
Date: Thu May 31 2012 - 16:54:48 EST


On 05/30/2012 10:25 PM, Joe Perches wrote:
> Using | with a constant is always true.
> Likely this should have be &.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>

Sounds reasonable. And there are no in tree users of the platform driver
that this fix could break.

commited to linux-can,
Marc

> ---
> drivers/net/can/cc770/cc770_platform.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
> index 53115ee..688371c 100644
> --- a/drivers/net/can/cc770/cc770_platform.c
> +++ b/drivers/net/can/cc770/cc770_platform.c
> @@ -154,7 +154,7 @@ static int __devinit cc770_get_platform_data(struct platform_device *pdev,
> struct cc770_platform_data *pdata = pdev->dev.platform_data;
>
> priv->can.clock.freq = pdata->osc_freq;
> - if (priv->cpu_interface | CPUIF_DSC)
> + if (priv->cpu_interface & CPUIF_DSC)
> priv->can.clock.freq /= 2;
> priv->clkout = pdata->cor;
> priv->bus_config = pdata->bcr;


--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |

Attachment: signature.asc
Description: OpenPGP digital signature