lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Oct 2009 08:58:20 -0700
From:	Randy Dunlap <>
To:	Tilman Schmidt <>
Cc:	LKML <>,
	Andy Whitcroft <>
Subject: Re: false positive?
 "ERROR: do not use assignment in if condition"

On Tue, 20 Oct 2009 17:50:45 +0200 Tilman Schmidt wrote:

> The command
> ./scripts/ -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.

Yes, we don't try to list Every Possible Problem in CodingStyle,
but emails on lkml over the past several years try to discourage such
assignments inside if's because they can be confusing, difficult to read,
and generally are not helping to produce any better code output than
	ret = usb_submit_urb(args);
	if (ret) {

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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists