Skip to content

Commit

Permalink
UBI: rename few functions for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Artem Bityutskiy committed May 20, 2012
1 parent e298682 commit 97d6104
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
5 changes: 2 additions & 3 deletions drivers/mtd/ubi/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
void ubi_dump_sv(const struct ubi_scan_volume *sv);
void ubi_dump_seb(const struct ubi_scan_leb *seb, int type);
void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req);
int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len);
int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
int offset, int len);
int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
int len);
int ubi_debugging_init_dev(struct ubi_device *ubi);
void ubi_debugging_exit_dev(struct ubi_device *ubi);
int ubi_debugfs_init(void);
Expand Down
20 changes: 11 additions & 9 deletions drivers/mtd/ubi/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ static int self_check_ec_hdr(const struct ubi_device *ubi, int pnum,
static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum);
static int self_check_vid_hdr(const struct ubi_device *ubi, int pnum,
const struct ubi_vid_hdr *vid_hdr);
static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
int offset, int len);

/**
* ubi_io_read - read data from a physical eraseblock.
Expand Down Expand Up @@ -254,7 +256,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
return err;

/* The area we are writing to has to contain all 0xFF bytes */
err = ubi_dbg_check_all_ff(ubi, pnum, offset, len);
err = ubi_self_check_all_ff(ubi, pnum, offset, len);
if (err)
return err;

Expand Down Expand Up @@ -289,7 +291,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
ubi_assert(written == len);

if (!err) {
err = ubi_dbg_check_write(ubi, buf, pnum, offset, len);
err = self_check_write(ubi, buf, pnum, offset, len);
if (err)
return err;

Expand All @@ -300,7 +302,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
offset += len;
len = ubi->peb_size - offset;
if (len)
err = ubi_dbg_check_all_ff(ubi, pnum, offset, len);
err = ubi_self_check_all_ff(ubi, pnum, offset, len);
}

return err;
Expand Down Expand Up @@ -382,7 +384,7 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum)
return -EIO;
}

err = ubi_dbg_check_all_ff(ubi, pnum, 0, ubi->peb_size);
err = ubi_self_check_all_ff(ubi, pnum, 0, ubi->peb_size);
if (err)
return err;

Expand Down Expand Up @@ -1316,7 +1318,7 @@ static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
}

/**
* ubi_dbg_check_write - make sure write succeeded.
* self_check_write - make sure write succeeded.
* @ubi: UBI device description object
* @buf: buffer with data which were written
* @pnum: physical eraseblock number the data were written to
Expand All @@ -1327,8 +1329,8 @@ static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
* the original data buffer - the data have to match. Returns zero if the data
* match and a negative error code if not or in case of failure.
*/
int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
int offset, int len)
static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
int offset, int len)
{
int err, i;
size_t read;
Expand Down Expand Up @@ -1382,7 +1384,7 @@ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
}

/**
* ubi_dbg_check_all_ff - check that a region of flash is empty.
* ubi_self_check_all_ff - check that a region of flash is empty.
* @ubi: UBI device description object
* @pnum: the physical eraseblock number to check
* @offset: the starting offset within the physical eraseblock to check
Expand All @@ -1392,7 +1394,7 @@ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
* @offset of the physical eraseblock @pnum, and a negative error code if not
* or if an error occurred.
*/
int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
{
size_t read;
int err;
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/ubi/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ int ubi_wl_get_peb(struct ubi_device *ubi)
prot_queue_add(ubi, e);
spin_unlock(&ubi->wl_lock);

err = ubi_dbg_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
ubi->peb_size - ubi->vid_hdr_aloffset);
err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
ubi->peb_size - ubi->vid_hdr_aloffset);
if (err) {
ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum);
return err;
Expand Down

0 comments on commit 97d6104

Please sign in to comment.