[PATCH] src: use namespace prefix osmo_* for crc16 functions

Pablo Neira Ayuso pablo at gnumonks.org
Sun May 15 12:45:08 UTC 2011


Summary of changes:

s/crc16_table/osmo_crc16_table/g
s/crc16/osmo_crc16/g
s/crc16_byte/osmo_crc16_byte/g
---
 src/host/osmocon/osmoload.c                |    8 ++++----
 src/target/firmware/apps/loader/main.c     |    6 +++---
 src/target/firmware/apps/loader_mtk/main.c |    6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/host/osmocon/osmoload.c b/src/host/osmocon/osmoload.c
index 5848e56..8a0b21c 100644
--- a/src/host/osmocon/osmoload.c
+++ b/src/host/osmocon/osmoload.c
@@ -575,7 +575,7 @@ loader_start_memput(uint8_t length, uint32_t address, void *data) {
 	struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
 	msgb_put_u8(msg, LOADER_MEM_WRITE);
 	msgb_put_u8(msg, length);
-	msgb_put_u16(msg, crc16(0, data, length));
+	msgb_put_u16(msg, osmo_crc16(0, data, length));
 	msgb_put_u32(msg, address);
 	memcpy(msgb_put(msg, length), data, length);
 	loader_send_request(msg);
@@ -603,7 +603,7 @@ loader_do_memdump(uint16_t crc, void *data, size_t length) {
 	int rc;
 
 	if(data && length) {
-		osmoload.memcrc = crc16(0, data, length);
+		osmoload.memcrc = osmo_crc16(0, data, length);
 		if(osmoload.memcrc != crc) {
 			osmoload.memoff -= osmoload.memreq;
 			printf("\nbad crc %4.4x (not %4.4x) at offset 0x%8.8x", crc, osmoload.memcrc, osmoload.memoff);
@@ -665,7 +665,7 @@ loader_do_memload() {
 
 	uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
 
-	osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
+	osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
 	osmoload.memreq = reqbytes;
 
 	struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
@@ -705,7 +705,7 @@ loader_do_fprogram() {
 
 	uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
 
-	osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
+	osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
 	osmoload.memreq = reqbytes;
 
 	struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c
index a948934..2ff6f9c 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -253,7 +253,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 		nbytes = msgb_get_u8(msg);
 		address = msgb_get_u32(msg);
 
-		crc = crc16(0, (void *)address, nbytes);
+		crc = osmo_crc16(0, (void *)address, nbytes);
 
 		msgb_put_u8(reply, LOADER_MEM_READ);
 		msgb_put_u8(reply, nbytes);
@@ -274,7 +274,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 
 		data = msgb_get(msg, nbytes);
 
-		mycrc = crc16(0, data, nbytes);
+		mycrc = osmo_crc16(0, data, nbytes);
 
 		if (mycrc == crc) {
 			memcpy((void *)address, data, nbytes);
@@ -392,7 +392,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 
 		data = msgb_get(msg, nbytes);
 
-		mycrc = crc16(0, data, nbytes);
+		mycrc = osmo_crc16(0, data, nbytes);
 
 		if (mycrc == crc) {
 			res = flash_program(&the_flash, address, data, nbytes);
diff --git a/src/target/firmware/apps/loader_mtk/main.c b/src/target/firmware/apps/loader_mtk/main.c
index 899d765..9bfaa7e 100644
--- a/src/target/firmware/apps/loader_mtk/main.c
+++ b/src/target/firmware/apps/loader_mtk/main.c
@@ -194,7 +194,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 		nbytes = msgb_get_u8(msg);
 		address = msgb_get_u32(msg);
 
-		crc = crc16(0, (void *)address, nbytes);
+		crc = osmo_crc16(0, (void *)address, nbytes);
 
 		msgb_put_u8(reply, LOADER_MEM_READ);
 		msgb_put_u8(reply, nbytes);
@@ -215,7 +215,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 
 		data = msgb_get(msg, nbytes);
 
-		mycrc = crc16(0, data, nbytes);
+		mycrc = osmo_crc16(0, data, nbytes);
 
 		if (mycrc == crc) {
 			memcpy((void *)address, data, nbytes);
@@ -333,7 +333,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
 
 		data = msgb_get(msg, nbytes);
 
-		mycrc = crc16(0, data, nbytes);
+		mycrc = osmo_crc16(0, data, nbytes);
 
 		if (mycrc == crc) {
 			res = flash_program(&the_flash, address, data, nbytes);
-- 
1.7.2.5


--------------090200050301070809080105--




More information about the baseband-devel mailing list