- Remove unused old disk pointers from Write_FreeBSD() and Fill_Disklabel()
functions. - Clean up a few signed/unsigned warnings.
This commit is contained in:
parent
1094a736ea
commit
95e750632e
@ -20,7 +20,7 @@
|
||||
#define MAX_SEC_SIZE 2048 /* maximum sector size that is supported */
|
||||
#define MIN_SEC_SIZE 512 /* the sector size to end sensing at */
|
||||
|
||||
const static enum platform {
|
||||
static const enum platform {
|
||||
p_any, /* for debugging ! */
|
||||
p_alpha,
|
||||
p_i386,
|
||||
@ -276,7 +276,7 @@ ShowChunkFlags(struct chunk *);
|
||||
|
||||
struct disklabel;
|
||||
void Fill_Disklabel(struct disklabel *, const struct disk *,
|
||||
const struct disk *, const struct chunk *);
|
||||
const struct chunk *);
|
||||
void Debug_Chunk(struct chunk *);
|
||||
void Free_Chunk(struct chunk *);
|
||||
struct chunk *Clone_Chunk(const struct chunk *);
|
||||
|
@ -60,7 +60,7 @@ Write_Disk(const struct disk *d1)
|
||||
memcpy(buf + 512, d1->boot1, BBSIZE - 512);
|
||||
|
||||
dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
|
||||
Fill_Disklabel(dl, d1, NULL, c1);
|
||||
Fill_Disklabel(dl, d1, c1);
|
||||
|
||||
/*
|
||||
* Tell SRM where the bootstrap is.
|
||||
|
@ -28,8 +28,7 @@ __FBSDID("$FreeBSD$");
|
||||
* I'm not sure which, so I leave it like it worked before. --schweikh
|
||||
*/
|
||||
static int
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
const struct chunk *c1)
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct chunk *c1)
|
||||
{
|
||||
struct disklabel *dl;
|
||||
int i;
|
||||
@ -48,7 +47,7 @@ Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
memcpy(buf + 512, new->boot2, BBSIZE - 512);
|
||||
|
||||
dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
|
||||
Fill_Disklabel(dl, new, old, c1);
|
||||
Fill_Disklabel(dl, new, c1);
|
||||
|
||||
for (i = 0; i < BBSIZE / 512; i++)
|
||||
write_block(fd, i + c1->offset, buf + 512 * i, 512);
|
||||
@ -85,8 +84,8 @@ Cfg_Boot_Mgr(u_char *mbr, int edd)
|
||||
int
|
||||
Write_Disk(const struct disk *d1)
|
||||
{
|
||||
int fd, i, j;
|
||||
struct disk *old = 0;
|
||||
int fd, j;
|
||||
uint i;
|
||||
struct chunk *c1;
|
||||
int ret = 0;
|
||||
char device[64];
|
||||
@ -118,7 +117,7 @@ Write_Disk(const struct disk *d1)
|
||||
continue;
|
||||
s[j]++;
|
||||
if (c1->type == freebsd)
|
||||
ret += Write_FreeBSD(fd, d1, old, c1);
|
||||
ret += Write_FreeBSD(fd, d1, c1);
|
||||
|
||||
Write_Int32(&dp[j].dp_start, c1->offset);
|
||||
Write_Int32(&dp[j].dp_size, c1->size);
|
||||
|
@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
void
|
||||
Fill_Disklabel(struct disklabel *dl, const struct disk *new,
|
||||
const struct disk *old, const struct chunk *c1)
|
||||
const struct chunk *c1)
|
||||
{
|
||||
struct chunk *c2;
|
||||
int j;
|
||||
|
@ -28,8 +28,7 @@ __FBSDID("$FreeBSD$");
|
||||
* I'm not sure which, so I leave it like it worked before. --schweikh
|
||||
*/
|
||||
static int
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
const struct chunk *c1)
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct chunk *c1)
|
||||
{
|
||||
struct disklabel *dl;
|
||||
int i;
|
||||
@ -48,7 +47,7 @@ Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
memcpy(buf + 512, new->boot2, BBSIZE - 512);
|
||||
|
||||
dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
|
||||
Fill_Disklabel(dl, new, old, c1);
|
||||
Fill_Disklabel(dl, new, c1);
|
||||
|
||||
for (i = 0; i < BBSIZE / 512; i++)
|
||||
write_block(fd, i + c1->offset, buf + 512 * i, 512);
|
||||
@ -85,8 +84,8 @@ Cfg_Boot_Mgr(u_char *mbr, int edd)
|
||||
int
|
||||
Write_Disk(const struct disk *d1)
|
||||
{
|
||||
int fd, i, j;
|
||||
struct disk *old = 0;
|
||||
int fd, j;
|
||||
uint i;
|
||||
struct chunk *c1;
|
||||
int ret = 0;
|
||||
char device[64];
|
||||
@ -118,7 +117,7 @@ Write_Disk(const struct disk *d1)
|
||||
continue;
|
||||
s[j]++;
|
||||
if (c1->type == freebsd)
|
||||
ret += Write_FreeBSD(fd, d1, old, c1);
|
||||
ret += Write_FreeBSD(fd, d1, c1);
|
||||
|
||||
Write_Int32(&dp[j].dp_start, c1->offset);
|
||||
Write_Int32(&dp[j].dp_size, c1->size);
|
||||
|
@ -44,7 +44,7 @@ Write_FreeBSD(int fd, const struct disk *new, const struct chunk *c1)
|
||||
}
|
||||
|
||||
dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
|
||||
Fill_Disklabel(dl, new, NULL, c1);
|
||||
Fill_Disklabel(dl, new, c1);
|
||||
|
||||
for (i = 0; i < BBSIZE / 512; i++) {
|
||||
if (write_block(fd, i + c1->offset, buf + 512 * i, 512) != 0)
|
||||
|
@ -30,8 +30,7 @@ __FBSDID("$FreeBSD$");
|
||||
* I'm not sure which, so I leave it like it worked before. --schweikh
|
||||
*/
|
||||
static int
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
const struct chunk *c1)
|
||||
Write_FreeBSD(int fd, const struct disk *new, const struct chunk *c1)
|
||||
{
|
||||
struct disklabel *dl;
|
||||
int i;
|
||||
@ -50,7 +49,7 @@ Write_FreeBSD(int fd, const struct disk *new, const struct disk *old,
|
||||
memcpy(buf + 512, new->boot2, BBSIZE - 512);
|
||||
|
||||
dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
|
||||
Fill_Disklabel(dl, new, old, c1);
|
||||
Fill_Disklabel(dl, new, c1);
|
||||
|
||||
for (i = 0; i < BBSIZE / 512; i++)
|
||||
write_block(fd, i + c1->offset, buf + 512 * i, 512);
|
||||
@ -105,7 +104,7 @@ Write_Disk(const struct disk *d1)
|
||||
continue;
|
||||
s[j]++;
|
||||
if (c1->type == freebsd)
|
||||
ret += Write_FreeBSD(fd, d1, old, c1);
|
||||
ret += Write_FreeBSD(fd, d1, c1);
|
||||
|
||||
i = c1->offset;
|
||||
dp[j].dp_ssect = dp[j].dp_ipl_sct = i % d1->bios_sect;
|
||||
|
Loading…
Reference in New Issue
Block a user