lists.openwall.net   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  linux-cve-announce  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:	Sun, 28 Mar 2010 12:59:30 -0700
From:	Joe Perches <joe@...ches.com>
To:	Alexey Dobriyan <adobriyan@...il.com>
Cc:	Olimpiu Pascariu <olimpiu.pascariu@...il.com>, apw@...onical.com,
	akpm@...ux-foundation.org, dwalker@...o99.com,
	linux-kernel@...r.kernel.org
Subject: Re: Checkpatch.pl false positive? "ERROR: return is not a
 function, parentheses are not required"

On Sun, 2010-03-28 at 23:09 +0300, Alexey Dobriyan wrote:
> On Sun, Mar 28, 2010 at 10:28:13PM +0300, Olimpiu Pascariu wrote:
> >   return (dt3155_fbuffer[m]->ready_head -
> >            dt3155_fbuffer[m]->ready_len +
> >            dt3155_fbuffer[m]->nbuffers)%
> >           (dt3155_fbuffer[m]->nbuffers);
> > IMHO the code is correct, though an auxiliary variable could be used to
> > avoid this error returned by checkpatch.pl. 
> Yes, checkpatch.pl doesn't understand C.

And as currently implemented, can not.

I think this passes checkpatch without warning:

	return (dt3155_fbuffer[m]->ready_head -
		dt3155_fbuffer[m]->ready_len +
		dt3155_fbuffer[m]->nbuffers) %
	       dt3155_fbuffer[m]->nbuffers;

It might be better to use a temporary for dt3155_fbuffer[m]
so the code could look more like:
	return (p->ready_head - p->ready_len + p->nbuffers) % p->nbuffers;
	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