Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ef6075fb
Commit
ef6075fb
authored
Aug 07, 2007
by
Artem Bityutskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UBI: use linux print_hex_dump(), not home-grown one
Signed-off-by:
Artem Bityutskiy
<
Artem.Bityutskiy@nokia.com
>
parent
0169b49d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
38 deletions
+3
-38
drivers/mtd/ubi/debug.c
drivers/mtd/ubi/debug.c
+2
-35
drivers/mtd/ubi/debug.h
drivers/mtd/ubi/debug.h
+0
-2
drivers/mtd/ubi/io.c
drivers/mtd/ubi/io.c
+1
-1
No files found.
drivers/mtd/ubi/debug.c
View file @
ef6075fb
...
@@ -42,7 +42,8 @@ void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
...
@@ -42,7 +42,8 @@ void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
dbg_msg
(
"data_offset %d"
,
be32_to_cpu
(
ec_hdr
->
data_offset
));
dbg_msg
(
"data_offset %d"
,
be32_to_cpu
(
ec_hdr
->
data_offset
));
dbg_msg
(
"hdr_crc %#08x"
,
be32_to_cpu
(
ec_hdr
->
hdr_crc
));
dbg_msg
(
"hdr_crc %#08x"
,
be32_to_cpu
(
ec_hdr
->
hdr_crc
));
dbg_msg
(
"erase counter header hexdump:"
);
dbg_msg
(
"erase counter header hexdump:"
);
ubi_dbg_hexdump
(
ec_hdr
,
UBI_EC_HDR_SIZE
);
print_hex_dump
(
KERN_DEBUG
,
""
,
DUMP_PREFIX_OFFSET
,
32
,
4
,
(
void
*
)
ec_hdr
,
UBI_EC_HDR_SIZE
,
1
);
}
}
/**
/**
...
@@ -187,38 +188,4 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req)
...
@@ -187,38 +188,4 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req)
dbg_msg
(
"the 1st 16 characters of the name: %s"
,
nm
);
dbg_msg
(
"the 1st 16 characters of the name: %s"
,
nm
);
}
}
#define BYTES_PER_LINE 32
/**
* ubi_dbg_hexdump - dump a buffer.
* @ptr: the buffer to dump
* @size: buffer size which must be multiple of 4 bytes
*/
void
ubi_dbg_hexdump
(
const
void
*
ptr
,
int
size
)
{
int
i
,
k
=
0
,
rows
,
columns
;
const
uint8_t
*
p
=
ptr
;
size
=
ALIGN
(
size
,
4
);
rows
=
size
/
BYTES_PER_LINE
+
size
%
BYTES_PER_LINE
;
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
int
j
;
cond_resched
();
columns
=
min
(
size
-
k
,
BYTES_PER_LINE
)
/
4
;
if
(
columns
==
0
)
break
;
printk
(
KERN_DEBUG
"%5d: "
,
i
*
BYTES_PER_LINE
);
for
(
j
=
0
;
j
<
columns
;
j
++
)
{
int
n
,
N
;
N
=
size
-
k
>
4
?
4
:
size
-
k
;
for
(
n
=
0
;
n
<
N
;
n
++
)
printk
(
"%02x"
,
p
[
k
++
]);
printk
(
" "
);
}
printk
(
"
\n
"
);
}
}
#endif
/* CONFIG_MTD_UBI_DEBUG_MSG */
#endif
/* CONFIG_MTD_UBI_DEBUG_MSG */
drivers/mtd/ubi/debug.h
View file @
ef6075fb
...
@@ -59,7 +59,6 @@ void ubi_dbg_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
...
@@ -59,7 +59,6 @@ void ubi_dbg_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
void
ubi_dbg_dump_sv
(
const
struct
ubi_scan_volume
*
sv
);
void
ubi_dbg_dump_sv
(
const
struct
ubi_scan_volume
*
sv
);
void
ubi_dbg_dump_seb
(
const
struct
ubi_scan_leb
*
seb
,
int
type
);
void
ubi_dbg_dump_seb
(
const
struct
ubi_scan_leb
*
seb
,
int
type
);
void
ubi_dbg_dump_mkvol_req
(
const
struct
ubi_mkvol_req
*
req
);
void
ubi_dbg_dump_mkvol_req
(
const
struct
ubi_mkvol_req
*
req
);
void
ubi_dbg_hexdump
(
const
void
*
buf
,
int
size
);
#else
#else
...
@@ -72,7 +71,6 @@ void ubi_dbg_hexdump(const void *buf, int size);
...
@@ -72,7 +71,6 @@ void ubi_dbg_hexdump(const void *buf, int size);
#define ubi_dbg_dump_sv(sv) ({})
#define ubi_dbg_dump_sv(sv) ({})
#define ubi_dbg_dump_seb(seb, type) ({})
#define ubi_dbg_dump_seb(seb, type) ({})
#define ubi_dbg_dump_mkvol_req(req) ({})
#define ubi_dbg_dump_mkvol_req(req) ({})
#define ubi_dbg_hexdump(buf, size) ({})
#endif
/* CONFIG_MTD_UBI_DEBUG_MSG */
#endif
/* CONFIG_MTD_UBI_DEBUG_MSG */
...
...
drivers/mtd/ubi/io.c
View file @
ef6075fb
...
@@ -1252,7 +1252,7 @@ static int paranoid_check_all_ff(const struct ubi_device *ubi, int pnum,
...
@@ -1252,7 +1252,7 @@ static int paranoid_check_all_ff(const struct ubi_device *ubi, int pnum,
fail:
fail:
ubi_err
(
"paranoid check failed for PEB %d"
,
pnum
);
ubi_err
(
"paranoid check failed for PEB %d"
,
pnum
);
dbg_msg
(
"hex dump of the %d-%d region"
,
offset
,
offset
+
len
);
dbg_msg
(
"hex dump of the %d-%d region"
,
offset
,
offset
+
len
);
ubi_dbg_hexdump
(
buf
,
len
);
print_hex_dump
(
KERN_DEBUG
,
""
,
DUMP_PREFIX_OFFSET
,
32
,
4
,
buf
,
len
,
1
);
err
=
1
;
err
=
1
;
error:
error:
ubi_dbg_dump_stack
();
ubi_dbg_dump_stack
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment