2002-08-05 21:03:11

by Adam J. Richter

[permalink] [raw]
Subject: Patch: linux-2.5.30/fs/partitions/ldm.c BUG_ON(cond1 || cond2) separation

linux-2.5.30/fs/partitions/ldm.c had 23 statements
of the form BUG_ON(condition1 || condition2). This patch changes
them to:

BUG_ON(condition1);
BUG_ON(condition2);

This way you may get more useful information if somebody
trips one of them. I recently tripped such a statement with a
sporadic bug and was pretty frustrated by the reduced opportunity
to track it down, so I've decided to submit patches to fix all
such instances in the kernel. Grepping for 'BUG_ON.*\|\|' reveals
only four kernel components with such statements:
drivers/usb/storage/transport.c, ach/arm/mach-iop310/iq80310-pci.c,
fs/ntfs/, and fs/partitions/ldm.c. This is the final patch in the
series, which should eliminate all such BUG_ON(cond1 || cond2) statements.

I would like to get this patch into Linus's 2.5 tree.
Could you please let me know if you want to handle submitting it
to Linus, if you want me to do so, if you want to follow some other
course of action? Thanks in advance.

--
Adam J. Richter __ ______________ 575 Oroville Road
[email protected] \ / Milpitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America
"Free Software For The Rest Of Us."


Attachments:
(No filename) (1.22 kB)
ldm.diff (5.33 kB)
Download all attachments

2002-08-05 23:15:59

by Richard Russon

[permalink] [raw]
Subject: Re: Patch: linux-2.5.30/fs/partitions/ldm.c BUG_ON(cond1 || cond2) separation

Hi Adam,

> linux-2.5.30/fs/partitions/ldm.c had 23 statements
> of the form BUG_ON(condition1 || condition2). This patch changes
> them to:
>
> BUG_ON(condition1);
> BUG_ON(condition2);

Hmm... The only reason I put the BUG_ONs in, is paranoia. I cannot
imagine how they could be tripped, since all the pointers will have
already been checked. If you wish to standardise the way BUG_ON is
used, then OK, change them.

> Could you please let me know if you want to handle submitting it

Please can you submit the patch to Linus.

Cheers,
FlatCap (Rich)
[email protected]