Skip to contentSkip to conversation

staging: vt6655: fix sparse warning: argument type

PATCH In review Eddie Kovsky 3 participants 3 messages Dec 21, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6655: fix sparse warning: argument type

Fixes following warning generated by sparse:

drivers/staging/vt6655/baseband.c:2180:45: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/baseband.c:2180:45: expected struct vnt_private *priv
drivers/staging/vt6655/baseband.c:2180:45: got void [noderef] <asn:2>*dwIoBase

Compile tested on next-20141219.

---
 drivers/staging/vt6655/baseband.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.c +1 -1
index 86c72ba0a0cd..f8c5fc371c4c 100644
@@ -2177,7 +2177,7 @@ bool BBbVT3253Init(struct vnt_private *priv)
 		/* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */
 		/*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/
 		/* Select VC1/VC2, CR215 = 0x02->0x06 */
-		bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
+		bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06);
 		/* }} */
 
 		for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
Signature · 1 line
2.1.0
#1 lore raw

Eddie, all,

Quoted 18 lines · Eddie Kovsky

Fixes following warning generated by sparse:

drivers/staging/vt6655/baseband.c:2180:45: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/baseband.c:2180:45: expected struct vnt_private *priv
drivers/staging/vt6655/baseband.c:2180:45: got void [noderef] <asn:2>*dwIoBase

Compile tested on next-20141219.

---
 drivers/staging/vt6655/baseband.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.c +0 -0
index 86c72ba0a0cd..f8c5fc371c4c 100644

drivers/staging/vt6655/baseband.c bool BBbVT3253Init(struct vnt_private *priv) · line 2183

Quoted 8 lines
drivers/staging/vt6655/baseband.c +1 -1
@@ -2177,7 +2177,7 @@ bool BBbVT3253Init(struct vnt_private *priv)
 		/* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */
 		/*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/
 		/* Select VC1/VC2, CR215 = 0x02->0x06 */
-		bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
+		bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06);
 		/* }} */
 
 		for (ii = 0; ii < CB_VT3253B0_AGC; ii++)

[...]

The change looks right. BBbWriteEmbedded use priv to get dwIoBase. And every other call to BBbWriteEmbedded uses the priv argument.

   dwIoBase = priv->PortOffset;

So how did this mistake get in there?

It looks like it was simply missed in commit 377f5bc00f7e1. All the ones before and after were changed, but not this one.

Interestingly, if you go back to this commit and compile it, no error is generated unless you enable sparse checks.

Signature · 1 line
- Jeremiah Mahler
#2 lore raw
Quoted 34 lines · Jeremiah Mahler

Eddie, all,

Quoted 18 lines · Eddie Kovsky

Fixes following warning generated by sparse:

drivers/staging/vt6655/baseband.c:2180:45: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/baseband.c:2180:45: expected struct vnt_private *priv
drivers/staging/vt6655/baseband.c:2180:45: got void [noderef] <asn:2>*dwIoBase

Compile tested on next-20141219.

---
  drivers/staging/vt6655/baseband.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.c +0 -0
index 86c72ba0a0cd..f8c5fc371c4c 100644

drivers/staging/vt6655/baseband.c bool BBbVT3253Init(struct vnt_private *priv) · line 2183

Quoted 8 lines
drivers/staging/vt6655/baseband.c +1 -1
@@ -2177,7 +2177,7 @@ bool BBbVT3253Init(struct vnt_private *priv)
  		/* Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) */
  		/*bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);*/
  		/* Select VC1/VC2, CR215 = 0x02->0x06 */
-		bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
+		bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06);
  		/* }} */
 
  		for (ii = 0; ii < CB_VT3253B0_AGC; ii++)

[...]

The change looks right. BBbWriteEmbedded use priv to get dwIoBase. And every other call to BBbWriteEmbedded uses the priv argument.

Quoted 6 lines
    dwIoBase = priv->PortOffset;

So how did this mistake get in there?

It looks like it was simply missed in commit 377f5bc00f7e1. All the ones before and after were changed, but not this one.

Yes it was missed probably because it looks like it commented out.

Good catch Eddie.

As my device does not this baseband type I won't encounter the bug.

Greg, this needs to go into 3.19.

Thanks

Malcolm

Quoted 4 lines

Interestingly, if you go back to this commit and compile it, no error is generated unless you enable sparse checks.