public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: vt6655: fixing various sparse problems
@ 2015-01-18  2:04 mathieu.poirier
  2015-01-18  2:04 ` [PATCH 1/4] staging: vt6655: correcting function declaration sparse error mathieu.poirier
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: mathieu.poirier @ 2015-01-18  2:04 UTC (permalink / raw)
  To: forest, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

>From a v3.19-rc4 baseline sparse finds the following errors:

  LD      drivers/staging/vt6655/built-in.o
  CHECK   drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1672:5: warning: symbol 'vnt_init' was not declared. Should it be static?
  CC [M]  drivers/staging/vt6655/device_main.o
  CHECK   drivers/staging/vt6655/card.c
  CC [M]  drivers/staging/vt6655/card.o
  CHECK   drivers/staging/vt6655/channel.c
  CC [M]  drivers/staging/vt6655/channel.o
  CHECK   drivers/staging/vt6655/mac.c
drivers/staging/vt6655/mac.c:162:6: warning: symbol 'MACvGetShortRetryLimit' was not declared. Should it be static?
  CC [M]  drivers/staging/vt6655/mac.o
  CHECK   drivers/staging/vt6655/baseband.c
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
  CC [M]  drivers/staging/vt6655/baseband.o
  CHECK   drivers/staging/vt6655/rxtx.c


The following pachset provides a fix for the above.

Mathieu Poirier (4):
  staging: vt6655: correcting function declaration sparse error
  staging: vt6655: removing dead function as reported by sparse
  staging: vt6655: fix wrong parameter as reported by sparse
  staging: vt6655: correcting parameter related sparse error

 drivers/staging/vt6655/baseband.c    |  2 +-
 drivers/staging/vt6655/device_main.c |  8 +++++---
 drivers/staging/vt6655/mac.c         | 19 -------------------
 3 files changed, 6 insertions(+), 23 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] staging: vt6655: correcting function declaration sparse error
  2015-01-18  2:04 [PATCH 0/4] staging: vt6655: fixing various sparse problems mathieu.poirier
@ 2015-01-18  2:04 ` mathieu.poirier
  2015-01-25 11:39   ` Greg KH
  2015-01-18  2:04 ` [PATCH 2/4] staging: vt6655: removing dead function as reported by sparse mathieu.poirier
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: mathieu.poirier @ 2015-01-18  2:04 UTC (permalink / raw)
  To: forest, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
  LD      drivers/staging/vt6655/built-in.o
  CHECK   drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/device_main.c:1672:5: warning: symbol 'vnt_init' was not declared. Should it be static?
  CC [M]  drivers/staging/vt6655/device_main.o

Function @vnt_init is only called by @vt6655_probe, in turn is declared "static".
As sparse suggest, @vnt_init should very likely be declared static as well.  At
least nothing in the file indicate that it should be otherwise.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/staging/vt6655/device_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 83e4162c0094..a3f5cd84259a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1669,7 +1669,7 @@ static const struct ieee80211_ops vnt_mac_ops = {
 	.reset_tsf		= vnt_reset_tsf,
 };
 
-int vnt_init(struct vnt_private *priv)
+static int vnt_init(struct vnt_private *priv)
 {
 	SET_IEEE80211_PERM_ADDR(priv->hw, priv->abyCurrentNetAddr);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] staging: vt6655: removing dead function as reported by sparse
  2015-01-18  2:04 [PATCH 0/4] staging: vt6655: fixing various sparse problems mathieu.poirier
  2015-01-18  2:04 ` [PATCH 1/4] staging: vt6655: correcting function declaration sparse error mathieu.poirier
@ 2015-01-18  2:04 ` mathieu.poirier
  2015-01-18  2:04 ` [PATCH 3/4] staging: vt6655: fix wrong parameter " mathieu.poirier
  2015-01-18  2:04 ` [PATCH 4/4] staging: vt6655: correcting parameter related sparse error mathieu.poirier
  3 siblings, 0 replies; 7+ messages in thread
From: mathieu.poirier @ 2015-01-18  2:04 UTC (permalink / raw)
  To: forest, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
  CHECK   drivers/staging/vt6655/mac.c
