* [PATCH] staging: vt6655: fix sparse warning: argument type @ 2014-12-21 5:27 Eddie Kovsky 2014-12-21 8:17 ` Jeremiah Mahler 0 siblings, 1 reply; 3+ messages in thread From: Eddie Kovsky @ 2014-12-21 5:27 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: devel, linux-kernel 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. Signed-off-by: Eddie Kovsky <ewk@edkovsky.org> --- drivers/staging/vt6655/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index 86c72ba0a0cd..f8c5fc371c4c 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c @@ -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++) -- 2.1.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: vt6655: fix sparse warning: argument type 2014-12-21 5:27 [PATCH] staging: vt6655: fix sparse warning: argument type Eddie Kovsky @ 2014-12-21 8:17 ` Jeremiah Mahler 2014-12-21 10:17 ` Malcolm Priestley 0 siblings, 1 reply; 3+ messages in thread From: Jeremiah Mahler @ 2014-12-21 8:17 UTC (permalink / raw) To: Eddie Kovsky; +Cc: Greg Kroah-Hartman, devel, linux-kernel Eddie, all, On Sat, Dec 20, 2014 at 10:27:55PM -0700, Eddie Kovsky wrote: > 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. > > Signed-off-by: Eddie Kovsky <ewk@edkovsky.org> > --- > drivers/staging/vt6655/baseband.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c > index 86c72ba0a0cd..f8c5fc371c4c 100644 > --- a/drivers/staging/vt6655/baseband.c > +++ b/drivers/staging/vt6655/baseband.c > @@ -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. -- - Jeremiah Mahler ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: vt6655: fix sparse warning: argument type 2014-12-21 8:17 ` Jeremiah Mahler @ 2014-12-21 10:17 ` Malcolm Priestley 0 siblings, 0 replies; 3+ messages in thread From: Malcolm Priestley @ 2014-12-21 10:17 UTC (permalink / raw) To: Jeremiah Mahler, Eddie Kovsky, Greg Kroah-Hartman, devel, linux-kernel On 21/12/14 08:17, Jeremiah Mahler wrote: > Eddie, all, > > On Sat, Dec 20, 2014 at 10:27:55PM -0700, Eddie Kovsky wrote: >> 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. >> >> Signed-off-by: Eddie Kovsky <ewk@edkovsky.org> >> --- >> drivers/staging/vt6655/baseband.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c >> index 86c72ba0a0cd..f8c5fc371c4c 100644 >> --- a/drivers/staging/vt6655/baseband.c >> +++ b/drivers/staging/vt6655/baseband.c >> @@ -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. 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 > > Interestingly, if you go back to this commit and compile it, no error > is generated unless you enable sparse checks. > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-21 10:17 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-12-21 5:27 [PATCH] staging: vt6655: fix sparse warning: argument type Eddie Kovsky 2014-12-21 8:17 ` Jeremiah Mahler 2014-12-21 10:17 ` Malcolm Priestley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox