[PATCH 04/23] scripts: imx-usb-loader: Make readonly arguments const

Sascha Hauer s.hauer at pengutronix.de
Fri Jan 29 02:43:44 PST 2016


The buffers passed to dump_long and dump_bytes are not (and shouldn't
be) modified. Make the arguments const.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 scripts/imx/imx-usb-loader.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 94b3763..afe24d1 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -187,9 +187,10 @@ static libusb_device *find_imx_dev(libusb_device **devs, struct mach_id **pp_id)
 	return NULL;
 }
 
-static void dump_long(unsigned char *src, unsigned cnt, unsigned addr)
+static void dump_long(const void *src, unsigned cnt, unsigned addr)
 {
-	unsigned *p = (unsigned *)src;
+	const unsigned *p = (unsigned *)src;
+
 	while (cnt >= 32) {
 		printf("%08x: %08x %08x %08x %08x  %08x %08x %08x %08x\n",
 				addr, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
@@ -208,9 +209,9 @@ static void dump_long(unsigned char *src, unsigned cnt, unsigned addr)
 	}
 }
 
-static void dump_bytes(unsigned char *src, unsigned cnt, unsigned addr)
+static void dump_bytes(const void *src, unsigned cnt, unsigned addr)
 {
-	unsigned char *p = src;
+	const unsigned char *p = src;
 	int i;
 
 	while (cnt >= 16) {
-- 
2.7.0.rc3




More information about the barebox mailing list