Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Maciej W. Rozycki <macro@...>
Cc: Andrew Morton <akpm@...>, Antonino Daplas <adaplas@...>, <linux-fbdev-devel@...>, <linux-mips@...>, <linux-kernel@...>
Date: Thursday, September 20, 2007 - 10:24 am

On Thu, 20 Sep 2007, Maciej W. Rozycki wrote:

Eeee ... at least I wouldn't prefer that. Why not simply use the
"int x = x;" trick (which is what uninitialized_var() does) -- it shuts
up the warning, and does *nothing* else. The bug will not be hidden, if
there's bad misbehaviour happening due to the bug, it will continue to
happen that way -- thus bringing our attention to it. Pre-initializing
to -EINVAL (or whatever) has the problem that when the bug actually
triggers, something unrelated might happen higher up the callchain, and
we'd be scratching our heads in a "why are we getting a -EINVAL here?"
kind of way ... worse still, we might think that this was _really_ an
EINVAL and go about debugging it ...

Plus, pre-initializing to -EINVAL (or even 0) will waste some bytes in
kernel text size, but no such overhead with uninitialized_var() :-)


Satyam
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Maciej W. Rozycki, (Mon Sep 17, 12:45 pm)
Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Maciej W. Rozycki, (Tue Sep 18, 8:18 am)
Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Maciej W. Rozycki, (Thu Sep 20, 8:52 am)
Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Maciej W. Rozycki, (Thu Sep 20, 10:04 am)
Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Satyam Sharma, (Thu Sep 20, 10:24 am)
Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics, Martin Michlmayr, (Thu Sep 20, 2:16 am)