[PATCH 3/3] staging: cxt1e1: remove set a value to static variable

2014-05-08 Thread Daeseok Youn
cleanup checkpatch.pl error:
 ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Daeseok Youn 
---
 drivers/staging/cxt1e1/musycc.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 89f905d..3e7c21b 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -1,5 +1,5 @@
-static unsigned int max_intcnt = 0;
-static unsigned int max_bh = 0;
+static unsigned int max_intcnt;
+static unsigned int max_bh;
 
 /*-
  * musycc.c -
@@ -474,7 +474,7 @@ musycc_chan_restart(mch_t *ch)
 void
 rld_put_led(mpi_t *pi, u_int32_t ledval)
 {
-   static u_int32_t led = 0;
+   static u_int32_t led;
 
if (ledval == 0)
led = 0;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] Staging: cxt1e1: Fix line length over 80 characters in musycc.c

2014-05-08 Thread Daeseok Youn
clean up checkpatch.pl warning
 WARNING: Line length over 80 characters

Signed-off-by: Daeseok Youn 
---
 drivers/staging/cxt1e1/musycc.c |   29 +++--
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 71bcef3..89f905d 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -392,7 +392,8 @@ musycc_wq_chan_restart(void *arg)  /* channel private 
structure */
 #endif
}
 #endif
-   musycc_serv_req(pi, SR_CHANNEL_ACTIVATE | SR_RX_DIRECTION | 
ch->gchan);
+   musycc_serv_req(pi, SR_CHANNEL_ACTIVATE |
+   SR_RX_DIRECTION | ch->gchan);
}
 
/* check for TX restart request */
@@ -816,9 +817,10 @@ musycc_init(ci_t *ci)
}
/* save orig value for free's usage */
pi->regram_saved = regaddr;
-   pi->regram = (struct musycc_groupr *)((unsigned long)(regaddr + 
GROUP_BOUNDARY - 1) &
-   (~(GROUP_BOUNDARY - 1)));/* this 
calculates
- * closest 
boundary */
+   /* this calculates closest boundary */
+   pi->regram = (struct musycc_groupr *)((unsigned long)(regaddr +
+ GROUP_BOUNDARY - 1) &
+ (~(GROUP_BOUNDARY - 1)));
}
 
/* any board centric MUSYCC commands will use group ZERO as its "home" 
*/
@@ -1100,7 +1102,9 @@ musycc_bh_rx_eom(mpi_t *pi, int gchan)
 */
if (hdlcnum >= 228) {
if (nciProcess_RX_packet)
-   (*nciProcess_RX_packet) (hdlcnum, 
status & 0x3fff, m, ch->user);
+   (*nciProcess_RX_packet)(hdlcnum, status 
&
+   0x3fff, m,
+   ch->user);
} else
 #endif /* CONFIG_SBE_WAN256T3_NCOMM */
{
@@ -1379,7 +1383,8 @@ musycc_intr_bh_tasklet(ci_t *ci)
else
ci->iqd_p[headx] =
__constant_cpu_to_le32(INT_EMPTY_ENTRY);
-   ci->iqp_headx = (headx + 1) & (INT_QUEUE_SIZE - 1); /* 
insure wrapness */
+   /* insure wrapness */
+   ci->iqp_headx = (headx + 1) & (INT_QUEUE_SIZE - 1);
FLUSH_MEM_WRITE();
FLUSH_MEM_READ();
continue;
@@ -1516,7 +1521,8 @@ musycc_intr_bh_tasklet(ci_t *ci)
pr_info("%s: RX buffer overflow [ONR] 
on channel %d, mode %x\n",
ci->devname, ch->channum,
ch->p.chan_mode);
-   //musycc_dump_rxbuffer_ring (ch, 0);
/* RLD DEBUG */
+   /* RLD DEBUG */
+   //musycc_dump_rxbuffer_ring (ch, 0);
}
}
musycc_chan_restart(ch);
@@ -1573,7 +1579,8 @@ musycc_intr_bh_tasklet(ci_t *ci)
} /* switch on err */
 
/* Check for interrupt lost condition */
-   if ((currInt & INTRPT_ILOST_M) && (cxt1e1_log_level >= 
LOG_ERROR))
+   if ((currInt & INTRPT_ILOST_M) &&
+   (cxt1e1_log_level >= LOG_ERROR))
pr_info("%s: Interrupt queue overflow - ILOST 
asserted\n",
ci->devname);
/* insure wrapness */
@@ -1684,7 +1691,8 @@ musycc_del_chan(ci_t *ci, int channum)
 {
mch_t  *ch;
 
-   if ((channum < 0) || (channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)))  /* 
sanity chk param */
+   /* sanity chk param */
+   if ((channum < 0) || (channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)))
return ECHRNG;
ch = sd_find_chan(ci, channum);
if (!ch)
@@ -1749,7 +1757,8 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
{
pr_info("++ start_xmt[%d]: state %x start %x full %d free %d 
required %d stopped %x\n",
channum, ch->state, ch->ch_start_tx, ch->tx_full,
-   ch->txd_free, ch->txd_required, 
sd_queue_stopped(ch->user));
+   ch->txd_free, ch->txd_required,
+   sd_queue_stopped(ch->user));
}
 
/* Determine total amount of data to be sent */
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driver

Re: [PATCH 1/2] mmc: rtsx: Revert "mmc: rtsx: modify errorhandleandremovesmatch warnings"

2014-05-08 Thread micky

Hi Ulf

On 05/08/2014 04:22 PM, Ulf Hansson wrote:

On 8 May 2014 09:55, Lee Jones  wrote:

It seems Chris is too busy to responding, so would you help to pick
this patch for 3.15 fix.

H... that's pretty bad timing.  I've literally just sent the
pull-request containing the MFD/MMC fixup branch to Linus.  I guess
Ulf will have to do it.

There seem to be some confusion here. :-)

This patch is _only_ intended for Chris' mmc_next branch, so it
shouldn't go for 3.15 fixes. Or better, Chris should drop the patch
this one is reverting.
Sorry for the mistake, only the second patch of the patch set is need 
for 3.15 fix.

I wrote this email in a wrong place.

Best Regards.

Likely we will see a merge problem in Stephen Rothwell's linux-next
tree, until Chris' drops this patch - causing Stephen to not merge the
mmc tree for a while. I suppose that's the best we can do, until Chris
shows up again.

Kind regards
Ulf Hansson


From: Micky Ching

This reverts commit 1f7b581b3ffcb2a8437397a02f4af89fa6934d08.

The patch depend on commit c42deffd5b53c9e583d83c7964854ede2f12410d
, but the previous
patch was discard. So we have to delete the patch.

Signed-off-by: Micky Ching

Acked-by: Ulf Hansson

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

.



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch v2] Documentation/email-clients.txt: add a section about git

2014-05-08 Thread Namhyung Kim
Hi Dan,

On Thu, 8 May 2014 11:44:12 +0300, Dan Carpenter wrote:
> These days most people use git to send patches so I have added a section
> about that.
>
> Signed-off-by: Dan Carpenter 
> ---
> v2: Fixed changelog
>
> diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
> index 4e30eba..9004a5fd 100644
> --- a/Documentation/email-clients.txt
> +++ b/Documentation/email-clients.txt
> @@ -1,6 +1,17 @@
>  Email clients info for Linux
>  ==
>  
> +Git
> +--
> +These days most developers use `git send-email` instead of regular
> +email clients.  On the receiving end, maintainers use `git am` to
> +apply the patches.
> +
> +If you are new to git then send your first patch to yourself.  Save it
> +as raw text including all the headers.  Run `cat raw_email.txt | git am`
> +and then review the changelog with `git log -p`.  When that works then

Also the -p option is not needed for just checking the changelog IMHO.
If one needs to check the patch itself too, I think `git show` is
slightly better since it only shows the single commit applied.

Thanks,
Namhyung
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net-next, v3] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang
This change ensures the driver can be built successfully without the
CONFIG_SYSFS flag.
MS-TFS: 182270

Signed-off-by: Haiyang Zhang 
Reviewed-by: K. Y. Srinivasan 
---
 drivers/net/hyperv/netvsc_drv.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 939e3af..083d084 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -640,8 +640,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
   packet->vlan_tci);
 
skb_record_rx_queue(skb, packet->channel->
-   offermsg.offer.sub_channel_index %
-   net->real_num_rx_queues);
+   offermsg.offer.sub_channel_index);
 
net->stats.rx_packets++;
net->stats.rx_bytes += packet->total_data_buflen;
@@ -824,8 +823,6 @@ static int netvsc_probe(struct hv_device *dev,
nvdev = hv_get_drvdata(dev);
netif_set_real_num_tx_queues(net, nvdev->num_chn);
netif_set_real_num_rx_queues(net, nvdev->num_chn);
-   dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
-net->real_num_tx_queues, net->real_num_rx_queues);
 
ret = register_netdev(net);
if (ret != 0) {
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH net-next,v2] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang


> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Thursday, May 8, 2014 4:45 PM
> To: Haiyang Zhang
> Cc: net...@vger.kernel.org; KY Srinivasan; o...@aepfle.de;
> jasow...@redhat.com; linux-ker...@vger.kernel.org; driverdev-
> de...@linuxdriverproject.org
> Subject: Re: [PATCH net-next,v2] Add support for netvsc build without
> CONFIG_SYSFS flag
> 
> From: Haiyang Zhang 
> Date: Thu,  8 May 2014 13:41:33 -0700
> 
> > +static inline void netvsc_record_rx_queue(struct sk_buff *skb,
> > + struct hv_netvsc_packet *packet,
> > + struct net_device *ndev)
> > +{
> > +#ifdef CONFIG_SYSFS
> > +   skb_record_rx_queue(skb, packet->channel->
> > +   offermsg.offer.sub_channel_index %
> > +   ndev->real_num_rx_queues);
> > +#endif
> > +}
> 
> This is still fantastically gross, what is so unique about your driver that 
> it needs
> hacks like this?  No other driver to my knowledge does.
> 
> Figure out what it is that makes your driver so unique, and try to make it
> conform to how other drivers handle these features without SYSFS ifdef'ery
> instead.
> 

I looked around the other drivers, and the netif_set_real_num_rx_queues() 
function. 
It's already switched to no-op without CONFIG_SYSFS flag. So I will rely on 
this, and 
don't have to handle the flag in my code. 

Thanks,
- Haiyang

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net-next,v2] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread David Miller
From: Haiyang Zhang 
Date: Thu,  8 May 2014 13:41:33 -0700

> +static inline void netvsc_record_rx_queue(struct sk_buff *skb,
> +   struct hv_netvsc_packet *packet,
> +   struct net_device *ndev)
> +{
> +#ifdef CONFIG_SYSFS
> + skb_record_rx_queue(skb, packet->channel->
> + offermsg.offer.sub_channel_index %
> + ndev->real_num_rx_queues);
> +#endif
> +}

This is still fantastically gross, what is so unique about your
driver that it needs hacks like this?  No other driver to my
knowledge does.

Figure out what it is that makes your driver so unique, and
try to make it conform to how other drivers handle these
features without SYSFS ifdef'ery instead.

I'm not applying this patch, sorry.

Thanks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH net-next, v2] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang


> -Original Message-
> From: Greg KH [mailto:g...@kroah.com]
> Sent: Thursday, May 8, 2014 4:04 PM
> To: Haiyang Zhang
> Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> jasow...@redhat.com; driverdev-devel@linuxdriverproject.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH net-next, v2] Add support for netvsc build without
> CONFIG_SYSFS flag
> 
> On Thu, May 08, 2014 at 01:41:33PM -0700, Haiyang Zhang wrote:
> > This change ensures the driver can be built successfully without the
> > CONFIG_SYSFS flag.
> > MS-TFS: 182270
> >
> > Signed-off-by: Haiyang Zhang 
> > Reviewed-by: K. Y. Srinivasan 
> > ---
> >  drivers/net/hyperv/hyperv_net.h   |   28 
> >  drivers/net/hyperv/netvsc_drv.c   |   13 +++--
> >  drivers/net/hyperv/rndis_filter.c |4 ++--
> >  3 files changed, 37 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/hyperv/hyperv_net.h
> > b/drivers/net/hyperv/hyperv_net.h index 4b7df5a..02358cb 100644
> > --- a/drivers/net/hyperv/hyperv_net.h
> > +++ b/drivers/net/hyperv/hyperv_net.h
> > @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /*
> > NDIS_RECEIVE_SCALE_CAPABILITIES */  #define HASH_KEYLEN
> > NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
> >  extern u8 netvsc_hash_key[];
> >
> > +extern unsigned int netvsc_num_queue;
> > +
> >  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
> > struct ndis_obj_header hdr;
> >
> > @@ -178,6 +180,32 @@ struct rndis_device {
> > unsigned char hw_mac_adr[ETH_ALEN];
> >  };
> >
> > +static inline void netvsc_record_rx_queue(struct sk_buff *skb,
> > + struct hv_netvsc_packet *packet,
> > + struct net_device *ndev)
> > +{
> > +#ifdef CONFIG_SYSFS
> > +   skb_record_rx_queue(skb, packet->channel->
> > +   offermsg.offer.sub_channel_index %
> > +   ndev->real_num_rx_queues);
> > +#endif
> 
> Really?  Do all other wireless drivers have this type of #ifdef needed?
> 
> > +}
> > +
> > +static inline void netvsc_show_num_queue(struct device *dev,
> > +struct net_device *ndev)
> > +{
> > +#ifdef CONFIG_SYSFS
> > +   dev_info(dev, "real num tx,rx queues:%u, %u\n",
> > +ndev->real_num_tx_queues, ndev->real_num_rx_queues);
> #endif
> 
> Do network drivers really spam the kernel log with this type of thing?
> If you have sysfs, why is this needed in the kernel log?
> 
> > +}
> > +
> > +static inline void netvsc_set_num_queue(unsigned int *nq) { #ifdef
> > +CONFIG_SYSFS
> > +   *nq = num_online_cpus();
> > +#endif
> > +}
> 
> I really feel that something is odd here...

I looked around the other drivers, and the netif_set_real_num_rx_queues() 
function. It's already switched to no-op without CONFIG_SYSFS flag. So I will 
rely on this, and don't have to handle the flag in my code. 

Also, the dev_info can be removed.

Thanks,
- Haiyang

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net-next, v2] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Greg KH
On Thu, May 08, 2014 at 01:41:33PM -0700, Haiyang Zhang wrote:
> This change ensures the driver can be built successfully without the
> CONFIG_SYSFS flag.
> MS-TFS: 182270
> 
> Signed-off-by: Haiyang Zhang 
> Reviewed-by: K. Y. Srinivasan 
> ---
>  drivers/net/hyperv/hyperv_net.h   |   28 
>  drivers/net/hyperv/netvsc_drv.c   |   13 +++--
>  drivers/net/hyperv/rndis_filter.c |4 ++--
>  3 files changed, 37 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index 4b7df5a..02358cb 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /* 
> NDIS_RECEIVE_SCALE_CAPABILITIES */
>  #define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
>  extern u8 netvsc_hash_key[];
>  
> +extern unsigned int netvsc_num_queue;
> +
>  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
>   struct ndis_obj_header hdr;
>  
> @@ -178,6 +180,32 @@ struct rndis_device {
>   unsigned char hw_mac_adr[ETH_ALEN];
>  };
>  
> +static inline void netvsc_record_rx_queue(struct sk_buff *skb,
> +   struct hv_netvsc_packet *packet,
> +   struct net_device *ndev)
> +{
> +#ifdef CONFIG_SYSFS
> + skb_record_rx_queue(skb, packet->channel->
> + offermsg.offer.sub_channel_index %
> + ndev->real_num_rx_queues);
> +#endif

Really?  Do all other wireless drivers have this type of #ifdef needed?

> +}
> +
> +static inline void netvsc_show_num_queue(struct device *dev,
> +  struct net_device *ndev)
> +{
> +#ifdef CONFIG_SYSFS
> + dev_info(dev, "real num tx,rx queues:%u, %u\n",
> +  ndev->real_num_tx_queues, ndev->real_num_rx_queues);
> +#endif

Do network drivers really spam the kernel log with this type of thing?
If you have sysfs, why is this needed in the kernel log?

> +}
> +
> +static inline void netvsc_set_num_queue(unsigned int *nq)
> +{
> +#ifdef CONFIG_SYSFS
> + *nq = num_online_cpus();
> +#endif
> +}

I really feel that something is odd here...

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH net-next] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang


