Re: Working towards 2.2.0: Cosmetics..

Guest section DW (dwguest@win.tue.nl)
Fri, 8 Jan 1999 01:21:28 +0100 (MET)


From alan@lxorguk.ukuu.org.uk Thu Jan 7 23:06:44 1999

> int e8390_base = dev->base_addr;
> +#ifdef EI_LOCAL_NEEDED_FOR_EI_SHIFT
> struct ei_device *ei_local = (struct ei_device *) dev->priv;
> +#endif
>
> outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD);

Linus has an opinion about such ifdefs. All those you submit to him vanish
mysteriously.

Alan

Possibly. Maybe he wants to comment.
I think having a warning-free source is valuable.

Right now I get twenty warnings, two of which indicate serious bugs
and 18 are just unimportant gcc mutterings that can be ignored.
When you drop the goal of having a warning-free source then
gcc warnings lose much of their value.

The above change is meaningful also in a different way.
Most everyone who compiles this code gets this warning.
Many people will investigate the cause.
The above adds information. It says: "this variable ei_local, that
you do not see in this function, and that gcc says is unused, is used
implicitly under the conditions that define EI_LOCAL_NEEDED_FOR_EI_SHIFT".
And it saves people's time.

Andries

[1] Now that I think of it, the nonsense patch, mostly cosmetic, that I
sent you some days ago, also fixes two bugs that still occur in pre5.
Probably almost all of it still applies.

[2] Note that the above kind of #ifdef is not the kind of #ifdef that
makes code unreadable. There is no #else part, there is no flow of
control, it reads like a comment. And it is a comment, both to the
human reader and to gcc.

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