{
struct fdisk_partition *pa;
struct fdisk_label *lb;
- struct fdisk_iter *itr = NULL;
+ struct fdisk_iter *itr;
struct libscols_table *table = NULL;
struct libscols_iter *s_itr = NULL;
char *res = NULL;
*/
char *blkid_devno_to_devname(dev_t devno)
{
- char *path = NULL;
+ char *path;
char buf[PATH_MAX];
path = sysfs_devno_to_devpath(devno, buf, sizeof(buf));
*/
blkid_probe blkid_new_probe_from_filename(const char *filename)
{
- int fd = -1;
+ int fd;
blkid_probe pr = NULL;
fd = open(filename, O_RDONLY|O_CLOEXEC);
static int gpt_write_pmbr(struct fdisk_context *cxt)
{
off_t offset;
- struct gpt_legacy_mbr *pmbr = NULL;
+ struct gpt_legacy_mbr *pmbr;
assert(cxt);
assert(cxt->firstsector);
{
char *devname = argv[1], *scriptname = argv[2];
struct fdisk_context *cxt;
- struct fdisk_script *dp = NULL;
+ struct fdisk_script *dp;
struct fdisk_table *tb = NULL;
struct fdisk_iter *itr = NULL;
struct fdisk_partition *pa = NULL;
{
int iocret;
int fd;
- DIR *dirstream = NULL;
+ DIR *dirstream;
struct btrfs_ioctl_search_args args;
struct btrfs_ioctl_search_key *sk = &args.key;
struct btrfs_ioctl_search_header *sh;
static char *canonicalize_path_and_cache(const char *path,
struct libmnt_cache *cache)
{
- char *p = NULL;
- char *key = NULL;
- char *value = NULL;
+ char *p;
+ char *key;
+ char *value;
DBG(CACHE, ul_debugobj(cache, "canonicalize path %s", path));
p = canonicalize_path(path);
int direction)
{
struct libmnt_fs *fs = NULL;
- const char *src = NULL, *tgt = NULL;
+ const char *src, *tgt;
int rc;
assert(cxt);
*/
if (u_flags & (MNT_MS_USER | MNT_MS_OWNER | MNT_MS_GROUP)) {
- char *curr_user = NULL;
+ char *curr_user;
char *mtab_user = NULL;
size_t sz;
size_t strsz = strlen(*str);
size_t possz = strlen(pos);
size_t posoff;
- char *p = NULL;
+ char *p;
int sep;
/* is it necessary to prepend '=' before the substring ? */
static int test_diff(struct libmnt_test *ts, int argc, char *argv[])
{
- struct libmnt_table *tb_old = NULL, *tb_new = NULL;
- struct libmnt_tabdiff *diff = NULL;
+ struct libmnt_table *tb_old, *tb_new;
+ struct libmnt_tabdiff *diff;
struct libmnt_iter *itr;
struct libmnt_fs *old, *new;
int rc = -1, change;
unsigned long mountflags)
{
int rc = 0;
- const char *o = NULL, *a = NULL;
+ const char *o, *a;
char *u = NULL;
assert(fs);
size_t sum = 0;
while (data && *data) {
- const char *p = data;
+ const char *p;
size_t sz;
p = strchr(data, '\n');
int verify_table(struct libmnt_table *tb)
{
struct verify_context vfy = { .nerrors = 0 };
- struct libmnt_iter *itr = NULL;
+ struct libmnt_iter *itr;
int rc = 0; /* overall return code (alloc errors, etc.) */
int check_order = is_listall_mode();
static int has_read_fs = 0;
static int tab_is_tree(struct libmnt_table *tb)
{
struct libmnt_fs *fs = NULL;
- struct libmnt_iter *itr = NULL;
+ struct libmnt_iter *itr;
int rc = 0;
itr = mnt_new_iter(MNT_ITER_BACKWARD);
static int tab_is_kernel(struct libmnt_table *tb)
{
struct libmnt_fs *fs = NULL;
- struct libmnt_iter *itr = NULL;
+ struct libmnt_iter *itr;
itr = mnt_new_iter(MNT_ITER_BACKWARD);
if (!itr)
static int add_matching_lines(struct libmnt_table *tb,
struct libscols_table *table, int direction)
{
- struct libmnt_iter *itr = NULL;
+ struct libmnt_iter *itr;
struct libmnt_fs *fs;
int nlines = 0, rc = -1;
FILE *f = NULL;
int rc = -1;
struct libmnt_iter *itr = NULL;
- struct libmnt_table *tb_new = NULL;
+ struct libmnt_table *tb_new;
struct libmnt_tabdiff *diff = NULL;
struct pollfd fds[1];
uint64_t x;
dev_t dev = 0;
ino_t ino = 0;
- char *fname = NULL;
+ char *fname;
uint32_t type;
fname = loopcxt_get_backing_file(lc);
static int swapon_checks(const struct swapon_ctl *ctl, struct swap_device *dev)
{
struct stat st;
- int fd = -1, sig;
+ int fd, sig;
char *hdr = NULL;
unsigned long long devsize = 0;
int permMask;