Don't pass error value pointer to g_read_data(9) at all if we don't

have any use of it.

Suggested by:	pjd
This commit is contained in:
Maxim Sobolev 2005-11-30 22:15:00 +00:00
parent 14edf864f1
commit b53a1cf306
13 changed files with 24 additions and 25 deletions

View File

@ -299,7 +299,7 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
break;
sectorsize = cp->provider->sectorsize;
mediasize = cp->provider->mediasize;
buf = g_read_data(cp, 0, sectorsize, &error);
buf = g_read_data(cp, 0, sectorsize, NULL);
if (buf == NULL) {
break;
}

View File

@ -145,7 +145,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
{
struct g_geom *gp;
struct g_consumer *cp;
int error, i;
int i;
struct g_apple_softc *ms;
struct apm_partition *apm;
u_int sectorsize;
@ -165,7 +165,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (sectorsize != 512)
break;
buf = g_read_data(cp, 0, sectorsize, &error);
buf = g_read_data(cp, 0, sectorsize, NULL);
if (buf == NULL)
break;
@ -187,7 +187,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
/*
* Read in the first partition map
*/
buf = g_read_data(cp, sectorsize, sectorsize, &error);
buf = g_read_data(cp, sectorsize, sectorsize, NULL);
if (buf == NULL)
break;
@ -205,7 +205,7 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
ms->am_mapcnt0 = apm->am_mapcnt;
buf = g_read_data(cp, 2 * sectorsize,
(NAPMPART - 1) * sectorsize, &error);
(NAPMPART - 1) * sectorsize, NULL);
if (buf == NULL)
break;

View File

@ -204,9 +204,8 @@ g_bsd_try(struct g_geom *gp, struct g_slicer *gsp, struct g_consumer *cp, int se
* We need to read entire aligned sectors, and we assume that the
* disklabel does not span sectors, so one sector is enough.
*/
error = 0;
secoff = offset % secsize;
buf = g_read_data(cp, offset - secoff, secsize, &error);
buf = g_read_data(cp, offset - secoff, secsize, NULL);
if (buf == NULL)
return (ENOENT);

View File

@ -371,7 +371,7 @@ g_fox_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
do {
sectorsize = cp->provider->sectorsize;
g_topology_unlock();
buf = g_read_data(cp, 0, sectorsize, &error);
buf = g_read_data(cp, 0, sectorsize, NULL);
g_topology_lock();
if (buf == NULL)
break;

View File

@ -283,7 +283,7 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (sectorsize < 512)
break;
ms->sectorsize = sectorsize;
buf = g_read_data(cp, 0, sectorsize, &error);
buf = g_read_data(cp, 0, sectorsize, NULL);
if (buf == NULL)
break;
@ -453,7 +453,7 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
if (sectorsize != 512)
break;
for (;;) {
buf = g_read_data(cp, off, sectorsize, &error);
buf = g_read_data(cp, off, sectorsize, NULL);
if (buf == NULL)
break;
if (buf[0x1fe] != 0x55 && buf[0x1ff] != 0xaa) {

View File

@ -288,7 +288,7 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
sectorsize = cp->provider->sectorsize;
if (sectorsize % 512 != 0)
break;
buf = g_read_data(cp, 0, 8192, &error);
buf = g_read_data(cp, 0, 8192, NULL);
if (buf == NULL)
break;
ms->fwsectors = fwsectors;

View File

@ -276,7 +276,7 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags)
if (ms->sectorsize < 512)
break;
g_topology_unlock();
buf = g_read_data(cp, 0, ms->sectorsize, &error);
buf = g_read_data(cp, 0, ms->sectorsize, NULL);
g_topology_lock();
if (buf == NULL)
break;

View File

@ -62,7 +62,7 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags)
struct g_geom *gp;
struct g_consumer *cp;
struct g_vol_ffs_softc *ms;
int error, sb, superblock;
int sb, superblock;
struct fs *fs;
g_trace(G_T_TOPOLOGY, "vol_taste(%s,%s)", mp->name, pp->name);
@ -99,7 +99,7 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags)
continue;
fs = (struct fs *) g_read_data(cp, superblock,
SBLOCKSIZE, &error);
SBLOCKSIZE, NULL);
if (fs == NULL)
continue;
/* Check for magic and make sure things are the right size */

View File

@ -47,7 +47,7 @@ g_label_iso9660_taste(struct g_consumer *cp, char *label, size_t size)
{
struct g_provider *pp;
char *sector, *volume;
int i, error;
int i;
g_topology_assert_not();
pp = cp->provider;
@ -56,7 +56,7 @@ g_label_iso9660_taste(struct g_consumer *cp, char *label, size_t size)
if ((ISO9660_OFFSET % pp->sectorsize) != 0)
return;
sector = (char *)g_read_data(cp, ISO9660_OFFSET, pp->sectorsize,
&error);
NULL);
if (sector == NULL)
return;
if (bcmp(sector, ISO9660_MAGIC, sizeof(ISO9660_MAGIC) - 1) != 0) {

View File

@ -49,13 +49,13 @@ g_label_msdosfs_taste(struct g_consumer *cp, char *label, size_t size)
{
struct g_provider *pp;
char *sector, *volume;
int i, error;
int i;
g_topology_assert_not();
pp = cp->provider;
label[0] = '\0';
sector = (char *)g_read_data(cp, 0, pp->sectorsize, &error);
sector = (char *)g_read_data(cp, 0, pp->sectorsize, NULL);
if (sector == NULL)
return;
if (strncmp(sector + 0x36, FAT12, strlen(FAT12)) == 0) {

View File

@ -46,7 +46,7 @@ static void
g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size)
{
struct g_provider *pp;
int error, sb, superblock;
int sb, superblock;
struct fs *fs;
g_topology_assert_not();
@ -71,7 +71,7 @@ g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size)
continue;
fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE,
&error);
NULL);
if (fs == NULL)
continue;
/* Check for magic and make sure things are the right size */

View File

@ -379,7 +379,7 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags)
*/
DPRINTF(("%s: media sectorsize %u, mediasize %lld\n",
gp->name, pp->sectorsize, pp->mediasize));
buf = g_read_data(cp, 0, pp->sectorsize, &error);
buf = g_read_data(cp, 0, pp->sectorsize, NULL);
if (buf == NULL)
goto err;
header = (struct cloop_header *) buf;
@ -429,7 +429,7 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags)
free(buf, M_GEOM);
buf = g_read_data(
cp, blk * pp->sectorsize, pp->sectorsize, &error);
cp, blk * pp->sectorsize, pp->sectorsize, NULL);
if (buf == NULL)
goto err;
nread = MIN(total_offsets - offsets_read,

View File

@ -452,7 +452,7 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
/* Now check if the provided slice is a valid vinum drive. */
do {
vhdr = g_read_data(cp, GV_HDR_OFFSET, pp->sectorsize, &error);
vhdr = g_read_data(cp, GV_HDR_OFFSET, pp->sectorsize, NULL);
if (vhdr == NULL)
break;
if (vhdr->magic != GV_MAGIC) {
@ -461,8 +461,8 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
}
/* A valid vinum drive, let's parse the on-disk information. */
buf = g_read_data(cp, GV_CFG_OFFSET, GV_CFG_LEN, &error);
if (buf == NULL || error != 0) {
buf = g_read_data(cp, GV_CFG_OFFSET, GV_CFG_LEN, NULL);
if (buf == NULL) {
g_free(vhdr);
break;
}