Add gcc-uninit branch
This commit is contained in:
parent
34dc7c2f25
commit
22083501be
|
@ -0,0 +1,8 @@
|
|||
From: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Subject: [PATCH] gcc warning uninitialized variable
|
||||
|
||||
Gcc -Wall warn: 'uninitialized variable'
|
||||
|
||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
|
||||
---
|
|
@ -130,7 +130,7 @@ compress(void *s_start, void *d_start, size_t s_len)
|
|||
{
|
||||
uchar_t *src = s_start;
|
||||
uchar_t *dst = d_start;
|
||||
uchar_t *cpy, *copymap;
|
||||
uchar_t *cpy, *copymap = NULL;
|
||||
int copymask = 1 << (NBBY - 1);
|
||||
int mlen, offset;
|
||||
uint16_t *hp;
|
||||
|
@ -181,7 +181,7 @@ decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
|
|||
uchar_t *dst = d_start;
|
||||
uchar_t *s_end = (uchar_t *)s_start + s_len;
|
||||
uchar_t *d_end = (uchar_t *)d_start + d_len;
|
||||
uchar_t *cpy, copymap;
|
||||
uchar_t *cpy, copymap = 0;
|
||||
int copymask = 1 << (NBBY - 1);
|
||||
|
||||
if (s_len >= d_len) {
|
||||
|
|
|
@ -1048,7 +1048,7 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms,
|
|||
nvlist_t *perms_nvp = NULL;
|
||||
nvlist_t *sets_nvp = NULL;
|
||||
char errbuf[1024];
|
||||
char *who_tok, *perm;
|
||||
char *who_tok = NULL, *perm;
|
||||
int error;
|
||||
|
||||
*nvp = NULL;
|
||||
|
@ -3523,7 +3523,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
|
|||
int err;
|
||||
zfs_cmd_t zc = { 0 };
|
||||
boolean_t restore_resv = 0;
|
||||
uint64_t old_volsize, new_volsize;
|
||||
uint64_t old_volsize = 0, new_volsize;
|
||||
zfs_prop_t resv_prop;
|
||||
|
||||
assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM ||
|
||||
|
@ -3774,6 +3774,7 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
|
|||
"child dataset with inherited mountpoint is used "
|
||||
"in a non-global zone"));
|
||||
(void) zfs_error(hdl, EZFS_ZONED, errbuf);
|
||||
ret = -1;
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
@ -2393,7 +2393,7 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_t *bp, arc_byteswap_func_t *swap,
|
|||
uint32_t *arc_flags, zbookmark_t *zb)
|
||||
{
|
||||
arc_buf_hdr_t *hdr;
|
||||
arc_buf_t *buf;
|
||||
arc_buf_t *buf = NULL;
|
||||
kmutex_t *hash_lock;
|
||||
zio_t *rzio;
|
||||
|
||||
|
@ -2767,7 +2767,7 @@ arc_release(arc_buf_t *buf, void *tag)
|
|||
arc_buf_hdr_t *hdr = buf->b_hdr;
|
||||
kmutex_t *hash_lock = HDR_LOCK(hdr);
|
||||
l2arc_buf_hdr_t *l2hdr = NULL;
|
||||
uint64_t buf_size;
|
||||
uint64_t buf_size = 0;
|
||||
|
||||
/* this buffer is not on any list */
|
||||
ASSERT(refcount_count(&hdr->b_refcnt) > 0);
|
||||
|
@ -3683,7 +3683,7 @@ l2arc_read_done(zio_t *zio)
|
|||
static list_t *
|
||||
l2arc_list_locked(int list_num, kmutex_t **lock)
|
||||
{
|
||||
list_t *list;
|
||||
list_t *list = NULL;
|
||||
|
||||
ASSERT(list_num >= 0 && list_num <= 3);
|
||||
|
||||
|
@ -3860,10 +3860,11 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev)
|
|||
uint64_t target_sz = dev->l2ad_write;
|
||||
uint64_t headroom = dev->l2ad_write * l2arc_headroom;
|
||||
void *buf_data;
|
||||
kmutex_t *hash_lock, *list_lock;
|
||||
kmutex_t *hash_lock, *list_lock = NULL;
|
||||
boolean_t have_lock, full;
|
||||
l2arc_write_callback_t *cb;
|
||||
zio_t *pio, *wzio;
|
||||
int try;
|
||||
|
||||
ASSERT(MUTEX_HELD(&l2arc_dev_mtx));
|
||||
ASSERT(dev->l2ad_vdev != NULL);
|
||||
|
|
|
@ -345,7 +345,7 @@ dsl_dataset_open_obj(dsl_pool_t *dp, uint64_t dsobj, const char *snapname,
|
|||
return (err);
|
||||
ds = dmu_buf_get_user(dbuf);
|
||||
if (ds == NULL) {
|
||||
dsl_dataset_t *winner;
|
||||
dsl_dataset_t *winner = NULL;
|
||||
|
||||
ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP);
|
||||
ds->ds_dbuf = dbuf;
|
||||
|
|
|
@ -51,7 +51,7 @@ lzjb_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
|
|||
{
|
||||
uchar_t *src = s_start;
|
||||
uchar_t *dst = d_start;
|
||||
uchar_t *cpy, *copymap;
|
||||
uchar_t *cpy, *copymap = NULL;
|
||||
int copymask = 1 << (NBBY - 1);
|
||||
int mlen, offset;
|
||||
uint16_t *hp;
|
||||
|
@ -104,7 +104,7 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
|
|||
uchar_t *src = s_start;
|
||||
uchar_t *dst = d_start;
|
||||
uchar_t *d_end = (uchar_t *)d_start + d_len;
|
||||
uchar_t *cpy, copymap;
|
||||
uchar_t *cpy, copymap = 0;
|
||||
int copymask = 1 << (NBBY - 1);
|
||||
|
||||
while (dst < d_end) {
|
||||
|
|
|
@ -113,7 +113,7 @@ refcount_count(refcount_t *rc)
|
|||
int64_t
|
||||
refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
|
||||
{
|
||||
reference_t *ref;
|
||||
reference_t *ref = NULL;
|
||||
int64_t count;
|
||||
|
||||
if (reference_tracking_enable) {
|
||||
|
|
|
@ -272,7 +272,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
|
|||
{
|
||||
nvpair_t *elem;
|
||||
int error = 0, reset_bootfs = 0;
|
||||
uint64_t objnum;
|
||||
uint64_t objnum = 0;
|
||||
|
||||
elem = NULL;
|
||||
while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
|
||||
|
@ -800,7 +800,7 @@ spa_load_l2cache(spa_t *spa)
|
|||
uint_t nl2cache;
|
||||
int i, j, oldnvdevs;
|
||||
uint64_t guid;
|
||||
vdev_t *vd, **oldvdevs, **newvdevs;
|
||||
vdev_t *vd, **oldvdevs, **newvdevs = NULL;
|
||||
spa_aux_vdev_t *sav = &spa->spa_l2cache;
|
||||
|
||||
if (sav->sav_config != NULL) {
|
||||
|
@ -2827,7 +2827,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, int replace_done)
|
|||
vdev_t *rvd = spa->spa_root_vdev;
|
||||
vdev_t *vd, *pvd, *cvd, *tvd;
|
||||
boolean_t unspare = B_FALSE;
|
||||
uint64_t unspare_guid;
|
||||
uint64_t unspare_guid = 0;
|
||||
|
||||
txg = spa_vdev_enter(spa);
|
||||
|
||||
|
|
|
@ -789,7 +789,7 @@ vdev_raidz_io_done(zio_t *zio)
|
|||
vdev_t *vd = zio->io_vd;
|
||||
vdev_t *cvd;
|
||||
raidz_map_t *rm = zio->io_vsd;
|
||||
raidz_col_t *rc, *rc1;
|
||||
raidz_col_t *rc = NULL, *rc1;
|
||||
int unexpected_errors = 0;
|
||||
int parity_errors = 0;
|
||||
int parity_untried = 0;
|
||||
|
|
|
@ -220,7 +220,7 @@ zap_leaf_array_create(zap_leaf_t *l, const char *buf,
|
|||
uint16_t chunk_head;
|
||||
uint16_t *chunkp = &chunk_head;
|
||||
int byten = 0;
|
||||
uint64_t value;
|
||||
uint64_t value = 0;
|
||||
int shift = (integer_size-1)*8;
|
||||
int len = num_integers;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout)
|
|||
{
|
||||
caddr_t end;
|
||||
caddr_t ptr;
|
||||
zfs_ace_t *zacep;
|
||||
zfs_ace_t *zacep = NULL;
|
||||
ace_t *acep;
|
||||
uint16_t entry_type;
|
||||
size_t entry_size;
|
||||
|
|
Loading…
Reference in New Issue