2002-10-19 01:00:16

by Frank Davis

[permalink] [raw]
Subject: [PATCH] 2.5.43 : drivers/block/xd.c

Hello all,
The following fixes a 'used but not declared' compile error. Please review
for inclusion.

Regards,
Frank

--- linux/drivers/block/xd.c.old Fri Oct 18 20:51:44 2002
+++ linux/drivers/block/xd.c Fri Oct 18 20:54:02 2002
@@ -150,6 +150,7 @@
static int __init xd_init(void)
{
u_char i,controller;
+ u_char count = 0;
unsigned int address;
int err;




2002-10-21 07:59:56

by Daniel Egger

[permalink] [raw]
Subject: Re: [PATCH] 2.5.43 : drivers/block/xd.c

Am Sam, 2002-10-19 um 02.58 schrieb Frank Davis:

> Hello all,
> The following fixes a 'used but not declared' compile error. Please review
> for inclusion.

The "standard" way of achieving the same would be to assign the variable
to itself. In your fragment the compiler will initialise the variable to
zero which will cost at least one instruction and thus "bloat" the code,
it'll also be slower due to an additional instruction and may schedule
worse. Not that it mattered much in this case but if you can save a byte
or two... :)

--
Servus,
Daniel


Attachments:
signature.asc (189.00 B)
Dies ist ein digital signierter Nachrichtenteil