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-next>] [day] [month] [year] [list]
Message-ID: <1269804493.7079.14.camel@tuxtm-linux>
Date:	Sun, 28 Mar 2010 22:28:13 +0300
From:	Olimpiu Pascariu <olimpiu.pascariu@...il.com>
To:	apw@...onical.com, akpm@...ux-foundation.org, dwalker@...o99.com,
	joe@...ches.com
Cc:	linux-kernel@...r.kernel.org
Subject: Checkpatch.pl false positive? "ERROR: return is not a function,
 parentheses are not required"

Hi,

I've used checkpatch.pl to verify drivers/staging/dt3155/dt3155_isr.c,
in order to provide a patch which fixes the errors and warnings found by
checkpatch.
The script returns the following error:
ERROR: return is not a function, parentheses are not required
#155: FILE: staging/dt3155/dt3155_isr.c:155:
+  return (dt3155_fbuffer[m]->ready_head -

The original code is:

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

I've deleted the the first open parenthesis and the last close
parenthesis, and now the code looks like this:

  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. 

Regards,
Olimpiu Pascariu




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