drivers/staging/vt6655/mac.c:162:6: warning: symbol 'MACvGetShortRetryLimit' was not declared. Should it be static?
  CC [M]  drivers/staging/vt6655/mac.o

Commit:
87299d4c06f0 staging: vt6655: mac.c and mac.h remove dead functions.

removes a lot of "dead" functions but forgot @MACvGetShortRetryLimit.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/staging/vt6655/mac.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 8f0d652fea7c..7402a2b272b0 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -148,25 +148,6 @@ void MACvSetShortRetryLimit(void __iomem *dwIoBase, unsigned char byRetryLimit)
 
 /*
  * Description:
- *      Get 802.11 Short Retry Limit
- *
- * Parameters:
- *  In:
- *      dwIoBase        - Base Address for MAC
- *  Out:
- *      pbyRetryLimit   - Retry Limit Get
- *
- * Return Value: none
- *
- */
-void MACvGetShortRetryLimit(void __iomem *dwIoBase, unsigned char *pbyRetryLimit)
-{
-	// get SRT
-	VNSvInPortB(dwIoBase + MAC_REG_SRT, pbyRetryLimit);
-}
-
-/*
- * Description:
  *      Set 802.11 Long Retry Limit
  *
  * Parameters:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] staging: vt6655: fix wrong parameter as reported by sparse
  2015-01-18  2:04 [PATCH 0/4] staging: vt6655: fixing various sparse problems mathieu.poirier
  2015-01-18  2:04 ` [PATCH 1/4] staging: vt6655: correcting function declaration sparse error mathieu.poirier
  2015-01-18  2:04 ` [PATCH 2/4] staging: vt6655: removing dead function as reported by sparse mathieu.poirier
@ 2015-01-18  2:04 ` mathieu.poirier
  2015-01-18  2:04 ` [PATCH 4/4] staging: vt6655: correcting parameter related sparse error mathieu.poirier
  3 siblings, 0 replies; 7+ messages in thread
From: mathieu.poirier @ 2015-01-18  2:04 UTC (permalink / raw)
  To: forest, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
  LD      drivers/staging/vt6655/built-in.o
  CHECK   drivers/staging/vt6655/device_main.c
  CC [M]  drivers/staging/vt6655/device_main.o
  CHECK   drivers/staging/vt6655/card.c
  CC [M]  drivers/staging/vt6655/card.o
  CHECK   drivers/staging/vt6655/channel.c
  CC [M]  drivers/staging/vt6655/channel.o
  CHECK   drivers/staging/vt6655/mac.c
  CC [M]  drivers/staging/vt6655/mac.o
  CHECK   drivers/staging/vt6655/baseband.c
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
  CC [M]  drivers/staging/vt6655/baseband.o

Since
8e8a9f5133cf staging: vt6655: BBbReadEmbedded replace __iomem with vnt_private

The first parameter to @BBbReadEmbedde is a vnt_private.  The patch is changing
all occurences _except_ this one, as reported by sparse.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.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++)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] staging: vt6655: correcting parameter related sparse error
  2015-01-18  2:04 [PATCH 0/4] staging: vt6655: fixing various sparse problems mathieu.poirier
                   ` (2 preceding siblings ...)
  2015-01-18  2:04 ` [PATCH 3/4] staging: vt6655: fix wrong parameter " mathieu.poirier
@ 2015-01-18  2:04 ` mathieu.poirier
  3 siblings, 0 replies; 7+ messages in thread
From: mathieu.poirier @ 2015-01-18  2:04 UTC (permalink / raw)
  To: forest, gregkh; +Cc: devel, linux-kernel, mathieu.poirier

From: Mathieu Poirier <mathieu.poirier@linaro.org>

mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
  LD      drivers/staging/vt6655/built-in.o
  CHECK   drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *

In this case a pointer to "struct vnt_private" is given to macros @MACvRegBitsOn()
and @MACvRegBitsOff().  These in turn eventually call @ioread8(), which take a
"void __iomem *" as parameter.  The first field of "struct vnt_private" is a
pointer to a "struct pci_dev", whose first field is a "struct list_head".

Correcting the problem by following the trend set fort in every other calls to
the macros by passing "->PortOffset", declared as "void __iomem *".

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/staging/vt6655/device_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index a3f5cd84259a..951ea5321d61 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1500,9 +1500,11 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
 		if (conf->enable_beacon) {
 			vnt_beacon_enable(priv, vif, conf);
 
-			MACvRegBitsOn(priv, MAC_REG_TCR, TCR_AUTOBCNTX);
+			MACvRegBitsOn(priv->PortOffset,
+				      MAC_REG_TCR, TCR_AUTOBCNTX);
 		} else {
-			MACvRegBitsOff(priv, MAC_REG_TCR, TCR_AUTOBCNTX);
+			MACvRegBitsOff(priv->PortOffset,
+				       MAC_REG_TCR, TCR_AUTOBCNTX);
 		}
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] staging: vt6655: correcting function declaration sparse error
  2015-01-18  2:04 ` [PATCH 1/4] staging: vt6655: correcting function declaration sparse error mathieu.poirier
@ 2015-01-25 11:39   ` Greg KH
  2015-01-28  2:37     ` Mathieu Poirier
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2015-01-25 11:39 UTC (permalink / raw)
  To: mathieu.poirier; +Cc: forest, devel, linux-kernel

On Sat, Jan 17, 2015 at 07:04:23PM -0700, mathieu.poirier@linaro.org wrote:
> From: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
>   LD      drivers/staging/vt6655/built-in.o
>   CHECK   drivers/staging/vt6655/device_main.c
> drivers/staging/vt6655/device_main.c:1672:5: warning: symbol 'vnt_init' was not declared. Should it be static?
>   CC [M]  drivers/staging/vt6655/device_main.o
> 
> Function @vnt_init is only called by @vt6655_probe, in turn is declared "static".
> As sparse suggest, @vnt_init should very likely be declared static as well.  At
> least nothing in the file indicate that it should be otherwise.
> 
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  drivers/staging/vt6655/device_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This whole series does not apply to my staging-next branch, of
staging.git, please refresh against it and resend if it is still needed
(hint, I don't think they all are...)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] staging: vt6655: correcting function declaration sparse error
  2015-01-25 11:39   ` Greg KH
@ 2015-01-28  2:37     ` Mathieu Poirier
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2015-01-28  2:37 UTC (permalink / raw)
  To: Greg KH; +Cc: forest, devel, linux-kernel@vger.kernel.org

On 25 January 2015 at 04:39, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sat, Jan 17, 2015 at 07:04:23PM -0700, mathieu.poirier@linaro.org wrote:
>> From: Mathieu Poirier <mathieu.poirier@linaro.org>
>>
>> mpoirier@t430:~/work/kernel1$ make C=1 M=drivers/staging/vt6655/
>>   LD      drivers/staging/vt6655/built-in.o
>>   CHECK   drivers/staging/vt6655/device_main.c
>> drivers/staging/vt6655/device_main.c:1672:5: warning: symbol 'vnt_init' was not declared. Should it be static?
>>   CC [M]  drivers/staging/vt6655/device_main.o
>>
>> Function @vnt_init is only called by @vt6655_probe, in turn is declared "static".
>> As sparse suggest, @vnt_init should very likely be declared static as well.  At
>> least nothing in the file indicate that it should be otherwise.
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> ---
>>  drivers/staging/vt6655/device_main.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> This whole series does not apply to my staging-next branch, of
> staging.git, please refresh against it and resend if it is still needed
> (hint, I don't think they all are...)

Turns out none of them are necessary anymore.

Regards,
Mathieu

>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-28  2:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-18  2:04 [PATCH 0/4] staging: vt6655: fixing various sparse problems mathieu.poirier
2015-01-18  2:04 ` [PATCH 1/4] staging: vt6655: correcting function declaration sparse error mathieu.poirier
2015-01-25 11:39   ` Greg KH
2015-01-28  2:37     ` Mathieu Poirier
2015-01-18  2:04 ` [PATCH 2/4] staging: vt6655: removing dead function as reported by sparse mathieu.poirier
2015-01-18  2:04 ` [PATCH 3/4] staging: vt6655: fix wrong parameter " mathieu.poirier
2015-01-18  2:04 ` [PATCH 4/4] staging: vt6655: correcting parameter related sparse error mathieu.poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox