Re: [patch] can: c_can: checking IS_ERR() instead of NULL

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

 



On Fri, Aug 01, 2014 at 11:01:36AM +0200, Marc Kleine-Budde wrote:

> > diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> > index 5dede6e..109cb44 100644
> > --- a/drivers/net/can/c_can/c_can_platform.c
> > +++ b/drivers/net/can/c_can/c_can_platform.c
> > @@ -280,7 +280,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
> >  
> >  		priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start,
> >  						     resource_size(res));
> > -		if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
> > +		if (!priv->raminit_ctrlreg || priv->instance < 0)
> 
> What about using PTR_ERR_OR_ZERO()?

No.  It doesn't ever return a PTR_ERR().  Checking for that would just
introduce a new static checker warning (signs of confusion may indicate
buggy code).

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux