* [PATCH 2/6] staging: vt6656: sparse fixes: device_get_stats
@ 2014-01-13 16:18 Malcolm Priestley
2014-01-13 23:42 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Malcolm Priestley @ 2014-01-13 16:18 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
sparse warning
main_usb.c:1442:44: warning: cast removes address space of expression
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/main_usb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 4cb7aa7..59c2430 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1418,8 +1418,9 @@ static void device_set_multi(struct net_device *dev)
static struct net_device_stats *device_get_stats(struct net_device *dev)
{
struct vnt_private *pDevice = netdev_priv(dev);
+ struct net_device_stats *stats = &pDevice->stats;
- return &pDevice->stats;
+ return stats;
}
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/6] staging: vt6656: sparse fixes: device_get_stats
2014-01-13 16:18 [PATCH 2/6] staging: vt6656: sparse fixes: device_get_stats Malcolm Priestley
@ 2014-01-13 23:42 ` Greg KH
2014-01-14 20:26 ` Malcolm Priestley
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2014-01-13 23:42 UTC (permalink / raw)
To: Malcolm Priestley; +Cc: linux-wireless
On Mon, Jan 13, 2014 at 04:18:50PM +0000, Malcolm Priestley wrote:
> sparse warning
> main_usb.c:1442:44: warning: cast removes address space of expression
>
> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> ---
> drivers/staging/vt6656/main_usb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 4cb7aa7..59c2430 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -1418,8 +1418,9 @@ static void device_set_multi(struct net_device *dev)
> static struct net_device_stats *device_get_stats(struct net_device *dev)
> {
> struct vnt_private *pDevice = netdev_priv(dev);
> + struct net_device_stats *stats = &pDevice->stats;
>
> - return &pDevice->stats;
> + return stats;
This change makes no sense to me. Why is sparse complaining about this?
Is this a bug in sparse, or am I missing something obvious here?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/6] staging: vt6656: sparse fixes: device_get_stats
2014-01-13 23:42 ` Greg KH
@ 2014-01-14 20:26 ` Malcolm Priestley
0 siblings, 0 replies; 3+ messages in thread
From: Malcolm Priestley @ 2014-01-14 20:26 UTC (permalink / raw)
To: Greg KH; +Cc: linux-wireless
On Mon, 2014-01-13 at 15:42 -0800, Greg KH wrote:
> On Mon, Jan 13, 2014 at 04:18:50PM +0000, Malcolm Priestley wrote:
> > sparse warning
> > main_usb.c:1442:44: warning: cast removes address space of expression
> >
> > Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> > ---
> > drivers/staging/vt6656/main_usb.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> > index 4cb7aa7..59c2430 100644
> > --- a/drivers/staging/vt6656/main_usb.c
> > +++ b/drivers/staging/vt6656/main_usb.c
> > @@ -1418,8 +1418,9 @@ static void device_set_multi(struct net_device *dev)
> > static struct net_device_stats *device_get_stats(struct net_device *dev)
> > {
> > struct vnt_private *pDevice = netdev_priv(dev);
> > + struct net_device_stats *stats = &pDevice->stats;
> >
> > - return &pDevice->stats;
> > + return stats;
>
> This change makes no sense to me. Why is sparse complaining about this?
>
> Is this a bug in sparse, or am I missing something obvious here?
Yes me!!!
Sorry. that is not line 1442, a case of number dyslexia.
That is fixed in the next patch.
Malcolm
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-14 20:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 16:18 [PATCH 2/6] staging: vt6656: sparse fixes: device_get_stats Malcolm Priestley
2014-01-13 23:42 ` Greg KH
2014-01-14 20:26 ` Malcolm Priestley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).