2.6.20-rc1-mm1 suspicious prececence code ( was Re: [PATCH/v2] CodingStyle updates

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

 



On Fri, 15 Dec 2006 22:59:12 +0100, Jan Engelhardt said:

> I take it that people will automatically DTRT for obscure cases like
> shown before. Well, and if they don't, hopefully some reviewer catches
> things like 3*i + l<<2.

So I hacked up a few very ugly 'find|egrep' to look for some cases of that, and
found:

./include/asm-arm/arch-ebsa110/hardware.h:18: * Region 0 (addr = 0xf0000000 + io << 2)

Only one odd-looking use of +-*/ and <</>> - and it's in a comment.

And that's using a pattern like '\+[^,()=]*<<' (basically, any plus sign that
has a << after it, but no comma parens or equals to force grouping in between), and
then using /bin/eyeball to filter the resulting several hundred lines.
I admit I didn't try to catch expressions split over multiple lines, and
something of the form "foo * bar + (a-b) << 2" would have snuck by (but I
suspect if somebody bothered doing the (a-b), they would have another pair).

So either that sort of thing isn't really an error we make often, or the
reviewers are very good at catching it, or I'm a lot worse at finding them
than I thought I was... :)

Attachment: pgpdhOwKMKCJM.pgp
Description: PGP signature


[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