> -Original Message-
> From: Greg KH [mailto:g...@kroah.com]
> Sent: Thursday, May 8, 2014 3:07 PM
> To: Haiyang Zhang
> Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> jasow...@redhat.com; driverdev-devel@linuxdriverproject.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH net-next] Add support for netvsc build without
> CONFIG_SYSFS flag
> 
> On Thu, May 08, 2014 at 03:13:19PM +, Haiyang Zhang wrote:
> >
> >
> > > -Original Message-
> > > From: Greg KH [mailto:g...@kroah.com]
> > > Sent: Thursday, May 8, 2014 5:13 AM
> > > To: Haiyang Zhang
> > > Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> > > jasow...@redhat.com; driverdev-devel@linuxdriverproject.org; linux-
> > > ker...@vger.kernel.org
> > > Subject: Re: [PATCH net-next] Add support for netvsc build without
> > > CONFIG_SYSFS flag
> > >
> > > On Wed, May 07, 2014 at 03:45:04PM -0700, Haiyang Zhang wrote:
> > > > This change ensures the driver can be built successfully without
> > > > the CONFIG_SYSFS flag.
> > > > MS-TFS: 182270
> > > >
> > > > Signed-off-by: Haiyang Zhang 
> > > > Reviewed-by: K. Y. Srinivasan 
> > > > ---
> > > >  drivers/net/hyperv/hyperv_net.h   |2 ++
> > > >  drivers/net/hyperv/netvsc_drv.c   |   12 +++-
> > > >  drivers/net/hyperv/rndis_filter.c |4 ++--
> > > >  3 files changed, 15 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/net/hyperv/hyperv_net.h
> > > > b/drivers/net/hyperv/hyperv_net.h index 4b7df5a..23b96bc 100644
> > > > --- a/drivers/net/hyperv/hyperv_net.h
> > > > +++ b/drivers/net/hyperv/hyperv_net.h
> > > > @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /*
> > > > NDIS_RECEIVE_SCALE_CAPABILITIES */  #define HASH_KEYLEN
> > > > NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
> > > >  extern u8 netvsc_hash_key[];
> > > >
> > > > +extern unsigned int netvsc_num_queue;
> > > > +
> > > >  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS
> */
> > > > struct ndis_obj_header hdr;
> > > >
> > > > diff --git a/drivers/net/hyperv/netvsc_drv.c
> > > > b/drivers/net/hyperv/netvsc_drv.c index 939e3af..07896f3 100644
> > > > --- a/drivers/net/hyperv/netvsc_drv.c
> > > > +++ b/drivers/net/hyperv/netvsc_drv.c
> > > > @@ -52,6 +52,8 @@ static int ring_size = 128;
> > > > module_param(ring_size, int, S_IRUGO);
> > > > MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
> > > >
> > > > +unsigned int netvsc_num_queue = 1;
> > > > +
> > > >  static void do_set_multicast(struct work_struct *w)  {
> > > > struct net_device_context *ndevctx = @@ -639,9 +641,11 @@ int
> > > > netvsc_recv_callback(struct hv_device *device_obj,
> > > > __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
> > > >packet->vlan_tci);
> > > >
> > > > +#ifdef CONFIG_SYSFS
> > > > skb_record_rx_queue(skb, packet->channel->
> > > > offermsg.offer.sub_channel_index %
> > > > net->real_num_rx_queues);
> > > > +#endif
> > >
> > > Why is this a sysfs-only function?  It should have nothing to do with 
> > > sysfs,
> right?
> > > So why would the driver care?
> >
> > Without CONFIG_SYSFS the multi-receive queues are not allocated, see
> > below, and the variable real_num_rx_queues is not defined, so we skip this
> function.
> >
> > In alloc_netdev_mqs(), file "net/core/dev.c":
> > #ifdef CONFIG_SYSFS
> > dev->num_rx_queues = rxqs;
> > dev->real_num_rx_queues = rxqs;
> > if (netif_alloc_rx_queues(dev))
> > goto free_all;
> > #endif
> 
> Then you need to structure your driver better :)

I have submitted an update patch.

Thanks,
- Haiyang

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net-next, v2] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang
This change ensures the driver can be built successfully without the
CONFIG_SYSFS flag.
MS-TFS: 182270

Signed-off-by: Haiyang Zhang 
Reviewed-by: K. Y. Srinivasan 
---
 drivers/net/hyperv/hyperv_net.h   |   28 
 drivers/net/hyperv/netvsc_drv.c   |   13 +++--
 drivers/net/hyperv/rndis_filter.c |4 ++--
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 4b7df5a..02358cb 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /* 
NDIS_RECEIVE_SCALE_CAPABILITIES */
 #define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
 extern u8 netvsc_hash_key[];
 
+extern unsigned int netvsc_num_queue;
+
 struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
struct ndis_obj_header hdr;
 
@@ -178,6 +180,32 @@ struct rndis_device {
unsigned char hw_mac_adr[ETH_ALEN];
 };
 
