diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2016-01-03 21:40:49 +0100 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2016-01-03 21:40:49 +0100 |
commit | 85326f25746ea8a64d6c815ccda41ac238ba0184 (patch) | |
tree | 02732cece920fc83ca309d33abf568026b08af0b | |
parent | 4ee048a089d787b7f3d784927d8dd7ee7b2f0183 (diff) | |
download | memtool-85326f25746ea8a64d6c815ccda41ac238ba0184.tar.gz memtool-85326f25746ea8a64d6c815ccda41ac238ba0184.tar.xz |
Rename parameter to memory_display that specifies the width to "width"
In the function calling memory_display (i.e. cmd_memory_display) the name
"size" is used for the length of the memory chunk to display. So switch to
the better name "width".
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | memtool.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -129,7 +129,7 @@ static int parse_area_spec(const char *str, unsigned long long *start, (((uint16_t)(x) & (uint16_t)0xff00U) >> 8))) static int memory_display(const void *addr, unsigned long long offs, - unsigned nbytes, int size, int swab) + unsigned nbytes, int width, int swab) { ulong linebytes, i; u_char *cp; @@ -150,20 +150,20 @@ static int memory_display(const void *addr, unsigned long long offs, printf("%08llx:", offs); linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes; - for (i = 0; i < linebytes; i += size) { - if (size == 8) { + for (i = 0; i < linebytes; i += width) { + if (width == 8) { uint64_t res; res = (*uqp++ = *((uint64_t *)addr)); if (swab) res = swab64(res); count -= printf(" %016" PRIx64, res); - } else if (size == 4) { + } else if (width == 4) { uint32_t res; res = (*uip++ = *((uint *)addr)); if (swab) res = swab32(res); count -= printf(" %08" PRIx32, res); - } else if (size == 2) { + } else if (width == 2) { uint16_t res; res = (*usp++ = *((ushort *)addr)); if (swab) @@ -172,8 +172,8 @@ static int memory_display(const void *addr, unsigned long long offs, } else { count -= printf(" %02x", (*ucp++ = *((u_char *)addr))); } - addr += size; - offs += size; + addr += width; + offs += width; } while (count--) |