Remove trailing spaces.
This commit is contained in:
parent
bacc083333
commit
600b956be0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofdev.c,v 1.4 2004/06/30 15:43:57 christos Exp $ */
|
||||
/* $NetBSD: ofdev.c,v 1.5 2005/06/22 16:35:58 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
|
@ -56,9 +56,9 @@ extern char bootdev[];
|
|||
|
||||
#ifdef DEBUG
|
||||
# define DPRINTF printf
|
||||
#else
|
||||
#else
|
||||
# define DPRINTF while (0) printf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static char *
|
||||
filename(char *str, char *ppart)
|
||||
|
@ -67,7 +67,7 @@ filename(char *str, char *ppart)
|
|||
char savec;
|
||||
int dhandle;
|
||||
char devtype[16];
|
||||
|
||||
|
||||
lp = str;
|
||||
devtype[0] = 0;
|
||||
*ppart = 0;
|
||||
|
@ -108,14 +108,14 @@ strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf,
|
|||
struct of_dev *dev = devdata;
|
||||
u_quad_t pos;
|
||||
int n;
|
||||
|
||||
|
||||
if (rw != F_READ)
|
||||
return EPERM;
|
||||
if (dev->type != OFDEV_DISK)
|
||||
panic("strategy");
|
||||
|
||||
|
||||
pos = (u_quad_t)(blk + dev->partoff) * dev->bsize;
|
||||
|
||||
|
||||
for (;;) {
|
||||
if (OF_seek(dev->handle, pos) < 0)
|
||||
break;
|
||||
|
@ -134,7 +134,7 @@ static int
|
|||
devclose(struct open_file *of)
|
||||
{
|
||||
struct of_dev *op = of->f_devdata;
|
||||
|
||||
|
||||
if (op->type == OFDEV_NET)
|
||||
net_close(op);
|
||||
OF_close(op->handle);
|
||||
|
@ -184,7 +184,7 @@ static u_long
|
|||
get_long(const void *p)
|
||||
{
|
||||
const unsigned char *cp = p;
|
||||
|
||||
|
||||
return cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24);
|
||||
}
|
||||
|
||||
|
@ -200,11 +200,11 @@ search_label(struct of_dev *devp, u_long off, char *buf, struct disklabel *lp,
|
|||
int i;
|
||||
u_long poff;
|
||||
static int recursion;
|
||||
|
||||
|
||||
if (strategy(devp, F_READ, off, DEV_BSIZE, buf, &nread)
|
||||
|| nread != DEV_BSIZE)
|
||||
return ERDLAB;
|
||||
|
||||
|
||||
if (*(u_int16_t *)&buf[MBR_MAGIC_OFFSET] != sa_htole16(MBR_MAGIC))
|
||||
return ERDLAB;
|
||||
|
||||
|
@ -329,7 +329,7 @@ devopen(struct open_file *of, const char *name, char **file)
|
|||
part = partition ? partition - 'a' : 0;
|
||||
ofdev.partoff = label.d_partitions[part].p_offset;
|
||||
}
|
||||
|
||||
|
||||
of->f_dev = devsw;
|
||||
of->f_devdata = &ofdev;
|
||||
file_system[0] = file_system_ufs;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofdev.c,v 1.6 2004/11/13 08:13:58 grant Exp $ */
|
||||
/* $NetBSD: ofdev.c,v 1.7 2005/06/22 16:38:18 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
|
@ -70,7 +70,7 @@ filename(str, ppart)
|
|||
char savec;
|
||||
int dhandle;
|
||||
char devtype[16];
|
||||
|
||||
|
||||
lp = str;
|
||||
devtype[0] = 0;
|
||||
*ppart = 0;
|
||||
|
@ -138,20 +138,20 @@ strategy(devdata, rw, blk, size, buf, rsize)
|
|||
struct of_dev *dev = devdata;
|
||||
u_quad_t pos;
|
||||
int n;
|
||||
|
||||
|
||||
if (rw != F_READ)
|
||||
return EPERM;
|
||||
if (dev->type != OFDEV_DISK)
|
||||
panic("strategy");
|
||||
|
||||
|
||||
#ifdef NON_DEBUG
|
||||
printf("strategy: block %lx, partition offset %lx, blksz %lx\n",
|
||||
printf("strategy: block %lx, partition offset %lx, blksz %lx\n",
|
||||
(long)blk, (long)dev->partoff, (long)dev->bsize);
|
||||
printf("strategy: seek position should be: %lx\n",
|
||||
printf("strategy: seek position should be: %lx\n",
|
||||
(long)((blk + dev->partoff) * dev->bsize));
|
||||
#endif
|
||||
pos = (u_quad_t)(blk + dev->partoff) * dev->bsize;
|
||||
|
||||
|
||||
for (;;) {
|
||||
#ifdef NON_DEBUG
|
||||
printf("strategy: seeking to %lx\n", (long)pos);
|
||||
|
@ -178,7 +178,7 @@ devclose(of)
|
|||
{
|
||||
struct of_dev *op = of->f_devdata;
|
||||
|
||||
#ifdef NETBOOT
|
||||
#ifdef NETBOOT
|
||||
if (op->type == OFDEV_NET)
|
||||
net_close(op);
|
||||
#endif
|
||||
|
@ -227,7 +227,7 @@ get_long(p)
|
|||
const void *p;
|
||||
{
|
||||
const unsigned char *cp = p;
|
||||
|
||||
|
||||
return cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24);
|
||||
}
|
||||
/************************************************************************
|
||||
|
@ -354,7 +354,7 @@ search_label(devp, off, buf, lp, off0)
|
|||
struct disklabel *dlp;
|
||||
struct sun_disklabel *slp;
|
||||
int error;
|
||||
|
||||
|
||||
/* minimal requirements for archtypal disk label */
|
||||
if (lp->d_secperunit == 0)
|
||||
lp->d_secperunit = 0x1fffffff;
|
||||
|
@ -479,7 +479,7 @@ devopen(of, name, file)
|
|||
if (errmsg) printf("devopen: getdisklabel returned %s\n", errmsg);
|
||||
/* Else try MBR partitions */
|
||||
errmsg = search_label(&ofdev, 0, buf, &label, 0);
|
||||
if (errmsg) {
|
||||
if (errmsg) {
|
||||
printf("devopen: search_label returned %s\n", errmsg);
|
||||
error = ERDLAB;
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ devopen(of, name, file)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
of->f_dev = devsw;
|
||||
of->f_devdata = &ofdev;
|
||||
#ifdef SPARC_BOOT_UFS
|
||||
|
|
Loading…
Reference in New Issue