+static inline void netvsc_record_rx_queue(struct sk_buff *skb,
+ struct hv_netvsc_packet *packet,
+ struct net_device *ndev)
+{
+#ifdef CONFIG_SYSFS
+   skb_record_rx_queue(skb, packet->channel->
+   offermsg.offer.sub_channel_index %
+   ndev->real_num_rx_queues);
+#endif
+}
+
+static inline void netvsc_show_num_queue(struct device *dev,
+struct net_device *ndev)
+{
+#ifdef CONFIG_SYSFS
+   dev_info(dev, "real num tx,rx queues:%u, %u\n",
+ndev->real_num_tx_queues, ndev->real_num_rx_queues);
+#endif
+}
+
+static inline void netvsc_set_num_queue(unsigned int *nq)
+{
+#ifdef CONFIG_SYSFS
+   *nq = num_online_cpus();
+#endif
+}
 
 /* Interface */
 int netvsc_device_add(struct hv_device *device, void *additional_info);
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 939e3af..11794a0 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -52,6 +52,8 @@ static int ring_size = 128;
 module_param(ring_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
 
+unsigned int netvsc_num_queue = 1;
+
 static void do_set_multicast(struct work_struct *w)
 {
struct net_device_context *ndevctx =
@@ -639,9 +641,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
   packet->vlan_tci);
 
-   skb_record_rx_queue(skb, packet->channel->
-   offermsg.offer.sub_channel_index %
-   net->real_num_rx_queues);
+   netvsc_record_rx_queue(skb, packet, net);
 
net->stats.rx_packets++;
net->stats.rx_bytes += packet->total_data_buflen;
@@ -788,7 +788,7 @@ static int netvsc_probe(struct hv_device *dev,
int ret;
 
net = alloc_etherdev_mq(sizeof(struct net_device_context),
-   num_online_cpus());
+   netvsc_num_queue);
if (!net)
return -ENOMEM;
 
@@ -824,8 +824,7 @@ static int netvsc_probe(struct hv_device *dev,
nvdev = hv_get_drvdata(dev);
netif_set_real_num_tx_queues(net, nvdev->num_chn);
netif_set_real_num_rx_queues(net, nvdev->num_chn);
-   dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
-net->real_num_tx_queues, net->real_num_rx_queues);
+   netvsc_show_num_queue(&dev->device, net);
 
ret = register_netdev(net);
if (ret != 0) {
@@ -897,6 +896,8 @@ static void __exit netvsc_drv_exit(void)
 
 static int __init netvsc_drv_init(void)
 {
+   netvsc_set_num_queue(&netvsc_num_queue);
+
if (ring_size < RING_SIZE_MIN) {
ring_size = RING_SIZE_MIN;
pr_info("Increased ring_size to %d (min allowed)\n",
diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 99c527a..9db163c 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1094,8 +1094,8 @@ int rndis_filter_device_add(struct hv_device *dev,
if (ret || rsscap.num_recv_que < 2)
goto out;
 
-   net_device->num_chn = (num_online_cpus() < rsscap.num_recv_que) ?
-  num_online_cpus() : rsscap.num_recv_que;
+   net_device->num_chn = (netvsc_num_queue < rsscap.num_recv_que) ?
+  netvsc_num_queue : rsscap.num_recv_que;
if (net_device->num_chn == 1)
goto out;
 
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net-next] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Greg KH
On Thu, May 08, 2014 at 03:13:19PM +, Haiyang Zhang wrote:
> 
> 
> > -Original Message-
> > From: Greg KH [mailto:g...@kroah.com]
> > Sent: Thursday, May 8, 2014 5:13 AM
> > To: Haiyang Zhang
> > Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> > jasow...@redhat.com; driverdev-devel@linuxdriverproject.org; linux-
> > ker...@vger.kernel.org
> > Subject: Re: [PATCH net-next] Add support for netvsc build without
> > CONFIG_SYSFS flag
> > 
> > On Wed, May 07, 2014 at 03:45:04PM -0700, Haiyang Zhang wrote:
> > > This change ensures the driver can be built successfully without the
> > > CONFIG_SYSFS flag.
> > > MS-TFS: 182270
> > >
> > > Signed-off-by: Haiyang Zhang 
> > > Reviewed-by: K. Y. Srinivasan 
> > > ---
> > >  drivers/net/hyperv/hyperv_net.h   |2 ++
> > >  drivers/net/hyperv/netvsc_drv.c   |   12 +++-
> > >  drivers/net/hyperv/rndis_filter.c |4 ++--
> > >  3 files changed, 15 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/net/hyperv/hyperv_net.h
> > > b/drivers/net/hyperv/hyperv_net.h index 4b7df5a..23b96bc 100644
> > > --- a/drivers/net/hyperv/hyperv_net.h
> > > +++ b/drivers/net/hyperv/hyperv_net.h
> > > @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /*
> > > NDIS_RECEIVE_SCALE_CAPABILITIES */  #define HASH_KEYLEN
> > > NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
> > >  extern u8 netvsc_hash_key[];
> > >
> > > +extern unsigned int netvsc_num_queue;
> > > +
> > >  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
> > >   struct ndis_obj_header hdr;
> > >
> > > diff --git a/drivers/net/hyperv/netvsc_drv.c
> > > b/drivers/net/hyperv/netvsc_drv.c index 939e3af..07896f3 100644
> > > --- a/drivers/net/hyperv/netvsc_drv.c
> > > +++ b/drivers/net/hyperv/netvsc_drv.c
> > > @@ -52,6 +52,8 @@ static int ring_size = 128;  module_param(ring_size,
> > > int, S_IRUGO);  MODULE_PARM_DESC(ring_size, "Ring buffer size (# of
> > > pages)");
> > >
> > > +unsigned int netvsc_num_queue = 1;
> > > +
> > >  static void do_set_multicast(struct work_struct *w)  {
> > >   struct net_device_context *ndevctx = @@ -639,9 +641,11 @@ int
> > > netvsc_recv_callback(struct hv_device *device_obj,
> > >   __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
> > >  packet->vlan_tci);
> > >
> > > +#ifdef CONFIG_SYSFS
> > >   skb_record_rx_queue(skb, packet->channel->
> > >   offermsg.offer.sub_channel_index %
> > >   net->real_num_rx_queues);
> > > +#endif
> > 
> > Why is this a sysfs-only function?  It should have nothing to do with 
> > sysfs, right?
> > So why would the driver care?
> 
> Without CONFIG_SYSFS the multi-receive queues are not allocated, see below, 
> and 
> the variable real_num_rx_queues is not defined, so we skip this function.
> 
> In alloc_netdev_mqs(), file "net/core/dev.c":
> #ifdef CONFIG_SYSFS
> dev->num_rx_queues = rxqs;
> dev->real_num_rx_queues = rxqs;
> if (netif_alloc_rx_queues(dev))
> goto free_all;
> #endif

Then you need to structure your driver better :)

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH net-next] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Haiyang Zhang


> -Original Message-
> From: Greg KH [mailto:g...@kroah.com]
> Sent: Thursday, May 8, 2014 5:13 AM
> To: Haiyang Zhang
> Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> jasow...@redhat.com; driverdev-devel@linuxdriverproject.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH net-next] Add support for netvsc build without
> CONFIG_SYSFS flag
> 
> On Wed, May 07, 2014 at 03:45:04PM -0700, Haiyang Zhang wrote:
> > This change ensures the driver can be built successfully without the
> > CONFIG_SYSFS flag.
> > MS-TFS: 182270
> >
> > Signed-off-by: Haiyang Zhang 
> > Reviewed-by: K. Y. Srinivasan 
> > ---
> >  drivers/net/hyperv/hyperv_net.h   |2 ++
> >  drivers/net/hyperv/netvsc_drv.c   |   12 +++-
> >  drivers/net/hyperv/rndis_filter.c |4 ++--
> >  3 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/hyperv/hyperv_net.h
> > b/drivers/net/hyperv/hyperv_net.h index 4b7df5a..23b96bc 100644
> > --- a/drivers/net/hyperv/hyperv_net.h
> > +++ b/drivers/net/hyperv/hyperv_net.h
> > @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /*
> > NDIS_RECEIVE_SCALE_CAPABILITIES */  #define HASH_KEYLEN
> > NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
> >  extern u8 netvsc_hash_key[];
> >
> > +extern unsigned int netvsc_num_queue;
> > +
> >  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
> > struct ndis_obj_header hdr;
> >
> > diff --git a/drivers/net/hyperv/netvsc_drv.c
> > b/drivers/net/hyperv/netvsc_drv.c index 939e3af..07896f3 100644
> > --- a/drivers/net/hyperv/netvsc_drv.c
> > +++ b/drivers/net/hyperv/netvsc_drv.c
> > @@ -52,6 +52,8 @@ static int ring_size = 128;  module_param(ring_size,
> > int, S_IRUGO);  MODULE_PARM_DESC(ring_size, "Ring buffer size (# of
> > pages)");
> >
> > +unsigned int netvsc_num_queue = 1;
> > +
> >  static void do_set_multicast(struct work_struct *w)  {
> > struct net_device_context *ndevctx = @@ -639,9 +641,11 @@ int
> > netvsc_recv_callback(struct hv_device *device_obj,
> > __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
> >packet->vlan_tci);
> >
> > +#ifdef CONFIG_SYSFS
> > skb_record_rx_queue(skb, packet->channel->
> > offermsg.offer.sub_channel_index %
> > net->real_num_rx_queues);
> > +#endif
> 
> Why is this a sysfs-only function?  It should have nothing to do with sysfs, 
> right?
> So why would the driver care?

Without CONFIG_SYSFS the multi-receive queues are not allocated, see below, and 
the variable real_num_rx_queues is not defined, so we skip this function.

In alloc_netdev_mqs(), file "net/core/dev.c":
#ifdef CONFIG_SYSFS
dev->num_rx_queues = rxqs;
dev->real_num_rx_queues = rxqs;
if (netif_alloc_rx_queues(dev))
goto free_all;
#endif

> Don't put #ifdef in drivers, it's unmaintainable over time, if this really is 
> a sysfs-
> only function, this should already be handled automatically in a .h file
> somewhere.

OK, I will move the #ifdef into hyperv_net.h.

Thanks,
- Haiyang

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: winbond: use dev_err() instead of printk()

2014-05-08 Thread Dan Carpenter
On Thu, May 08, 2014 at 01:38:33PM +0200, Martin Kepplinger wrote:
> For obvious error messages, use dev_err() in order to provide userspace
> with more useful information and use the common kernel coding style.
> 
> Signed-off-by: Martin Kepplinger 
> ---
> this applies to v3.15-rc4
> 

Do these kinds of patches against linux-next.  This patch applies fine
so it's not a worry.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: winbond: use dev_err() instead of printk()

2014-05-08 Thread Martin Kepplinger
For obvious error messages, use dev_err() in order to provide userspace
with more useful information and use the common kernel coding style.

Signed-off-by: Martin Kepplinger 
---
this applies to v3.15-rc4

greetings from Linuxdays Vienna, Austria

 drivers/staging/winbond/wb35tx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 708c5b0..870cff3 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -49,7 +49,7 @@ static void Wb35Tx_complete(struct urb *pUrb)
 
/* The URB is completed, check the result */
if (pWb35Tx->EP4VM_status != 0) {
-   printk("URB submission failed\n");
+   dev_err(&pUrb->dev->dev, "URB submission failed\n");
pWb35Tx->EP4vm_state = VM_STOP;
goto error;
}
@@ -96,7 +96,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
pWb35Tx->EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
if (retv < 0) {
-   printk("EP4 Tx Irp sending error\n");
+   dev_err(&pUrb->dev->dev, "EP4 Tx Irp sending error\n");
goto cleanup;
}
 
@@ -218,7 +218,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
 
/* The Urb is completed, check the result */
if (pWb35Tx->EP2VM_status != 0) {
-   printk("EP2 IoCompleteRoutine return error\n");
+   dev_err(&pUrb->dev->dev, "EP2 IoCompleteRoutine return 
error\n");
pWb35Tx->EP2vm_state = VM_STOP;
goto error;
}
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: lirc: Fix sparse warnings

2014-05-08 Thread Dan Carpenter
On Thu, May 08, 2014 at 02:13:17PM +0300, Tuomas Tynkkynen wrote:
> Fix sparse warnings by adding __user and __iomem annotations where
> necessary and removing certain unnecessary casts. While at it,
> also use u32 in place of __u32.
> 
> Signed-off-by: Tuomas Tynkkynen 

Thanks.

Reviewed-by: Dan Carpenter 

Btw, don't resend this (someone will have to fix it in a later patch)
but I notice that these IOCTLs are not implemented consistently.  Even
outside of staging we have this problem.  For example lirc_rx51_ioctl().

In this function the user gets a u32.

>   case LIRC_GET_FEATURES:
> - result = put_user(features, (__u32 *) arg);
> + result = put_user(features, uptr);
>   if (result)
>   return result;
>   break;

But here they get a long.

>   case LIRC_GET_FEATURES:
> - result = put_user(features, (unsigned long *) arg);
> + result = put_user(features, uptr);
>   break;

My feeling it should always be u32 so we don't have to write a
compatability layer for 32 bit applications on a 64 bit kernel.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: lirc: Fix sparse warnings

2014-05-08 Thread Tuomas Tynkkynen
Fix sparse warnings by adding __user and __iomem annotations where
necessary and removing certain unnecessary casts. While at it,
also use u32 in place of __u32.

Signed-off-by: Tuomas Tynkkynen 
---
 Compile tested only.
 v2 changes:
   - introduce variable 'uptr' instead of open-coding (__u32 *)arg everywhere
   - replaces __u32 with u32
   - passes checkpatch --strict
 drivers/staging/media/lirc/lirc_bt829.c|6 ++---
 drivers/staging/media/lirc/lirc_parallel.c |   26 --
 drivers/staging/media/lirc/lirc_serial.c   |   11 +-
 drivers/staging/media/lirc/lirc_sir.c  |   33 ++--
 drivers/staging/media/lirc/lirc_zilog.c|   23 +--
 5 files changed, 52 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_bt829.c 
b/drivers/staging/media/lirc/lirc_bt829.c
index 30edc74..fe01054 100644
--- a/drivers/staging/media/lirc/lirc_bt829.c
+++ b/drivers/staging/media/lirc/lirc_bt829.c
@@ -64,7 +64,7 @@ static bool debug;
 
 static int atir_minor;
 static phys_addr_t pci_addr_phys;
-static unsigned char *pci_addr_lin;
+static unsigned char __iomem *pci_addr_lin;
 
 static struct lirc_driver atir_driver;
 
@@ -382,7 +382,7 @@ static unsigned char do_get_bits(void)
 
 static unsigned int read_index(unsigned char index)
 {
-   unsigned char *addr;
+   unsigned char __iomem *addr;
unsigned int value;
/*  addr = pci_addr_lin + DATA_PCI_OFF + ((index & 0xFF) << 2); */
addr = pci_addr_lin + ((index & 0xFF) << 2);
@@ -392,7 +392,7 @@ static unsigned int read_index(unsigned char index)
 
 static void write_index(unsigned char index, unsigned int reg_val)
 {
-   unsigned char *addr;
+   unsigned char __iomem *addr;
addr = pci_addr_lin + ((index & 0xFF) << 2);
writel(reg_val, addr);
 }
diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index 62f5137..1394f02 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -324,7 +324,8 @@ static loff_t lirc_lseek(struct file *filep, loff_t offset, 
int orig)
return -ESPIPE;
 }
 
-static ssize_t lirc_read(struct file *filep, char *buf, size_t n, loff_t *ppos)
+static ssize_t lirc_read(struct file *filep, char __user *buf, size_t n,
+loff_t *ppos)
 {
int result = 0;
int count = 0;
@@ -362,7 +363,7 @@ static ssize_t lirc_read(struct file *filep, char *buf, 
size_t n, loff_t *ppos)
return count ? count : result;
 }
 
-static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
+static ssize_t lirc_write(struct file *filep, const char __user *buf, size_t n,
  loff_t *ppos)
 {
int count;
@@ -463,43 +464,44 @@ static unsigned int lirc_poll(struct file *file, 
poll_table *wait)
 static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
int result;
-   __u32 features = LIRC_CAN_SET_TRANSMITTER_MASK |
-LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
-   __u32 mode;
-   __u32 value;
+   u32 __user *uptr = (u32 __user *)arg;
+   u32 features = LIRC_CAN_SET_TRANSMITTER_MASK |
+  LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
+   u32 mode;
+   u32 value;
 
switch (cmd) {
case LIRC_GET_FEATURES:
-   result = put_user(features, (__u32 *) arg);
+   result = put_user(features, uptr);
if (result)
return result;
break;
case LIRC_GET_SEND_MODE:
-   result = put_user(LIRC_MODE_PULSE, (__u32 *) arg);
+   result = put_user(LIRC_MODE_PULSE, uptr);
if (result)
return result;
break;
case LIRC_GET_REC_MODE:
-   result = put_user(LIRC_MODE_MODE2, (__u32 *) arg);
+   result = put_user(LIRC_MODE_MODE2, uptr);
if (result)
return result;
break;
case LIRC_SET_SEND_MODE:
-   result = get_user(mode, (__u32 *) arg);
+   result = get_user(mode, uptr);
if (result)
return result;
if (mode != LIRC_MODE_PULSE)
return -EINVAL;
break;
case LIRC_SET_REC_MODE:
-   result = get_user(mode, (__u32 *) arg);
+   result = get_user(mode, uptr);
if (result)
return result;
if (mode != LIRC_MODE_MODE2)
return -ENOSYS;
break;
case LIRC_SET_TRANSMITTER_MASK:
-   result = get_user(value, (__u32 *) arg);
+   result = get_user(value, uptr);
if (result)
return result;
if ((value & LIRC_PARALLEL_TR

Re: [PATCH] staging: lirc: Fix sparse warnings

2014-05-08 Thread Dan Carpenter
On Thu, May 08, 2014 at 01:30:28PM +0300, Dan Carpenter wrote:
> On Thu, May 08, 2014 at 01:11:48PM +0300, Tuomas Tynkkynen wrote:
> > Fix sparse warnings by adding __user and __iomem annotations where
> > necessary and removing certain unnecessary casts.
> > 
> > Signed-off-by: Tuomas Tynkkynen 
> 
> This patch adds spaces between the cast and the variable.  There
> shouldn't be a cast.
 
I meant space.  There shouldn't be a space.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lirc: Fix sparse warnings

2014-05-08 Thread Dan Carpenter
On Thu, May 08, 2014 at 01:11:48PM +0300, Tuomas Tynkkynen wrote:
> Fix sparse warnings by adding __user and __iomem annotations where
> necessary and removing certain unnecessary casts.
> 
> Signed-off-by: Tuomas Tynkkynen 

This patch adds spaces between the cast and the variable.  There
shouldn't be a cast.  That rule is so people remember that casting is a
high precedence operation.

Joe recently added a check for cast spacing to ./scripts/checkpatch.pl
--strict.  Run your patch through ./scripts/checkpatch.pl --strict and
fix the warnings.

> @@ -470,36 +471,36 @@ static long lirc_ioctl(struct file *filep, unsigned int 
> cmd, unsigned long arg)
>  
>   switch (cmd) {
>   case LIRC_GET_FEATURES:
> - result = put_user(features, (__u32 *) arg);
> + result = put_user(features, (__u32 __user *) arg);

arg is alway a u32 __user pointer.  Do this at the start of the
function.

u32 __user *uptr = (u32 __user *)arg;

Then replace all the "arg" references with "uptr".  Btw, the difference
between __u32 and u32 is that __u32 is for code which is shared with
user space and u32 is only allowed in kernel code.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lirc: Fix sparse warnings

2014-05-08 Thread Tuomas Tynkkynen
Fix sparse warnings by adding __user and __iomem annotations where
necessary and removing certain unnecessary casts.

Signed-off-by: Tuomas Tynkkynen 
---
Compile tested only.
 drivers/staging/media/lirc/lirc_bt829.c|6 +++---
 drivers/staging/media/lirc/lirc_parallel.c |   17 +
 drivers/staging/media/lirc/lirc_serial.c   |8 
 drivers/staging/media/lirc/lirc_sir.c  |   18 +-
 drivers/staging/media/lirc/lirc_zilog.c|   20 +++-
 5 files changed, 36 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_bt829.c 
b/drivers/staging/media/lirc/lirc_bt829.c
index 30edc74..fe01054 100644
--- a/drivers/staging/media/lirc/lirc_bt829.c
+++ b/drivers/staging/media/lirc/lirc_bt829.c
@@ -64,7 +64,7 @@ static bool debug;
 
 static int atir_minor;
 static phys_addr_t pci_addr_phys;
-static unsigned char *pci_addr_lin;
+static unsigned char __iomem *pci_addr_lin;
 
 static struct lirc_driver atir_driver;
 
@@ -382,7 +382,7 @@ static unsigned char do_get_bits(void)
 
 static unsigned int read_index(unsigned char index)
 {
-   unsigned char *addr;
+   unsigned char __iomem *addr;
unsigned int value;
/*  addr = pci_addr_lin + DATA_PCI_OFF + ((index & 0xFF) << 2); */
addr = pci_addr_lin + ((index & 0xFF) << 2);
@@ -392,7 +392,7 @@ static unsigned int read_index(unsigned char index)
 
 static void write_index(unsigned char index, unsigned int reg_val)
 {
-   unsigned char *addr;
+   unsigned char __iomem *addr;
addr = pci_addr_lin + ((index & 0xFF) << 2);
writel(reg_val, addr);
 }
diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index 62f5137..ea11fbb 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -324,7 +324,8 @@ static loff_t lirc_lseek(struct file *filep, loff_t offset, 
int orig)
return -ESPIPE;
 }
 
-static ssize_t lirc_read(struct file *filep, char *buf, size_t n, loff_t *ppos)
+static ssize_t lirc_read(struct file *filep, char __user *buf, size_t n,
+loff_t *ppos)
 {
int result = 0;
int count = 0;
@@ -362,7 +363,7 @@ static ssize_t lirc_read(struct file *filep, char *buf, 
size_t n, loff_t *ppos)
return count ? count : result;
 }
 
-static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
+static ssize_t lirc_write(struct file *filep, const char __user *buf, size_t n,
  loff_t *ppos)
 {
int count;
@@ -470,36 +471,36 @@ static long lirc_ioctl(struct file *filep, unsigned int 
cmd, unsigned long arg)
 
switch (cmd) {
case LIRC_GET_FEATURES:
-   result = put_user(features, (__u32 *) arg);
+   result = put_user(features, (__u32 __user *) arg);
if (result)
return result;
break;
case LIRC_GET_SEND_MODE:
-   result = put_user(LIRC_MODE_PULSE, (__u32 *) arg);
+   result = put_user(LIRC_MODE_PULSE, (__u32 __user *) arg);
if (result)
return result;
break;
case LIRC_GET_REC_MODE:
-   result = put_user(LIRC_MODE_MODE2, (__u32 *) arg);
+   result = put_user(LIRC_MODE_MODE2, (__u32 __user *) arg);
if (result)
return result;
break;
case LIRC_SET_SEND_MODE:
-   result = get_user(mode, (__u32 *) arg);
+   result = get_user(mode, (__u32 __user *) arg);
if (result)
return result;
if (mode != LIRC_MODE_PULSE)
return -EINVAL;
break;
case LIRC_SET_REC_MODE:
-   result = get_user(mode, (__u32 *) arg);
+   result = get_user(mode, (__u32 __user *) arg);
if (result)
return result;
if (mode != LIRC_MODE_MODE2)
return -ENOSYS;
break;
case LIRC_SET_TRANSMITTER_MASK:
-   result = get_user(value, (__u32 *) arg);
+   result = get_user(value, (__u32 __user *) arg);
if (result)
return result;
if ((value & LIRC_PARALLEL_TRANSMITTER_MASK) != value)
diff --git a/drivers/staging/media/lirc/lirc_serial.c 
b/drivers/staging/media/lirc/lirc_serial.c
index 10c685d..5fced89 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -1020,7 +1020,7 @@ static long lirc_ioctl(struct file *filep, unsigned int 
cmd, unsigned long arg)
 
result = put_user(LIRC_SEND2MODE
  (hardware[type].features&LIRC_CAN_SEND_MASK),
- (__u32 *) arg);
+ (__u32

Re: [patch v2] Documentation/email-clients.txt: add a section about git

2014-05-08 Thread Hillf Danton
On Thu, May 8, 2014 at 5:05 PM, Julian Andres Klode  wrote:
> On Thu, May 08, 2014 at 11:44:12AM +0300, Dan Carpenter wrote:
>> +as raw text including all the headers.  Run `cat raw_email.txt | git am`
>
> `cat raw_email.txt | git am` seems a bit pointless. Why not simply
> `git am raw_email.txt`? `git am < raw_email.txt` does the same too
> and avoids the useless cat as well.
>
> No point in running two processes when the same can be done in a
> simpler way in one process, IMO.
>
And this helps most developers little, but is more valuable for those who
dont use 'git send-mail' everyday if the detail of cmdline is provided, say
send a patch file with 'git send-mail' through gmail.

We will say double thanks to you, Dan, if you really help us tame gmail.

And a howto to tame gmail is doule apprecaited.

thanks
Hillf
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: gdm72xx Fix minor coding style problems

2014-05-08 Thread Joe Perches
On Thu, 2014-05-08 at 11:53 +0530, Adithya K wrote:
> This is patch for fixing of minor coding style problems.
[]
> diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
> b/drivers/staging/gdm72xx/gdm_qos.c
[]
> @@ -229,6 +229,7 @@ static u32 extract_qos_list(struct nic *nic, struct 
> list_head *head)
>   entry = list_entry(
>   qcb->qos_list[i].prev,
>   struct qos_entry_s, list);
> +
>   list_move_tail(&entry->list, head);

That one is a checkpatch defect.

The list_entry( use is really ugly too
with bad indentation on the following line.

Look at the entire function:

static u32 extract_qos_list(struct nic *nic, struct list_head *head)
{
struct qos_cb_s *qcb = &nic->qos;
struct qos_entry_s *entry;
int i;

INIT_LIST_HEAD(head);

for (i = 0; i < QOS_MAX; i++) {
if (qcb->csr[i].enabled) {
if (qcb->csr[i].qos_buf_count < qcb->qos_limit_size) {
if (!list_empty(&qcb->qos_list[i])) {
entry = list_entry(
qcb->qos_list[i].prev,
struct qos_entry_s, list);
list_move_tail(&entry->list, head);
qcb->csr[i].qos_buf_count++;

if (!list_empty(&qcb->qos_list[i]))
netdev_warn(nic->netdev,
"Index(%d) is 
piled!!\n",
i);
}
}
}
}

return 0;
}

Please consider rewriting the function
to reduce unnecessary indentation.

Something like:

static u32 extract_qos_list(struct nic *nic, struct list_head *head)
{
struct qos_cb_s *qcb = &nic->qos;
int i;

INIT_LIST_HEAD(head);

for (i = 0; i < QOS_MAX; i++) {
if (!qcb->csr[i].enabled ||
qcb->csr[i].qos_buf_count >= qcb->qos_limit_size)
continue;

if (!list_empty(&qcb->qos_list[i])) {
struct qos_entry_s *entry;

entry = list_entry(qcb->qos_list[i].prev,
   struct qos_entry_s, list);
list_move_tail(&entry->list, head);
qcb->csr[i].qos_buf_count++;

if (!list_empty(&qcb->qos_list[i]))
netdev_warn(nic->netdev, "Index(%d) is 
piled!!\n",
i);
}
}

return 0;
}


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net-next] Add support for netvsc build without CONFIG_SYSFS flag

2014-05-08 Thread Greg KH
On Wed, May 07, 2014 at 03:45:04PM -0700, Haiyang Zhang wrote:
> This change ensures the driver can be built successfully without the
> CONFIG_SYSFS flag.
> MS-TFS: 182270
> 
> Signed-off-by: Haiyang Zhang 
> Reviewed-by: K. Y. Srinivasan 
> ---
>  drivers/net/hyperv/hyperv_net.h   |2 ++
>  drivers/net/hyperv/netvsc_drv.c   |   12 +++-
>  drivers/net/hyperv/rndis_filter.c |4 ++--
>  3 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index 4b7df5a..23b96bc 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /* 
> NDIS_RECEIVE_SCALE_CAPABILITIES */
>  #define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
>  extern u8 netvsc_hash_key[];
>  
> +extern unsigned int netvsc_num_queue;
> +
>  struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
>   struct ndis_obj_header hdr;
>  
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 939e3af..07896f3 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -52,6 +52,8 @@ static int ring_size = 128;
>  module_param(ring_size, int, S_IRUGO);
>  MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
>  
> +unsigned int netvsc_num_queue = 1;
> +
>  static void do_set_multicast(struct work_struct *w)
>  {
>   struct net_device_context *ndevctx =
> @@ -639,9 +641,11 @@ int netvsc_recv_callback(struct hv_device *device_obj,
>   __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
>  packet->vlan_tci);
>  
> +#ifdef CONFIG_SYSFS
>   skb_record_rx_queue(skb, packet->channel->
>   offermsg.offer.sub_channel_index %
>   net->real_num_rx_queues);
> +#endif

Why is this a sysfs-only function?  It should have nothing to do with
sysfs, right?  So why would the driver care?

Don't put #ifdef in drivers, it's unmaintainable over time, if this
really is a sysfs-only function, this should already be handled
automatically in a .h file somewhere.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch v2] Documentation/email-clients.txt: add a section about git

2014-05-08 Thread Julian Andres Klode
On Thu, May 08, 2014 at 11:44:12AM +0300, Dan Carpenter wrote:
> +as raw text including all the headers.  Run `cat raw_email.txt | git am`

`cat raw_email.txt | git am` seems a bit pointless. Why not simply
`git am raw_email.txt`? `git am < raw_email.txt` does the same too
and avoids the useless cat as well. 

No point in running two processes when the same can be done in a
simpler way in one process, IMO.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Please do not top-post if possible.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch v2] Documentation/email-clients.txt: add a section about git

2014-05-08 Thread Dan Carpenter
These days most people use git to send patches so I have added a section
about that.

Signed-off-by: Dan Carpenter 
---
v2: Fixed changelog

diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
index 4e30eba..9004a5fd 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -1,6 +1,17 @@
 Email clients info for Linux
 ==
 
+Git
+--
+These days most developers use `git send-email` instead of regular
+email clients.  On the receiving end, maintainers use `git am` to
+apply the patches.
+
+If you are new to git then send your first patch to yourself.  Save it
+as raw text including all the headers.  Run `cat raw_email.txt | git am`
+and then review the changelog with `git log -p`.  When that works then
+send the patch to list.
+
 General Preferences
 --
 Patches for the Linux kernel are submitted via email, preferably as
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] mmc: rtsx: fix possible linking error if built-in

2014-05-08 Thread Ulf Hansson
On 8 May 2014 10:27, Arnd Bergmann  wrote:
> rtsx_usb_sdmmc module uses the LED classdev if available, but the code
> failed to consider the situation that it is built-in and the LED classdev is a
> module, leading to following linking error:
>
>LD  init/built-in.o
> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
> rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
> `led_classdev_unregister'
> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
> rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
> `led_classdev_register'
>
> Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.
>
> Signed-off-by: Roger Tseng 
> Signed-off-by: Arnd Bergmann 
> Acked-by: Ulf Hansson 
> ---
> v2 by Arnd: change the second #ifdef as well.

Thanks Arnd, Roger - I will include this one in PR that I send to
Chris in the next few days.

Kind regards
Ulf Hansson

>
> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c 
> b/drivers/mmc/host/rtsx_usb_sdmmc.c
> index e11fafa..5d3766e 100644
> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
> @@ -34,7 +34,8 @@
>  #include 
>  #include 
>
> -#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> +#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
> +   defined(CONFIG_MMC_REALTEK_USB_MODULE))
>  #include 
>  #include 
>  #define RTSX_USB_USE_LEDS_CLASS
> @@ -59,7 +60,7 @@ struct rtsx_usb_sdmmc {
>
> unsigned char   power_mode;
>
> -#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> +#ifdef RTSX_USB_USE_LEDS_CLASS
> struct led_classdev led;
> charled_name[32];
> struct work_struct  led_work;
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] mmc: rtsx: usb backend needs LED support

2014-05-08 Thread Ulf Hansson
>>>
>>> From: Roger Tseng 
>>> Date: Wed, 30 Apr 2014 11:11:25 +0800
>>> Subject: [PATCH] mmc: rtsx: fix possible linking error if built-in
>>>
>>> rtsx_usb_sdmmc module uses the LED classdev if available, but the code
>>> failed
>>> to consider the situation that it is built-in and the LED classdev is a
>>> module,
>>> leading to following linking error:
>>>
>>>LD  init/built-in.o
>>> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
>>> rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
>>> `led_classdev_unregister'
>>> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
>>> rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
>>> `led_classdev_register'
>>>
>>> Fix by excluding such condition when defining macro
>>> RTSX_USB_USE_LEDS_CLASS.
>>>
>>> Signed-off-by: Roger Tseng 
>>
>>
>> Acked-by: Ulf Hansson 
>>
>
> Would this patch be merged into linux-next or Lee's mfd.git
> ib-mfd-mmc-memstick-3.16 branch?

This is for Chris' tree.

Kind regards
Ulf Hansson

>
> By the way, should I resend my version?
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] mmc: rtsx: usb backend needs LED support

2014-05-08 Thread Lee Jones
> >>From: Roger Tseng 
> >>Date: Wed, 30 Apr 2014 11:11:25 +0800
> >>Subject: [PATCH] mmc: rtsx: fix possible linking error if built-in
> >>
> >>rtsx_usb_sdmmc module uses the LED classdev if available, but the code
> >>failed
> >>to consider the situation that it is built-in and the LED classdev is a
> >>module,
> >>leading to following linking error:
> >>
> >>   LD  init/built-in.o
> >>drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
> >>rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
> >>`led_classdev_unregister'
> >>drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
> >>rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
> >>`led_classdev_register'
> >>
> >>Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.
> >>
> >>Signed-off-by: Roger Tseng 
> >
> >Acked-by: Ulf Hansson 
> 
> Would this patch be merged into linux-next or Lee's mfd.git
> ib-mfd-mmc-memstick-3.16 branch?

This patch doesn't have anything to do with MFD.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] mmc: rtsx: fix possible linking error if built-in

2014-05-08 Thread Arnd Bergmann
rtsx_usb_sdmmc module uses the LED classdev if available, but the code
failed to consider the situation that it is built-in and the LED classdev is a
module, leading to following linking error:

   LD  init/built-in.o
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
`led_classdev_unregister'
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
`led_classdev_register'

Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.

Signed-off-by: Roger Tseng 
Signed-off-by: Arnd Bergmann 
Acked-by: Ulf Hansson 
---
v2 by Arnd: change the second #ifdef as well.

diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c 
b/drivers/mmc/host/rtsx_usb_sdmmc.c
index e11fafa..5d3766e 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -34,7 +34,8 @@
 #include 
 #include 
 
-#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
+#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
+   defined(CONFIG_MMC_REALTEK_USB_MODULE))
 #include 
 #include 
 #define RTSX_USB_USE_LEDS_CLASS
@@ -59,7 +60,7 @@ struct rtsx_usb_sdmmc {
 
unsigned char   power_mode;
 
-#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
+#ifdef RTSX_USB_USE_LEDS_CLASS
struct led_classdev led;
charled_name[32];
struct work_struct  led_work;

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] mmc: rtsx: usb backend needs LED support

2014-05-08 Thread Arnd Bergmann
On Thursday 08 May 2014 16:08:15 Roger wrote:
> 
> Would this patch be merged into linux-next or Lee's mfd.git 
> ib-mfd-mmc-memstick-3.16 branch?

It should get merged into whatever tree holds the existing patches, yes

> By the way, should I resend my version?

Actually I found another issue with it and fixed it up here, let me
send the version that works for me.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req"

2014-05-08 Thread Lee Jones
> >> This reverts commit c42deffd5b53c9e583d83c7964854ede2f12410d.
> >>
> >> commit  did use
> >> mutex_unlock() in tasklet, but mutex_unlock() can't used in
> >> tasklet(atomic context). The driver need use mutex to avoid concurrency,
> >> so we can't use tasklet here, the patch need to be removed.
> >>
> >> The spinlock host->lock and pcr->lock may deadlock, one way to solve the
> >> deadlock is remove host->lock in sd_isr_done_transfer(), but if using
> >> workqueue the we can avoid using the spinlock and also avoid the problem.
> >>
> >> Signed-off-by: Micky Ching 
> >
> > Acked-by: Ulf Hansson 
> 
> Hi Lee,
> 
> Would you mind to pick this up and send it for 3.15 fixes?
> 
> The other revert "[PATCH 1/2] mmc: rtsx: Revert "mmc: rtsx: modify
> error handle and remove smatch warnings", needs to go through the mmc
> tree.

Sent.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] mmc: rtsx: Revert "mmc: rtsx: modify error handleandremove smatch warnings"

2014-05-08 Thread Ulf Hansson
On 8 May 2014 09:55, Lee Jones  wrote:
>> It seems Chris is too busy to responding, so would you help to pick
>> this patch for 3.15 fix.
>
> H... that's pretty bad timing.  I've literally just sent the
> pull-request containing the MFD/MMC fixup branch to Linus.  I guess
> Ulf will have to do it.

There seem to be some confusion here. :-)

This patch is _only_ intended for Chris' mmc_next branch, so it
shouldn't go for 3.15 fixes. Or better, Chris should drop the patch
this one is reverting.

Likely we will see a merge problem in Stephen Rothwell's linux-next
tree, until Chris' drops this patch - causing Stephen to not merge the
mmc tree for a while. I suppose that's the best we can do, until Chris
shows up again.

Kind regards
Ulf Hansson

>
>> >>>From: Micky Ching
>> >>>
>> >>>This reverts commit 1f7b581b3ffcb2a8437397a02f4af89fa6934d08.
>> >>>
>> >>>The patch depend on commit c42deffd5b53c9e583d83c7964854ede2f12410d
>> >>>, but the previous
>> >>>patch was discard. So we have to delete the patch.
>> >>>
>> >>>Signed-off-by: Micky Ching
>> >Acked-by: Ulf Hansson
>>
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] mmc: rtsx: Revert "mmc: rtsx: modify error handleandremove smatch warnings"

2014-05-08 Thread Lee Jones
> It seems Chris is too busy to responding, so would you help to pick
> this patch for 3.15 fix.

H... that's pretty bad timing.  I've literally just sent the
pull-request containing the MFD/MMC fixup branch to Linus.  I guess
Ulf will have to do it.

> >>>From: Micky Ching
> >>>
> >>>This reverts commit 1f7b581b3ffcb2a8437397a02f4af89fa6934d08.
> >>>
> >>>The patch depend on commit c42deffd5b53c9e583d83c7964854ede2f12410d
> >>>, but the previous
> >>>patch was discard. So we have to delete the patch.
> >>>
> >>>Signed-off-by: Micky Ching
> >Acked-by: Ulf Hansson
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] mmc: rtsx: usb backend needs LED support

2014-05-08 Thread Roger


On 04/30/2014 04:19 PM, Ulf Hansson wrote:

On 30 April 2014 05:34, Roger  wrote:


On 04/29/2014 08:46 PM, Arnd Bergmann wrote:


On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote:


On 29 April 2014 11:45, Arnd Bergmann  wrote:


drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
:(.text+0x806480): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
:(.text+0x806708): undefined reference to `led_classdev_register'

This adds an explicit dependency in Kconfig



I think the proper solution is to fix the dependency in the driver code
instead.

There are already some ifdefs hackery for making it optional to use
leds, apparently that's not working properly.



Ah, right, I misinterpreted the bug. Here is a new version:

8<-


 From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001


From: Arnd Bergmann 
Date: Tue, 29 Apr 2014 11:41:40 +0200
Subject: [PATCH] mmc: rtsx: usb backend needs LED support

Building the rtsx USB driver uses the LED classdev base
support if available, but that fails if the classdev
is a module and the MMC driver is built-in, leading to this
link error.

drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
:(.text+0x806480): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
:(.text+0x806708): undefined reference to `led_classdev_register'

This adds an explicit dependency in Kconfig to ensure that
the MMC driver has to be a module if LEDS_CLASS is a module,
but still allows it to be built-in if LEDS_CLASS is either
disabled or built-in.

Signed-off-by: Arnd Bergmann 

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 92d91fe..68da9b8 100644

--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -696,6 +696,7 @@ config MMC_REALTEK_PCI
   config MMC_REALTEK_USB
 tristate "Realtek USB SD/MMC Card Interface Driver"
 depends on MFD_RTSX_USB
+   depends on m || LEDS_CLASS!=m

 help
   Say Y here to include driver code to support SD/MMC card
interface
   of Realtek RTS5129/39 series card reader

.



I think Ulf's idea is to fix the bug by modifying the .c files.
I really found the problem of my ifdef hackery and it should do something
similar in sdhci.c as:

From: Roger Tseng 
Date: Wed, 30 Apr 2014 11:11:25 +0800
Subject: [PATCH] mmc: rtsx: fix possible linking error if built-in

rtsx_usb_sdmmc module uses the LED classdev if available, but the code
failed
to consider the situation that it is built-in and the LED classdev is a
module,
leading to following linking error:

   LD  init/built-in.o
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
`led_classdev_unregister'
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
`led_classdev_register'

Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.

Signed-off-by: Roger Tseng 


Acked-by: Ulf Hansson 



Would this patch be merged into linux-next or Lee's mfd.git 
ib-mfd-mmc-memstick-3.16 branch?


By the way, should I resend my version?


---
  drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c
b/drivers/mmc/host/rtsx_usb_sdmmc.c
index e11fafa..38bdda5 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -34,7 +34,8 @@
  #include 
  #include 

-#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
+#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
+   defined(CONFIG_MMC_REALTEK_USB_MODULE))
  #include 
  #include 
  #define RTSX_USB_USE_LEDS_CLASS



Best regards,
Roger Tseng
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: gdm72xx Fix minor coding style problems

2014-05-08 Thread Dan Carpenter
On Wed, May 07, 2014 at 11:40:50PM -0700, Joe Perches wrote:
> On Thu, 2014-05-08 at 11:53 +0530, Adithya K wrote:
> > This is patch for fixing of minor coding style problems.
> []
> > diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
> > b/drivers/staging/gdm72xx/gdm_qos.c
> []
> > @@ -229,6 +229,7 @@ static u32 extract_qos_list(struct nic *nic, struct 
> > list_head *head)
> > entry = list_entry(
> > qcb->qos_list[i].prev,
> > struct qos_entry_s, list);
> > +
> > list_move_tail(&entry->list, head);
> 
> That one is a checkpatch defect.
> 
> The list_entry( use is really ugly too
> with bad indentation on the following line.
> 
> Look at the entire function:
> 
> static u32 extract_qos_list(struct nic *nic, struct list_head *head)
> {
>   struct qos_cb_s *qcb = &nic->qos;
>   struct qos_entry_s *entry;
>   int i;
> 
>   INIT_LIST_HEAD(head);
> 
>   for (i = 0; i < QOS_MAX; i++) {
>   if (qcb->csr[i].enabled) {
>   if (qcb->csr[i].qos_buf_count < qcb->qos_limit_size) {
>   if (!list_empty(&qcb->qos_list[i])) {
>   entry = list_entry(
>   qcb->qos_list[i].prev,
>   struct qos_entry_s, list);
>   list_move_tail(&entry->list, head);
>   qcb->csr[i].qos_buf_count++;
> 
>   if (!list_empty(&qcb->qos_list[i]))
>   netdev_warn(nic->netdev,
>   "Index(%d) is 
> piled!!\n",
>   i);
>   }
>   }
>   }
>   }
> 
>   return 0;
> }
> 
> Please consider rewriting the function
> to reduce unnecessary indentation.
> 
> Something like:
> 
> static u32 extract_qos_list(struct nic *nic, struct list_head *head)
> {
>   struct qos_cb_s *qcb = &nic->qos;
>   int i;
> 
>   INIT_LIST_HEAD(head);
> 
>   for (i = 0; i < QOS_MAX; i++) {
>   if (!qcb->csr[i].enabled ||
>   qcb->csr[i].qos_buf_count >= qcb->qos_limit_size)
>   continue;
> 
>   if (!list_empty(&qcb->qos_list[i])) {

You could flip this one around as well.

if (list_empty(&qcb->qos_list[i])
continue;

Move the rest in one indent level.

>   struct qos_entry_s *entry;
> 
>   entry = list_entry(qcb->qos_list[i].prev,
>  struct qos_entry_s, list);
>   list_move_tail(&entry->list, head);
>   qcb->csr[i].qos_buf_count++;
> 
>   if (!list_empty(&qcb->qos_list[i]))
>   netdev_warn(nic->netdev, "Index(%d) is 
> piled!!\n",
>   i);
>   }
>   }

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: gdm72xx Fix minor coding style problems

2014-05-08 Thread Dan Carpenter
On Thu, May 08, 2014 at 11:53:57AM +0530, Adithya K wrote:
> This is patch for fixing of minor coding style problems.
> 
> Signed-off-by: Adithya K 
> ---
>  drivers/staging/gdm72xx/gdm_qos.c   |3 ++-
>  drivers/staging/gdm72xx/gdm_sdio.c  |1 +
>  drivers/staging/gdm72xx/gdm_usb.c   |2 +-
>  drivers/staging/gdm72xx/gdm_wimax.c |3 +++
>  drivers/staging/gdm72xx/usb_boot.c  |1 +
>  5 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
> b/drivers/staging/gdm72xx/gdm_qos.c
> index 50d43ad..5ed32b9 100644
> --- a/drivers/staging/gdm72xx/gdm_qos.c
> +++ b/drivers/staging/gdm72xx/gdm_qos.c
> @@ -229,6 +229,7 @@ static u32 extract_qos_list(struct nic *nic, struct 
> list_head *head)
>   entry = list_entry(
>   qcb->qos_list[i].prev,
>   struct qos_entry_s, list);
> +
>   list_move_tail(&entry->list, head);
>   qcb->csr[i].qos_buf_count++;
>  

This one is wrong.  It's not something I care about but since the patch
needs to be redone, then please leave it out.

> diff --git a/drivers/staging/gdm72xx/gdm_usb.c 
> b/drivers/staging/gdm72xx/gdm_usb.c
> index 20539d8..8fd1b1f 100644
> --- a/drivers/staging/gdm72xx/gdm_usb.c
> +++ b/drivers/staging/gdm72xx/gdm_usb.c
> @@ -759,7 +759,7 @@ static int k_mode_thread(void *arg)
>   spin_lock_irqsave(&k_lock, flags2);
>   }
>   wait_event_interruptible_lock_irq(k_wait,
> -   !list_empty(&k_list) || 
> k_mode_stop,
> + !list_empty(&k_list) || k_mode_stop,
> k_lock);
>   spin_unlock_irqrestore(&k_lock, flags2);
>   }

This one is totally wrong.  Please resend withouth this chunk.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel