Skip to content

Commit ff05a6e

Browse files
mingqiangchilijinxia
authored andcommitted
hv:Remove dead code in console.c
Remove this API console_dump_bytes Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent a661ffa commit ff05a6e

File tree

2 files changed

+1
-47
lines changed

2 files changed

+1
-47
lines changed

hypervisor/debug/console.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -135,38 +135,6 @@ int console_write(const char *s, size_t len)
135135
return res;
136136
}
137137

138-
void console_dump_bytes(const void *p, unsigned int len)
139-
{
140-
141-
const unsigned char *x = p;
142-
const unsigned char *e = x + len;
143-
int i;
144-
145-
/* dump all bytes */
146-
while (x < e) {
147-
/* write the address of the first byte in the row */
148-
printf("%08x: ", (uint64_t) x);
149-
/* print one row (16 bytes) as hexadecimal values */
150-
for (i = 0; i < 16; i++) {
151-
printf("%02x ", x[i]);
152-
}
153-
154-
/* print one row as ASCII characters (if possible) */
155-
for (i = 0; i < 16; i++) {
156-
if ((x[i] < ' ') || (x[i] >= 127)) {
157-
(void)console_putc('.');
158-
}
159-
else {
160-
(void)console_putc(x[i]);
161-
}
162-
}
163-
/* continue with next row */
164-
(void)console_putc('\n');
165-
/* set pointer one row ahead */
166-
x += 16;
167-
}
168-
}
169-
170138
static void console_read(void)
171139
{
172140
spinlock_obtain(&lock);

hypervisor/include/debug/console.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ int console_write(const char *str, size_t len);
4747

4848
int console_putc(int ch);
4949

50-
/** Dumps an array to the console.
51-
*
52-
* This function dumps an array of bytes to the console
53-
* in a hexadecimal format.
54-
*
55-
* @param p A pointer to the byte array to dump.
56-
* @param len The number of bytes to dump.
57-
*/
58-
59-
void console_dump_bytes(const void *p, unsigned int len);
60-
6150
void console_setup_timer(void);
6251

6352
uint32_t get_serial_handle(void);
@@ -89,10 +78,7 @@ static inline int console_putc(__unused int ch)
8978
{
9079
return 0;
9180
}
92-
static inline void console_dump_bytes(__unused const void *p,
93-
__unused unsigned int len)
94-
{
95-
}
81+
9682
static inline void console_setup_timer(void) {}
9783
static inline uint32_t get_serial_handle(void) { return 0; }
9884

0 commit comments

Comments
 (0)