Re: [v4l-dvb-maintainer] [PATCH 07/16] Fixed i2c return value, conversion mdelay to msleep

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

 



Hi,

this is actually not needed but it saves as introduced by Luca Risolia
some CPU cycles. USB Devices might come and go whenever the user feels
he has to plug or unplug it.

On 2/7/06, Andreas Oberritter <[email protected]> wrote:
> Hi,
>
> On Tue, 2006-02-07 at 13:33 -0200, [email protected] wrote:
> > @@ -165,6 +168,9 @@ int em28xx_read_reg_req(struct em28xx *d
> >       u8 val;
> >       int ret;
> >
> > +     if (dev->state & DEV_DISCONNECTED)
> > +             return(-ENODEV);
>
> This looks like return was a function and is very uncommon for kernel
> coding style.
>
> > +
> >       em28xx_regdbg("req=%02x, reg=%02x:", req, reg);
> >
> >       ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), req,
> > @@ -195,7 +201,12 @@ int em28xx_write_regs_req(struct em28xx
> >       int ret;
> >
> >       /*usb_control_msg seems to expect a kmalloced buffer */
> > -     unsigned char *bufs = kmalloc(len, GFP_KERNEL);
> > +     unsigned char *bufs;
> > +
> > +     if (dev->state & DEV_DISCONNECTED)
> > +             return(-ENODEV);
>
> Same as obove.
>
> > +
> > +     bufs = kmalloc(len, GFP_KERNEL);
>
> I think you should add this:
>
>           if (bufs == NULL)
>                   return -ENOMEM;

right, submit a patch? :)

>
> Best regards,
> Andreas
>
>

Markus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux