Re: [v4l-dvb-maintainer] [PATCH 3/3] V4L: cinergyT2, remove bad usage of ERESTARTSYS

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

 



Mauro Carvalho Chehab wrote:
> Hi Jiri,
>
> Em Seg, 2007-10-08 às 13:41 +0100, Jiri Slaby escreveu:
>   
>> cinergyT2, remove bad usage of ERESTARTSYS
>>
>> test of cinergyt2->disconnect_pending doesn't ensure pending signal and so
>> ERESTARTSYS would reach userspace, which is not permitted. Change it to
>> EAGAIN
>>
>>     
>
> checkpatch.pl is complaining about your changeset:
>
> do not use assignment in if condition
> #82: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:492:
> +     if ((err = mutex_lock_interruptible(&cinergyt2->wq_sem)))
>
> do not use assignment in if condition
> #86: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:495:
> +     if ((err = mutex_lock_interruptible(&cinergyt2->sem)))
>
> do not use assignment in if condition
> #133: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:1036:
> +     if ((err = mutex_lock_interruptible(&cinergyt2->wq_sem)))
>
> do not use assignment in if condition
> #137: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:1039:
> +     if ((err = mutex_lock_interruptible(&cinergyt2->sem)))

Is this illegal as per kernel codingstyle?  I could understand if we may
want to avoid this sort of thing for the sake of code readability, but
this seems 100% proper to me, especially considering that we're simply
trying to catch an error return code.

One of the things that I really enjoy about the c programming language
is the fact that you can string many operations together into a single
statement through the use of logic.  I hate the thought of a patch being
nacked because of the above.  :-/

If this is indeed kernel codingstyle, then IMHO, we should let it slide
for catching error return codes.

Regards,

Mike Krufky
-
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