public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* checkpatch.pl false positive? "ERROR: do not use assignment in if condition"
@ 2009-10-20 15:50 Tilman Schmidt
  2009-10-20 15:58 ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Tilman Schmidt @ 2009-10-20 15:50 UTC (permalink / raw)
  To: LKML, Andy Whitcroft

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

The command
./scripts/checkpatch.pl -f drivers/isdn/gigaset/bas-gigaset.c 
produces a lot of "ERROR" messages like these:

ERROR: do not use assignment in if condition
#608: FILE: isdn/gigaset/bas-gigaset.c:608:
+       if ((ret = usb_submit_urb(ucs->urb_cmd_in, GFP_ATOMIC)) != 0) {

ERROR: do not use assignment in if condition
#745: FILE: isdn/gigaset/bas-gigaset.c:745:
+               if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) {

ERROR: do not use assignment in if condition
#753: FILE: isdn/gigaset/bas-gigaset.c:753:
+               if ((rc = atread_submit(cs, BAS_TIMEOUT)) < 0) {

As far as I can see there's nothing wrong with these lines. In particular,
I cannot find anything in Documentation/CodingStyle that would prohibit an
assignment inside an 'if' condition.

PS: I know the file has other problems. That's why I'm trying to
checkpatch it in the first place.

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-21 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20 15:50 checkpatch.pl false positive? "ERROR: do not use assignment in if condition" Tilman Schmidt
2009-10-20 15:58 ` Randy Dunlap
2009-10-20 16:24   ` Andy Whitcroft
2009-10-21 17:07     ` Tilman Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox