Subject: Re: make kernel warnings: wd.c - 940206
To: None <current-users@sun-lamp.cs.berkeley.edu, tmc@netcom.com>
From: Lennart Augustsson <augustss@cs.chalmers.se>
List: current-users
Date: 02/08/1994 01:38:01
> When making new kernel these were the only warnings: 
I've sent a fix for the wd warnings once, but it was ignored (or
just stored away :-)  Here it is again.  Could someone apply it?
It fixes the compiler warnings and introduces a define for a
numeric constant.

	-- Lennart


*** /sys/arch/i386/isa/wd.c.orig	Mon Feb  7 11:13:27 1994
--- /sys/arch/i386/isa/wd.c	Tue Feb  8 01:18:59 1994
***************
*** 84,89 ****
--- 84,93 ----
  #endif
  #define WDCDELAY	25
  
+ #ifndef WDTIMEOUT
+ #define WDTIMEOUT	50
+ #endif
+ 
  /* if you enable this, it will report any delays more than 25us * N long */
  /*#define WDCNDELAY_DEBUG	6 */
  
***************
*** 246,252 ****
  	bzero(&rwdbuf[lunit], sizeof(struct buf));
  	wdxfer[lunit] = 0;
  	wdtimeoutstatus[lunit] = 0;
! 	wdtimeout(lunit);
  	du->dk_ctrlr = dvp->id_masunit;
  	du->dk_unit = unit;
  	du->dk_lunit = lunit;
--- 250,256 ----
  	bzero(&rwdbuf[lunit], sizeof(struct buf));
  	wdxfer[lunit] = 0;
  	wdtimeoutstatus[lunit] = 0;
! 	wdtimeout((caddr_t)lunit);
  	du->dk_ctrlr = dvp->id_masunit;
  	du->dk_unit = unit;
  	du->dk_lunit = lunit;
***************
*** 395,401 ****
  	struct disklabel *lp;
  	struct buf *dp;
  	long	blknum, cylin, head, sector;
! 	long	secpertrk, secpercyl, addr, timeout;
  	int	lunit, wdc;
  	int xfrblknum;
  	unsigned char status;
--- 399,406 ----
  	struct disklabel *lp;
  	struct buf *dp;
  	long	blknum, cylin, head, sector;
! 	long	secpertrk, secpercyl, timeout;
! 	caddr_t	addr;
  	int	lunit, wdc;
  	int xfrblknum;
  	unsigned char status;
***************
*** 434,440 ****
  	else
  		printf(" %d)%x", du->dk_skip, inb(du->dk_port+wd_altsts));
  #endif
! 	addr = (int) bp->b_un.b_addr;
  	if (du->dk_skip == 0) {
  		du->dk_bc = bp->b_bcount;
  	}
--- 439,445 ----
  	else
  		printf(" %d)%x", du->dk_skip, inb(du->dk_port+wd_altsts));
  #endif
! 	addr = bp->b_un.b_addr;
  	if (du->dk_skip == 0) {
  		du->dk_bc = bp->b_bcount;
  	}
***************
*** 740,746 ****
  
  		/* suck in data */
  		insw (wdc+wd_data,
! 			(int)bp->b_un.b_addr + du->dk_skip * DEV_BSIZE, chk);
  		du->dk_bc -= chk * sizeof(short);
  		du->dk_bct -= chk * sizeof(short);
  	
--- 745,751 ----
  
  		/* suck in data */
  		insw (wdc+wd_data,
! 			bp->b_un.b_addr + du->dk_skip * DEV_BSIZE, chk);
  		du->dk_bc -= chk * sizeof(short);
  		du->dk_bct -= chk * sizeof(short);
  	
***************
*** 890,896 ****
  		}
  #else
  		if (msg = readdisklabel(makewddev(major(dev), wdunit(dev), WDRAW),
! 		    wdstrategy, &du->dk_dd, &du->dk_cpd) ) {
  			if((du->dk_flags & DKFL_QUIET) == 0) {
  				log(LOG_WARNING, "wd%d: cannot find label (%s)\n",
  					lunit, msg);
--- 895,901 ----
  		}
  #else
  		if (msg = readdisklabel(makewddev(major(dev), wdunit(dev), WDRAW),
! 		    (void (*)())wdstrategy, &du->dk_dd, &du->dk_cpd) ) {
  			if((du->dk_flags & DKFL_QUIET) == 0) {
  				log(LOG_WARNING, "wd%d: cannot find label (%s)\n",
  					lunit, msg);
***************
*** 1362,1368 ****
  			du->dk_openpart |= (1 << 0);	    /* XXX */
  			wlab = du->dk_wlabel;
  			du->dk_wlabel = 1;
! 			error = writedisklabel(dev, wdstrategy, &du->dk_dd, &du->dk_cpd);
  			du->dk_openpart = du->dk_copenpart | du->dk_bopenpart;
  			du->dk_wlabel = wlab;
  		}
--- 1367,1373 ----
  			du->dk_openpart |= (1 << 0);	    /* XXX */
  			wlab = du->dk_wlabel;
  			du->dk_wlabel = 1;
! 			error = writedisklabel(dev, (void (*)())wdstrategy, &du->dk_dd, &du->dk_cpd);
  			du->dk_openpart = du->dk_copenpart | du->dk_bopenpart;
  			du->dk_wlabel = wlab;
  		}
***************
*** 1777,1783 ****
  			wdstart(du->dk_ctrlr);		/* start controller */
  		}
  	}
! 	timeout((timeout_t)wdtimeout, (caddr_t)unit, 50);
  	splx(x);
  	return (0);
  }
--- 1782,1788 ----
  			wdstart(du->dk_ctrlr);		/* start controller */
  		}
  	}
! 	timeout((timeout_t)wdtimeout, (caddr_t)unit, WDTIMEOUT);
  	splx(x);
  	return (0);
  }

------------------------------------------------------------------------------