Remove a handful of unused variables
cover Remove a handful of unused variables
From: Colin Ian King <[email protected]>
Just a small set of changes to tidy up the code by removing unused variables or variables that are set and never used.
Colin Ian King (5):
fs/jfs.c: remove unused pos from grub_jfs_read_file() fs/minix.c: remove unused grub_minix_sblock from grub_minix_dir() fs/sfs.c: remove unused prev from grub_sfs_read_extent() fs/ufs.c: remove unused sblock from grub_ufs_dir() disk/lvm.c: remove da_offset, da_size from grub_lvm_scan_device()
disk/lvm.c | 4 +--- fs/jfs.c | 3 --- fs/minix.c | 3 --- fs/sfs.c | 3 --- fs/ufs.c | 3 --- 5 files changed, 1 insertion(+), 15 deletions(-)
Signature · 1 line
1.8.0
PATCH 1/5 fs/jfs.c: remove unused pos from grub_jfs_read_file()
From: Colin Ian King <[email protected]>
Remove the unused pos variable from grub_jfs_read_file().
--- fs/jfs.c | 3 --- 1 file changed, 3 deletions(-)
fs/jfs.c +0 -3
@@ -600,7 +600,6 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)char fpath[grub_strlen (path)];char *name = fpath;char *next; -unsigned int pos =0 ;struct grub_jfs_diropen *diro;grub_strncpy (fpath, path,grub_strlen (path) +1 );
@@ -663,8 +662,6 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)if (!next)return 0 ; - pos =0 ; - name = next; next =grub_strchr (name,'/' );if (next)
Signature · 1 line
1.8.0
PATCH 2/5 fs/minix.c: remove unused grub_minix_sblock from grub_minix_dir()
In reply to Colin KingFrom: Colin Ian King <[email protected]>
Remove the unused grub_minix_sblock variable from grub_minix_dir()
--- fs/minix.c | 3 --- 1 file changed, 3 deletions(-)
fs/minix.c +0 -3
@@ -463,7 +463,6 @@ grub_minix_dir (grub_device_t device, const char *path, const struct grub_dirhook_info *info)) {struct grub_minix_data *data =0 ; -struct grub_minix_sblock *sblock;unsigned int pos =0 ; data =grub_minix_mount (device->disk);
@@ -474,8 +473,6 @@ grub_minix_dir (grub_device_t device, const char *path,if (grub_errno) goto fail; - sblock = &data->sblock; -grub_minix_find_file (data, path);if (grub_errno) goto fail;
Signature · 1 line
1.8.0
PATCH 3/5 fs/sfs.c: remove unused prev from grub_sfs_read_extent()
In reply to Colin KingFrom: Colin Ian King <[email protected]>
Remove unused variable prev from grub_sfs_read_extent()
--- fs/sfs.c | 3 --- 1 file changed, 3 deletions(-)
fs/sfs.c +0 -3
@@ -149,7 +149,6 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,struct grub_sfs_btree *tree;int i;int next; -int prev; treeblock =grub_malloc (data->blocksize);if (!block)
@@ -161,8 +160,6 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,/* Handle this level in the btree. */ do { - prev = 0; - grub_disk_read (data->disk, next, 0, data->blocksize, treeblock); if (grub_errno) {
Signature · 1 line
1.8.0
PATCH 4/5 fs/ufs.c: remove unused sblock from grub_ufs_dir()
In reply to Colin KingFrom: Colin Ian King <[email protected]>
Removed unused variable sblock from grub_ufs_dir()
--- fs/ufs.c | 3 --- 1 file changed, 3 deletions(-)
fs/ufs.c +0 -3
@@ -568,7 +568,6 @@ grub_ufs_dir (grub_device_t device, const char *path, const struct grub_dirhook_info *info)) {struct grub_ufs_data *data; -struct grub_ufs_sblock *sblock;unsigned int pos =0 ; data =grub_ufs_mount (device->disk);
@@ -579,8 +578,6 @@ grub_ufs_dir (grub_device_t device, const char *path,if (grub_errno)return grub_errno; - sblock = &data->sblock; -if (!path || path[0 ] !='/' ) {grub_error (GRUB_ERR_BAD_FILENAME ,"bad filename" );
Signature · 1 line
1.8.0
PATCH 5/5 disk/lvm.c: remove da_offset, da_size from grub_lvm_scan_device()
In reply to Colin KingFrom: Colin Ian King <[email protected]>
Removed variables da_offset, da_size from grub_lvm_scan_device(), these are being set but never used.
--- disk/lvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
disk/lvm.c +1 -3
@@ -207,7 +207,7 @@ grub_lvm_scan_device (const char *name) {grub_err_t err;grub_disk_t disk; -grub_uint64_t da_offset, da_size, mda_offset, mda_size; +grub_uint64_t mda_offset, mda_size;char buf[GRUB_LVM_LABEL_SIZE ];char vg_id[GRUB_LVM_ID_STRLEN +1 ];char pv_id[GRUB_LVM_ID_STRLEN +1 ];
@@ -254,8 +254,6 @@ grub_lvm_scan_device (const char *name) pv_id[j] ='\0' ; dlocn = pvh->disk_areas_xl; - da_offset =grub_le_to_cpu64 (dlocn->offset); - da_size =grub_le_to_cpu64 (dlocn->size); dlocn++;/* Is it possible to have multiple data/metadata areas? I haven't
Signature · 1 line
1.8.0
Quoted 5 lines · Colin King
From: Colin Ian King <[email protected]>
Just a small set of changes to tidy up the code by removing unused variables or variables that are set and never used.
It doesn't look like you use current bzr trunk
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko