Commit ae616e1b authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: fix warnings

drivers/mtd/ubi/cdev.c: In function ‘vol_cdev_read’:
drivers/mtd/ubi/cdev.c:187: warning: unused variable ‘vol_id’
CC [M]  drivers/mtd/ubi/kapi.o
drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_erase’:
drivers/mtd/ubi/kapi.c:483: warning: unused variable ‘vol_id’
drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_unmap’:
drivers/mtd/ubi/kapi.c:544: warning: unused variable ‘vol_id’
drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_map’:
drivers/mtd/ubi/kapi.c:582: warning: unused variable ‘vol_id’
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent b9a06623
...@@ -184,13 +184,13 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, ...@@ -184,13 +184,13 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count,
struct ubi_volume_desc *desc = file->private_data; struct ubi_volume_desc *desc = file->private_data;
struct ubi_volume *vol = desc->vol; struct ubi_volume *vol = desc->vol;
struct ubi_device *ubi = vol->ubi; struct ubi_device *ubi = vol->ubi;
int err, lnum, off, len, vol_id = desc->vol->vol_id, tbuf_size; int err, lnum, off, len, tbuf_size;
size_t count_save = count; size_t count_save = count;
void *tbuf; void *tbuf;
uint64_t tmp; uint64_t tmp;
dbg_msg("read %zd bytes from offset %lld of volume %d", dbg_msg("read %zd bytes from offset %lld of volume %d",
count, *offp, vol_id); count, *offp, vol->vol_id);
if (vol->updating) { if (vol->updating) {
dbg_err("updating"); dbg_err("updating");
...@@ -204,7 +204,7 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, ...@@ -204,7 +204,7 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count,
return 0; return 0;
if (vol->corrupted) if (vol->corrupted)
dbg_msg("read from corrupted volume %d", vol_id); dbg_msg("read from corrupted volume %d", vol->vol_id);
if (*offp + count > vol->used_bytes) if (*offp + count > vol->used_bytes)
count_save = count = vol->used_bytes - *offp; count_save = count = vol->used_bytes - *offp;
...@@ -268,13 +268,13 @@ static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf, ...@@ -268,13 +268,13 @@ static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf,
struct ubi_volume_desc *desc = file->private_data; struct ubi_volume_desc *desc = file->private_data;
struct ubi_volume *vol = desc->vol; struct ubi_volume *vol = desc->vol;
struct ubi_device *ubi = vol->ubi; struct ubi_device *ubi = vol->ubi;
int lnum, off, len, tbuf_size, vol_id = vol->vol_id, err = 0; int lnum, off, len, tbuf_size, err = 0;
size_t count_save = count; size_t count_save = count;
char *tbuf; char *tbuf;
uint64_t tmp; uint64_t tmp;
dbg_msg("requested: write %zd bytes to offset %lld of volume %u", dbg_msg("requested: write %zd bytes to offset %lld of volume %u",
count, *offp, desc->vol->vol_id); count, *offp, vol->vol_id);
if (vol->vol_type == UBI_STATIC_VOLUME) if (vol->vol_type == UBI_STATIC_VOLUME)
return -EROFS; return -EROFS;
......
...@@ -480,9 +480,9 @@ int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum) ...@@ -480,9 +480,9 @@ int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum)
{ {
struct ubi_volume *vol = desc->vol; struct ubi_volume *vol = desc->vol;
struct ubi_device *ubi = vol->ubi; struct ubi_device *ubi = vol->ubi;
int err, vol_id = vol->vol_id; int err;
dbg_msg("erase LEB %d:%d", vol_id, lnum); dbg_msg("erase LEB %d:%d", vol->vol_id, lnum);
if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
return -EROFS; return -EROFS;
...@@ -541,9 +541,8 @@ int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum) ...@@ -541,9 +541,8 @@ int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum)
{ {
struct ubi_volume *vol = desc->vol; struct ubi_volume *vol = desc->vol;
struct ubi_device *ubi = vol->ubi; struct ubi_device *ubi = vol->ubi;
int vol_id = vol->vol_id;
dbg_msg("unmap LEB %d:%d", vol_id, lnum); dbg_msg("unmap LEB %d:%d", vol->vol_id, lnum);
if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
return -EROFS; return -EROFS;
...@@ -579,9 +578,8 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype) ...@@ -579,9 +578,8 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype)
{ {
struct ubi_volume *vol = desc->vol; struct ubi_volume *vol = desc->vol;
struct ubi_device *ubi = vol->ubi; struct ubi_device *ubi = vol->ubi;
int vol_id = vol->vol_id;
dbg_msg("unmap LEB %d:%d", vol_id, lnum); dbg_msg("unmap LEB %d:%d", vol->vol_id, lnum);
if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
return -EROFS; return -EROFS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment