Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 1995 22:03:12 -0800
From:      PVinci@ix.netcom.com (Paul Vinciguerra)
To:        hackers@FreeBSD.org
Subject:   suggestions/questions for WD.C
Message-ID:  <199503230603.WAA03573@ix2.ix.netcom.com>

next in thread | raw e-mail | index | archive | help
in wd.c, 

	static int wdcommand(struct disk *du, u_int clyinder, u_int 
			head, u_int sector, u_int count, u_int command);

Can't this be reduced to:

	static int wdcommand(struct disk *du, u_int command);

because blknum is derived from du and cyl,head,sector are translated 
before each call.  Wouldn't this be cleaner?

in wdcommand:
if LBAmode {
	LBA Translation }
else	
	{
	CHS Translation }

This seems to be much cleaner to me...

(I'd be glad to submit the changes, if someone would tell me how to 
submit them via e-mail or ftp. I assume I DL WD.C in -current --make 
changes and UL modified WD.C to WHO??)


also, repeatedly, int wdc is locally defined over and over again as 
du->dk_port.  Isn't it nore efficient to replace this with a 
#define WDC du->dk_port??  In my scanning the code WDC is really a 
constant, so isn't it better to resolve it at compile time?   

Does any of this matter, or am I thinking too hard?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503230603.WAA03573>