Skip to contentSkip to conversation

declance: Remove `incompatible pointer type' warnings

PATCH Applied Maciej W. Rozycki 3 participants 6 messages Sep 19, 2013 – Sep 29, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 declance: Remove `incompatible pointer type' warnings

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7:

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type .../declance.c:348: warning: assignment from incompatible pointer type .../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type .../declance.c:407: warning: assignment from incompatible pointer type

Also add a `const' qualifier where applicable and adjust formatting.

---
linux-declance-cast-fix.patch

drivers/net/ethernet/amd/declance.c +8 -8
Index: linux-mips-3.12.0-rc1-20130917-4maxp/drivers/net/ethernet/amd/declance.c
===================================================================
@@ -344,8 +344,8 @@ static void cp_to_buf(const int type, vo
 		}
 
 		clen = len & 1;
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -372,8 +372,8 @@ static void cp_to_buf(const int type, vo
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -403,8 +403,8 @@ static void cp_from_buf(const int type, 
 
 		clen = len & 1;
 
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 
 		while (clen--) {
 			*rtp++ = *rfp++;
@@ -433,8 +433,8 @@ static void cp_from_buf(const int type, 
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
maintainer Applied
#1 lore raw

From: "Maciej W. Rozycki" <[email protected]>
Date: Fri, 20 Sep 2013 00:49:44 +0100 (BST)

Quoted 9 lines

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7:

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type .../declance.c:348: warning: assignment from incompatible pointer type .../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type .../declance.c:407: warning: assignment from incompatible pointer type

Quoted 3 lines

Also add a `const' qualifier where applicable and adjust formatting.

Applied to net-next

#2 lore raw

PATCH v2 1/1 declance: Remove `incompatible pointer type' warnings

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7 [drivers/net: Remove casts of void *]:

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type .../declance.c:348: warning: assignment from incompatible pointer type .../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type .../declance.c:407: warning: assignment from incompatible pointer type

Also add a `const' qualifier where applicable and adjust formatting.

---

Quoted 1 line

Applied to net-next

Thanks, by Sergei's request please use this version instead that has the
reference to the original commit updated (no change to the patch itself).

Maciej

linux-declance-cast-fix.patch

drivers/net/ethernet/amd/declance.c +8 -8
Index: linux-mips-3.12.0-rc1-20130917-4maxp/drivers/net/ethernet/amd/declance.c
===================================================================
@@ -344,8 +344,8 @@ static void cp_to_buf(const int type, vo
 		}
 
 		clen = len & 1;
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -372,8 +372,8 @@ static void cp_to_buf(const int type, vo
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -403,8 +403,8 @@ static void cp_from_buf(const int type, 
 
 		clen = len & 1;
 
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 
 		while (clen--) {
 			*rtp++ = *rfp++;
@@ -433,8 +433,8 @@ static void cp_from_buf(const int type, 
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
maintainer
#3 lore raw

From: "Maciej W. Rozycki" <[email protected]>
Date: Sun, 22 Sep 2013 21:19:01 +0100 (BST)

Quoted 10 lines

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7 [drivers/net: Remove casts of void *]:

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type .../declance.c:348: warning: assignment from incompatible pointer type .../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type .../declance.c:407: warning: assignment from incompatible pointer type

Quoted 8 lines

Also add a `const' qualifier where applicable and adjust formatting.

---

Quoted 1 line

Applied to net-next

Thanks, by Sergei's request please use this version instead that has the
reference to the original commit updated (no change to the patch itself).

I can't undo the original commit once it has been installed in my tree.

#4 lore raw
Quoted 4 lines · David Miller
Quoted 2 lines

Thanks, by Sergei's request please use this version instead that has the
reference to the original commit updated (no change to the patch itself).

I can't undo the original commit once it has been installed in my tree.

No worries, and good to know, thanks.

Maciej

#5 lore raw
In reply to Maciej W. Rozycki

Hello.

Quoted 1 line · Maciej W. Rozycki

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7:

Please also specify that commit's summary in parens. That's the only way
to uniquely identify a commit and makes life a bit easier when you browse the commits.

Quoted 10 lines

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type .../declance.c:348: warning: assignment from incompatible pointer type .../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type .../declance.c:407: warning: assignment from incompatible pointer type

Also add a `const' qualifier where applicable and adjust formatting.

WBR, Sergei