Re: [PATCH v7 1/3] staging: typec: USB Type-C Port Manager (tcpm)

2017-04-28 Thread Greg Kroah-Hartman
On Thu, Apr 27, 2017 at 02:09:56PM -0700, Guenter Roeck wrote:
> --- /dev/null
> +++ b/drivers/staging/typec/pd.h
> @@ -0,0 +1,281 @@
> +/*
> + * Copyright 2015-2017 Google, Inc
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.

I have to ask, you really mean "any later version", for all of these
patches, right?

thanks,

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


Re: [PATCH] ion: Fixed initialization of static variable to 0

2017-04-28 Thread Greg KH
On Thu, Apr 27, 2017 at 07:29:53PM -0400, Fabrizio Perria wrote:
> From: Fabrizio 

I need a full name here.

> 
> Signed-off-by: Fabrizio 

And here.

Also, I can not take patches without any changelog text, please fix, and
fix up your subject to say what part of the kernel you are working with
(look at other patches for this file...)

thanks,

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


Re: [PATCH] drivers: staging: lustre: lustre: llite: file.c - fixed sparse warning about different fmode_t type

2017-04-28 Thread Greg Kroah-Hartman
On Mon, Apr 24, 2017 at 07:53:11AM +0100, Andrea della Porta wrote:
> fixed a couple of sparse warning complaining about type mismatch.

That's really vague, please be specific.

> 
> Signed-off-by: Andrea della Porta 
> ---
>  drivers/staging/lustre/lustre/include/lustre_intent.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/include/lustre_intent.h 
> b/drivers/staging/lustre/lustre/include/lustre_intent.h
> index ed2b6c6..c036633 100644
> --- a/drivers/staging/lustre/lustre/include/lustre_intent.h
> +++ b/drivers/staging/lustre/lustre/include/lustre_intent.h
> @@ -38,7 +38,7 @@
>  struct lookup_intent {
>   int it_op;
>   int it_create_mode;
> - __u64   it_flags;
> + fmode_t it_flags;

Are you sure?  Why?  What exact warning did this "fix"?

thanks,

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


[PATCH] staging: rtl8188eu: embedded function name style fixes

2017-04-28 Thread Ian Chard
Replace a couple of function names embedded in trace messages
with __func__.  One of them had a typo anyway.

Signed-off-by: Ian Chard 
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 14979666dadd..9754322b506e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -1295,7 +1295,7 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter 
*padapter,  struct cmd_obj *pc
 
 
if (psta == NULL) {
-   RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: 
rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
+   RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: %s => 
can't get sta_info\n\n", __func__));
goto exit;
}
 exit:
@@ -1312,7 +1312,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter 
*padapter,  struct cmd_obj *
 
 
if (psta == NULL) {
-   RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: 
setassocsta_cmdrsp_callbac => can't get sta_info\n\n"));
+   RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: %s => 
can't get sta_info\n\n", __func__));
goto exit;
}
 
-- 
2.11.0

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


Re: [PATCH] staging: android: ion: fix QUOTED_WHITESPACE_BEFORE_NEWLINE

2017-04-28 Thread Greg KH
On Thu, Apr 27, 2017 at 04:59:40PM +0200, Juan Antonio Pedreira Martos wrote:
> Fix checkpatch warning: unnecessary whitespace before a quoted newline.
> 
> Signed-off-by: Juan Antonio Pedreira Martos 
> ---
>  drivers/staging/android/ion/ion_chunk_heap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Someone else just sent this same patch before you did, sorry.

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


Re: [Patch v4 1/2] staging/lustre: add parenthesis to macro argument

2017-04-28 Thread g...@kroah.com
On Wed, Apr 19, 2017 at 03:50:05PM +, Rishiraj Manwatkar wrote:
> Add parenthesis to cl_io_for_each() macro to avoid potential issues with
> unexpected argument expansion in CPP.
> 
> Signed-off-by: Rishiraj Manwatkar 
> ---
>  v1 -> v2: Added mailing list in cc.
>  v2 -> v3: Changed From: to be same as Signed-off-by:.
>  v3 -> v4: Changed Subject line and patch description as suggested by 
> andreas.dil...@intel.com
>  drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
> b/drivers/staging/lustre/lustre/obdclass/cl_io.c
> index ee7d677..0997254 100755
> --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
> +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
> @@ -52,9 +52,9 @@
>   */
>  
>  #define cl_io_for_each(slice, io) \
> - list_for_each_entry((slice), &io->ci_layers, cis_linkage)
> + list_for_each_entry((slice), &(io)->ci_layers, cis_linkage)
>  #define cl_io_for_each_reverse(slice, io) \
> - list_for_each_entry_reverse((slice), &io->ci_layers, cis_linkage)
> + list_for_each_entry_reverse((slice), &(io)->ci_layers, cis_linkage)

No, the original code is correct, that's going to be a variable only,
not any type of "complex argument".

thanks,

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


Re: [PATCH] staging: ks7010: Change capability field to __le16

2017-04-28 Thread Greg KH
On Tue, Apr 18, 2017 at 08:24:01PM +0200, Johan Svensson wrote:
> Change capability field to __le16 in struct ap_info_t,
> struct link_ap_info_t, and struct local_ap_t.
> This fixes a sparse warning.
> 
> Signed-off-by: Johan Svensson 
> ---
>  drivers/staging/ks7010/ks_hostif.h | 4 ++--
>  drivers/staging/ks7010/ks_wlan.h   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Based on the lack of testing of this, I'm going to drop it from my
queue.

thanks,

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


Re: [PATCH v3] staging: ks7010: fix block comment style

2017-04-28 Thread Greg Kroah-Hartman
On Wed, Apr 26, 2017 at 01:00:23PM +0200, Ilia Sergachev wrote:
> Checkpatch was showing:
> WARNING: Block comments use a trailing */ on a separate line.
> 
> Move trailing */ to a separate line.
> 
> Signed-off-by: Ilia Sergachev 
> Reviewed-by: Tobin C. Harding 

This patch does not apply to my tree at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 0/9] staging: Introduce Freescale DPAA2 Ethernet driver

2017-04-28 Thread Ioana Radulescu
This patchset introduces the Ethernet driver for Freescale/NXP SoCs
with DPAA2 (DataPath Acceleration Architecture v2). The driver manages
network objects discovered on the fsl-mc bus. A description of the
driver can be found in the associated README file.

The patchset consists of:
* A set of libraries containing APIs for configuring and controlling
Management Complex (MC) networking objects
* The DPAA2 Ethernet basic driver
* A couple of patches adding ethtool and debug support

v3 changes:
 - add contact info in TODO file
v2 changes:
 - update path of include header files since fsl-mc bus driver
   is still in staging
 - minor updates in patch #4 due to networking API changes

Ioana Radulescu (9):
  bus: fsl-mc: add DPCON object APIs
  staging: fsl-dpaa2/eth: Add Ethernet driver overview document
  staging: fsl-dpaa2/eth: Add APIs for DPNI objects
  staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver
  staging: fsl-dpaa2/eth: Add ethtool support
  staging: fsl-dpaa2/eth: Add driver specific stats
  staging: fsl-dpaa2/eth: Add trace points
  staging: fsl-dpaa2/eth: Add TODO file
  staging: fsl-dpaa2/eth: Add maintainer for Ethernet driver

 MAINTAINERS|6 +
 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/fsl-dpaa2/Kconfig  |   17 +
 drivers/staging/fsl-dpaa2/Makefile |5 +
 drivers/staging/fsl-dpaa2/ethernet/Makefile|   10 +
 drivers/staging/fsl-dpaa2/ethernet/README  |  186 ++
 drivers/staging/fsl-dpaa2/ethernet/TODO|   14 +
 .../staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h   |  185 ++
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2520 
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  348 +++
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c |  279 +++
 drivers/staging/fsl-dpaa2/ethernet/dpkg.h  |  176 ++
 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h  |  541 +
 drivers/staging/fsl-dpaa2/ethernet/dpni.c  | 1595 +
 drivers/staging/fsl-dpaa2/ethernet/dpni.h  |  832 +++
 drivers/staging/fsl-dpaa2/ethernet/net.h   |  480 
 drivers/staging/fsl-mc/bus/Makefile|3 +-
 drivers/staging/fsl-mc/bus/dpcon-cmd.h |   69 +-
 drivers/staging/fsl-mc/bus/dpcon.c |  317 +++
 drivers/staging/fsl-mc/include/dpcon.h |  115 +
 21 files changed, 7677 insertions(+), 24 deletions(-)
 create mode 100644 drivers/staging/fsl-dpaa2/Kconfig
 create mode 100644 drivers/staging/fsl-dpaa2/Makefile
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/Makefile
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/README
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpkg.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/net.h
 create mode 100644 drivers/staging/fsl-mc/bus/dpcon.c
 create mode 100644 drivers/staging/fsl-mc/include/dpcon.h

-- 
2.11.0

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


[PATCH v3 5/9] staging: fsl-dpaa2/eth: Add ethtool support

2017-04-28 Thread Ioana Radulescu
Add support for several ethtool operations: show hardware statistics,
get/set link settings, get hash configuration.

Signed-off-by: Ioana Radulescu 
Signed-off-by: Bogdan Hamciuc 
---
v3: no changes
v2: no changes

 drivers/staging/fsl-dpaa2/ethernet/Makefile|   2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |   6 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |   6 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 234 +
 4 files changed, 247 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c

diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile 
b/drivers/staging/fsl-dpaa2/ethernet/Makefile
index 4897d39a1c21..4327ebe803cb 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/Makefile
+++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o
 
-fsl-dpaa2-eth-objs:= dpaa2-eth.o dpni.o
+fsl-dpaa2-eth-objs:= dpaa2-eth.o dpaa2-ethtool.o dpni.o
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index abd700e57aeb..f13f72f3dd9a 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -46,6 +46,8 @@ MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Freescale Semiconductor, Inc");
 MODULE_DESCRIPTION("Freescale DPAA2 Ethernet Driver");
 
+const char dpaa2_eth_drv_version[] = "0.1";
+
 static void validate_rx_csum(struct dpaa2_eth_priv *priv,
 u32 fd_status,
 struct sk_buff *skb)
@@ -1929,6 +1931,8 @@ int dpaa2_eth_set_hash(struct net_device *net_dev, u64 
flags)
key->extract.from_hdr.type = DPKG_FULL_FIELD;
key->extract.from_hdr.field = hash_fields[i].cls_field;
cls_cfg.num_extracts++;
+
+   priv->rx_hash_fields |= hash_fields[i].rxnfc_field;
}
 
dma_mem = kzalloc(DPAA2_CLASSIFIER_DMA_SIZE, GFP_DMA | GFP_KERNEL);
@@ -2360,6 +2364,8 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
if (err)
goto err_alloc_rings;
 
+   net_dev->ethtool_ops = &dpaa2_ethtool_ops;
+
err = setup_irqs(dpni_dev);
if (err) {
netdev_warn(net_dev, "Failed to set link interrupt, fall back 
to polling\n");
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index 7b194a47df2f..b30231891eef 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -281,6 +281,9 @@ struct dpaa2_eth_priv {
struct dpni_link_state link_state;
bool do_link_poll;
struct task_struct *poll_thread;
+
+   /* enabled ethtool hashing bits */
+   u64 rx_hash_fields;
 };
 
 /* default Rx hash options, set during probing */
@@ -294,6 +297,9 @@ struct dpaa2_eth_priv {
 /* Required by struct dpni_rx_tc_dist_cfg::key_cfg_iova */
 #define DPAA2_CLASSIFIER_DMA_SIZE 256
 
+extern const struct ethtool_ops dpaa2_ethtool_ops;
+extern const char dpaa2_eth_drv_version[];
+
 int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags);
 
 static int dpaa2_eth_queue_count(struct dpaa2_eth_priv *priv)
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
new file mode 100644
index ..4378956a5527
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -0,0 +1,234 @@
+/* Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

[PATCH v3 9/9] staging: fsl-dpaa2/eth: Add maintainer for Ethernet driver

2017-04-28 Thread Ioana Radulescu
Signed-off-by: Ioana Radulescu 
---
v3: no changes
v2: Remove "Freescale" from the driver name 

 MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b38b42f96e6a..4368f67bb261 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4109,6 +4109,12 @@ L:   linux-ker...@vger.kernel.org
 S: Maintained
 F: drivers/staging/fsl-mc/bus/dpio
 
+DPAA2 ETHERNET DRIVER
+M: Ioana Radulescu 
+L: linux-ker...@vger.kernel.org
+S: Maintained
+F: drivers/staging/fsl-dpaa2/ethernet
+
 DPT_I2O SCSI RAID DRIVER
 M: Adaptec OEM Raid Solutions 
 L: linux-s...@vger.kernel.org
-- 
2.11.0

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


[PATCH v3 6/9] staging: fsl-dpaa2/eth: Add driver specific stats

2017-04-28 Thread Ioana Radulescu
Add custom statistics to be reported via ethtool -S. These include
driver specific per-cpu statistics as well as queue and channel
counters.

Signed-off-by: Ioana Radulescu 
---
v3: no changes
v2: no changes

 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 42 ++-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 36 
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 49 +-
 3 files changed, 123 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index f13f72f3dd9a..67f007bdbe79 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -208,6 +208,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
void *vaddr;
struct sk_buff *skb;
struct rtnl_link_stats64 *percpu_stats;
+   struct dpaa2_eth_drv_stats *percpu_extras;
struct device *dev = priv->net_dev->dev.parent;
struct dpaa2_fas *fas;
u32 status = 0;
@@ -219,6 +220,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
prefetch(vaddr + dpaa2_fd_get_offset(fd));
 
percpu_stats = this_cpu_ptr(priv->percpu_stats);
+   percpu_extras = this_cpu_ptr(priv->percpu_extras);
 
if (fd_format == dpaa2_fd_single) {
skb = build_linear_skb(priv, ch, fd, vaddr);
@@ -227,6 +229,8 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
vaddr + dpaa2_fd_get_offset(fd);
skb = build_frag_skb(priv, ch, sgt);
skb_free_frag(vaddr);
+   percpu_extras->rx_sg_frames++;
+   percpu_extras->rx_sg_bytes += dpaa2_fd_get_len(fd);
} else {
/* We don't support any other format */
goto err_frame_format;
@@ -291,6 +295,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch)
 
fd = dpaa2_dq_fd(dq);
fq = (struct dpaa2_eth_fq *)dpaa2_dq_fqd_ctx(dq);
+   fq->stats.frames++;
 
fq->consume(priv, ch, fd, &ch->napi);
cleaned++;
@@ -532,11 +537,13 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct 
net_device *net_dev)
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
struct dpaa2_fd fd;
struct rtnl_link_stats64 *percpu_stats;
+   struct dpaa2_eth_drv_stats *percpu_extras;
struct dpaa2_eth_fq *fq;
u16 queue_mapping;
int err, i;
 
percpu_stats = this_cpu_ptr(priv->percpu_stats);
+   percpu_extras = this_cpu_ptr(priv->percpu_extras);
 
if (unlikely(skb_headroom(skb) < DPAA2_ETH_NEEDED_HEADROOM(priv))) {
struct sk_buff *ns;
@@ -563,10 +570,14 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct 
net_device *net_dev)
/* Setup the FD fields */
memset(&fd, 0, sizeof(fd));
 
-   if (skb_is_nonlinear(skb))
+   if (skb_is_nonlinear(skb)) {
err = build_sg_fd(priv, skb, &fd);
-   else
+   percpu_extras->tx_sg_frames++;
+   percpu_extras->tx_sg_bytes += skb->len;
+   } else {
err = build_single_fd(priv, skb, &fd);
+   }
+
if (unlikely(err)) {
percpu_stats->tx_dropped++;
goto err_build_fd;
@@ -583,6 +594,7 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct 
net_device *net_dev)
if (err != -EBUSY)
break;
}
+   percpu_extras->tx_portal_busy += i;
if (unlikely(err < 0)) {
percpu_stats->tx_errors++;
/* Clean up everything, including freeing the skb */
@@ -608,8 +620,13 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
  struct napi_struct *napi __always_unused)
 {
struct rtnl_link_stats64 *percpu_stats;
+   struct dpaa2_eth_drv_stats *percpu_extras;
u32 status = 0;
 
+   percpu_extras = this_cpu_ptr(priv->percpu_extras);
+   percpu_extras->tx_conf_frames++;
+   percpu_extras->tx_conf_bytes += dpaa2_fd_get_len(fd);
+
free_tx_fd(priv, fd, &status);
 
if (unlikely(status & DPAA2_ETH_TXCONF_ERR_MASK)) {
@@ -814,13 +831,19 @@ static int refill_pool(struct dpaa2_eth_priv *priv,
 static int pull_channel(struct dpaa2_eth_channel *ch)
 {
int err;
+   int dequeues = -1;
 
/* Retry while portal is busy */
do {
err = dpaa2_io_service_pull_channel(NULL, ch->ch_id, ch->store);
+   dequeues++;
cpu_relax();
} while (err == -EBUSY);
 
+   ch->stats.dequeue_portal_busy += dequeues;
+   if (unlikely(err))
+   ch->stats.pull_err++;
+
return err;
 }
 
@@ -868,6 +891,8 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int 
budget)
} while (err == -EBUSY);
}
 
+   ch->stats.frame

[PATCH v3 1/9] bus: fsl-mc: add DPCON object APIs

2017-04-28 Thread Ioana Radulescu
From: Ioana Radulescu 

This patch adds the command building/parsing wrapper functions
for the DPCON object. The binary interface version is v3.2.

A DPCON (DataPath Concentrator) is an aggregator object that
allows ingress frames from multiple hardware queues to be seen
as coming from a single source, from the CPU point of view.

Signed-off-by: Ioana Radulescu 
Signed-off-by: Ioana Ciornei 
Signed-off-by: Stuart Yoder 
---
v3: no changes
v2: update #include paths since fsl-mc bus driver is still in staging

Note: The DPAA2 Ethernet driver is the first user of the DPCON objects,
but they can also be used as building blocks by other DPAA2 drivers,
so the API files are located for now under staging/fsl-mc/bus, along
the other "common" MC object files.

 drivers/staging/fsl-mc/bus/Makefile|   3 +-
 drivers/staging/fsl-mc/bus/dpcon-cmd.h |  69 ---
 drivers/staging/fsl-mc/bus/dpcon.c | 317 +
 drivers/staging/fsl-mc/include/dpcon.h | 115 
 4 files changed, 480 insertions(+), 24 deletions(-)
 create mode 100644 drivers/staging/fsl-mc/bus/dpcon.c
 create mode 100644 drivers/staging/fsl-mc/include/dpcon.h

diff --git a/drivers/staging/fsl-mc/bus/Makefile 
b/drivers/staging/fsl-mc/bus/Makefile
index 577e9fab34ec..659eccf52a4f 100644
--- a/drivers/staging/fsl-mc/bus/Makefile
+++ b/drivers/staging/fsl-mc/bus/Makefile
@@ -17,7 +17,8 @@ mc-bus-driver-objs := fsl-mc-bus.o \
  fsl-mc-msi.o \
  irq-gic-v3-its-fsl-mc-msi.o \
  dpmcp.o \
- dpbp.o
+ dpbp.o \
+ dpcon.o
 
 # MC DPIO driver
 obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h 
b/drivers/staging/fsl-mc/bus/dpcon-cmd.h
index d0a5e194c5e1..2bb66988ecf6 100644
--- a/drivers/staging/fsl-mc/bus/dpcon-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpcon-cmd.h
@@ -33,30 +33,53 @@
 #define _FSL_DPCON_CMD_H
 
 /* DPCON Version */
-#define DPCON_VER_MAJOR2
-#define DPCON_VER_MINOR1
+#define DPCON_VER_MAJOR3
+#define DPCON_VER_MINOR2
+
+/* Command versioning */
+#define DPCON_CMD_BASE_VERSION 1
+#define DPCON_CMD_ID_OFFSET4
+
+#define DPCON_CMD(id)  (((id) << DPCON_CMD_ID_OFFSET) | DPCON_CMD_BASE_VERSION)
 
 /* Command IDs */
-#define DPCON_CMDID_CLOSE  0x800
-#define DPCON_CMDID_OPEN   0x808
-#define DPCON_CMDID_CREATE 0x908
-#define DPCON_CMDID_DESTROY0x900
-
-#define DPCON_CMDID_ENABLE 0x002
-#define DPCON_CMDID_DISABLE0x003
-#define DPCON_CMDID_GET_ATTR   0x004
-#define DPCON_CMDID_RESET  0x005
-#define DPCON_CMDID_IS_ENABLED 0x006
-
-#define DPCON_CMDID_SET_IRQ0x010
-#define DPCON_CMDID_GET_IRQ0x011
-#define DPCON_CMDID_SET_IRQ_ENABLE 0x012
-#define DPCON_CMDID_GET_IRQ_ENABLE 0x013
-#define DPCON_CMDID_SET_IRQ_MASK   0x014
-#define DPCON_CMDID_GET_IRQ_MASK   0x015
-#define DPCON_CMDID_GET_IRQ_STATUS 0x016
-#define DPCON_CMDID_CLEAR_IRQ_STATUS   0x017
-
-#define DPCON_CMDID_SET_NOTIFICATION   0x100
+#define DPCON_CMDID_CLOSE  DPCON_CMD(0x800)
+#define DPCON_CMDID_OPEN   DPCON_CMD(0x808)
+#define DPCON_CMDID_GET_API_VERSIONDPCON_CMD(0xa08)
+
+#define DPCON_CMDID_ENABLE DPCON_CMD(0x002)
+#define DPCON_CMDID_DISABLEDPCON_CMD(0x003)
+#define DPCON_CMDID_GET_ATTR   DPCON_CMD(0x004)
+#define DPCON_CMDID_RESET  DPCON_CMD(0x005)
+#define DPCON_CMDID_IS_ENABLED DPCON_CMD(0x006)
+
+#define DPCON_CMDID_SET_NOTIFICATION   DPCON_CMD(0x100)
+
+struct dpcon_cmd_open {
+   __le32 dpcon_id;
+};
+
+#define DPCON_ENABLE   1
+
+struct dpcon_rsp_is_enabled {
+   u8 enabled;
+};
+
+struct dpcon_rsp_get_attr {
+   /* response word 0 */
+   __le32 id;
+   __le16 qbman_ch_id;
+   u8 num_priorities;
+   u8 pad;
+};
+
+struct dpcon_cmd_set_notification {
+   /* cmd word 0 */
+   __le32 dpio_id;
+   u8 priority;
+   u8 pad[3];
+   /* cmd word 1 */
+   __le64 user_ctx;
+};
 
 #endif /* _FSL_DPCON_CMD_H */
diff --git a/drivers/staging/fsl-mc/bus/dpcon.c 
b/drivers/staging/fsl-mc/bus/dpcon.c
new file mode 100644
index ..eb713578b817
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpcon.c
@@ -0,0 +1,317 @@
+/* Copyright 2013-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in

[PATCH v3 7/9] staging: fsl-dpaa2/eth: Add trace points

2017-04-28 Thread Ioana Radulescu
Add trace events in significant places of the data path.
Useful for debuggging.

Signed-off-by: Ioana Radulescu 
---
v3: no changes
v2: no changes

 drivers/staging/fsl-dpaa2/ethernet/Makefile|   3 +
 .../staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h   | 185 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |  21 +++
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |   2 +
 4 files changed, 211 insertions(+)
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h

diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile 
b/drivers/staging/fsl-dpaa2/ethernet/Makefile
index 4327ebe803cb..77b0b74f835a 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/Makefile
+++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile
@@ -5,3 +5,6 @@
 obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o
 
 fsl-dpaa2-eth-objs:= dpaa2-eth.o dpaa2-ethtool.o dpni.o
+
+# Needed by the tracing framework
+CFLAGS_dpaa2-eth.o := -I$(src)
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h
new file mode 100644
index ..3b040e8d6a4e
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth-trace.h
@@ -0,0 +1,185 @@
+/* Copyright 2014-2015 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM   dpaa2_eth
+
+#if !defined(_DPAA2_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _DPAA2_ETH_TRACE_H
+
+#include 
+#include 
+#include "dpaa2-eth.h"
+#include 
+
+#define TR_FMT "[%s] fd: addr=0x%llx, len=%u, off=%u"
+/* trace_printk format for raw buffer event class */
+#define TR_BUF_FMT "[%s] vaddr=%p size=%zu dma_addr=%pad map_size=%zu bpid=%d"
+
+/* This is used to declare a class of events.
+ * individual events of this type will be defined below.
+ */
+
+/* Store details about a frame descriptor */
+DECLARE_EVENT_CLASS(dpaa2_eth_fd,
+   /* Trace function prototype */
+   TP_PROTO(struct net_device *netdev,
+const struct dpaa2_fd *fd),
+
+   /* Repeat argument list here */
+   TP_ARGS(netdev, fd),
+
+   /* A structure containing the relevant information we want
+* to record. Declare name and type for each normal element,
+* name, type and size for arrays. Use __string for variable
+* length strings.
+*/
+   TP_STRUCT__entry(
+__field(u64, fd_addr)
+__field(u32, fd_len)
+__field(u16, fd_offset)
+__string(name, netdev->name)
+   ),
+
+   /* The function that assigns values to the above declared
+* fields
+*/
+   TP_fast_assign(
+  __entry->fd_addr = dpaa2_fd_get_addr(fd);
+  __entry->fd_len = dpaa2_fd_get_len(fd);
+  __entry->fd_offset = dpaa2_fd_get_offset(fd);
+  __assign_str(name, netdev->name)

[PATCH v3 2/9] staging: fsl-dpaa2/eth: Add Ethernet driver overview document

2017-04-28 Thread Ioana Radulescu
Add a README file describing the driver architecture, components
and I/O interface.

Signed-off-by: Ioana Radulescu 
---
v3: no changes
v2: no changes

 drivers/staging/fsl-dpaa2/ethernet/README | 186 ++
 1 file changed, 186 insertions(+)
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/README

diff --git a/drivers/staging/fsl-dpaa2/ethernet/README 
b/drivers/staging/fsl-dpaa2/ethernet/README
new file mode 100644
index ..410952ecf657
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/README
@@ -0,0 +1,186 @@
+Freescale DPAA2 Ethernet driver
+===
+
+This file provides documentation for the Freescale DPAA2 Ethernet driver.
+
+
+Contents
+
+   Supported Platforms
+   Architecture Overview
+   Creating a Network Interface
+   Features & Offloads
+
+
+Supported Platforms
+===
+This driver provides networking support for Freescale DPAA2 SoCs, e.g.
+LS2080A, LS2088A, LS1088A.
+
+
+Architecture Overview
+=
+Unlike regular NICs, in the DPAA2 architecture there is no single hardware 
block
+representing network interfaces; instead, several separate hardware resources
+concur to provide the networking functionality:
+- network interfaces
+- queues, channels
+- buffer pools
+- MAC/PHY
+
+All hardware resources are allocated and configured through the Management
+Complex (MC) portals. MC abstracts most of these resources as DPAA2 objects
+and exposes ABIs through which they can be configured and controlled. A few
+hardware resources, like queues, do not have a corresponding MC object and
+are treated as internal resources of other objects.
+
+For a more detailed description of the DPAA2 architecture and its object
+abstractions see:
+   drivers/staging/fsl-mc/README.txt
+
+Each Linux net device is built on top of a Datapath Network Interface (DPNI)
+object and uses Buffer Pools (DPBPs), I/O Portals (DPIOs) and Concentrators
+(DPCONs).
+
+Configuration interface:
+
+ ---
+| DPAA2 Ethernet Driver |
+ ---
+ .  .  .
+ .  .  .
+ . . . . .  .  . . . . . .
+ .  ..
+ .  ..
+ -- --  ---
+| DPBP API |   | DPNI API || DPCON API |
+ -- --  ---
+ .  .. software
+===  .  ==  .    .  ===
+ .  .. hardware
+ --
+|MC hardware portals   |
+ --
+ .  ..
+ .  ..
+  -- -----
+ | DPBP |   | DPNI |  | DPCON |
+  -- -----
+
+The DPNIs are network interfaces without a direct one-on-one mapping to PHYs.
+DPBPs represent hardware buffer pools. Packet I/O is performed in the context
+of DPCON objects, using DPIO portals for managing and communicating with the
+hardware resources.
+
+Datapath (I/O) interface:
+
+ ---
+|   DPAA2 Ethernet Driver   |
+  ---
+  |  ^^ ||
+  |  || ||
+   enqueue|   dequeue|   data |  dequeue|   seed |
+(Tx)  | (Rx, TxC)|  avail.|  request| buffers|
+  |  |  notify| ||
+  |  || ||
+  V  || VV
+ ---
+| DPIO Driver   |
+ ---
+  |  || ||  software
+  |  || ||  
+  |  || ||  hardware
+ ---
+|   I/O hardware portals|
+ ---
+  |  ^^ ||
+  |  || ||
+  |  || V|
+  V  |   V
+--   |  -
+ queues  --  | | Buffer pool |
+  --

[PATCH v3 4/9] staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver

2017-04-28 Thread Ioana Radulescu
Introduce the DPAA2 Ethernet driver, which manages Datapath
Network Interface (DPNI) objects discovered on the MC bus.

In addition to DPNIs, the Ethernet driver uses several other
MC objects to build a network interface abstraction: buffer
pools (DPBPs), I/O Portals (DPIOs) and concentrators (DPCONs).

A more detailed description of the driver can be found in the
associated README file.

Signed-off-by: Ioana Radulescu 
Signed-off-by: Bogdan Hamciuc 
---
v3: no changes
v2:
 - update #include paths
 - ndo_get_stats64() now returns void
 - skb_csum_off_chk_help_cmn() was removed in 4.10, so we go back to
   using NETIF_F_IP_CSUM/NETIF_F_IPV6_CSUM in netdev features
 - new way of setting MTU min/max limits

 drivers/staging/fsl-dpaa2/ethernet/Makefile|2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2455 
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  304 +++
 3 files changed, 2760 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h

diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile 
b/drivers/staging/fsl-dpaa2/ethernet/Makefile
index 83b62644a44b..4897d39a1c21 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/Makefile
+++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o
 
-fsl-dpaa2-eth-objs:= dpni.o
+fsl-dpaa2-eth-objs:= dpaa2-eth.o dpni.o
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
new file mode 100644
index ..abd700e57aeb
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -0,0 +1,2455 @@
+/* Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2016-2017 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../fsl-mc/include/mc.h"
+#include "../../fsl-mc/include/mc-sys.h"
+#include "dpaa2-eth.h"
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Freescale Semiconductor, Inc");
+MODULE_DESCRIPTION("Freescale DPAA2 Ethernet Driver");
+
+static void validate_rx_csum(struct dpaa2_eth_priv *priv,
+u32 fd_status,
+struct sk_buff *skb)
+{
+   skb_checksum_none_assert(skb);
+
+   /* HW checksum validation is disabled, nothing to do here */
+   if (!(priv->net_dev->features & NETIF_F_RXCSUM))
+   return;
+
+   /* Read checksum validation bits */
+   if (!((fd_status & DPAA2_FAS_L3CV) &&
+ (fd_status & DPAA2_FAS_L4CV)))
+   return;
+
+   /* Inform the stack there's no need to compute L3/L4 csum anymore */
+   skb->ip_summed = CHECKSUM_UNNECESSARY;
+}
+
+/* Free a received FD.
+ * Not to be used for Tx conf FDs or on any other paths.
+ */
+static void free_rx_fd(struct dpaa2_eth_priv *priv,
+  const struct dpaa2_fd *fd,
+  void *vaddr)
+{
+   struct device *dev = priv->net_dev->dev.parent;
+   dma_addr_t addr = dpaa2_fd_get_addr(fd);
+   u8 fd_format = dpaa2_fd_get_format(fd);
+   struct dpaa2_sg_entry *sgt;
+   voi

[PATCH v3 3/9] staging: fsl-dpaa2/eth: Add APIs for DPNI objects

2017-04-28 Thread Ioana Radulescu
Add the command build/parse APIs for operating on DPNI objects through
the DPAA2 Management Complex.

Signed-off-by: Ioana Radulescu 
---
v3: no changes
v2: update #include paths

 drivers/staging/Kconfig   |2 +
 drivers/staging/Makefile  |1 +
 drivers/staging/fsl-dpaa2/Kconfig |   17 +
 drivers/staging/fsl-dpaa2/Makefile|5 +
 drivers/staging/fsl-dpaa2/ethernet/Makefile   |7 +
 drivers/staging/fsl-dpaa2/ethernet/dpkg.h |  176 +++
 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h |  541 +
 drivers/staging/fsl-dpaa2/ethernet/dpni.c | 1595 +
 drivers/staging/fsl-dpaa2/ethernet/dpni.h |  832 +
 drivers/staging/fsl-dpaa2/ethernet/net.h  |  480 
 10 files changed, 3656 insertions(+)
 create mode 100644 drivers/staging/fsl-dpaa2/Kconfig
 create mode 100644 drivers/staging/fsl-dpaa2/Makefile
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/Makefile
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpkg.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni-cmd.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/dpni.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/net.h

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 65440f675033..0aa455096b1e 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -94,6 +94,8 @@ source "drivers/staging/fbtft/Kconfig"
 
 source "drivers/staging/fsl-mc/Kconfig"
 
+source "drivers/staging/fsl-dpaa2/Kconfig"
+
 source "drivers/staging/wilc1000/Kconfig"
 
 source "drivers/staging/most/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 13ae7f899b21..ac22f62dce12 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_UNISYSSPAR)  += unisys/
 obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD)  += clocking-wizard/
 obj-$(CONFIG_FB_TFT)   += fbtft/
 obj-$(CONFIG_FSL_MC_BUS)   += fsl-mc/
+obj-$(CONFIG_FSL_DPAA2)+= fsl-dpaa2/
 obj-$(CONFIG_WILC1000) += wilc1000/
 obj-$(CONFIG_MOST) += most/
 obj-$(CONFIG_KS7010)   += ks7010/
diff --git a/drivers/staging/fsl-dpaa2/Kconfig 
b/drivers/staging/fsl-dpaa2/Kconfig
new file mode 100644
index ..2e325cb747ae
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/Kconfig
@@ -0,0 +1,17 @@
+#
+# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
+#
+
+config FSL_DPAA2
+   bool "Freescale DPAA2 devices"
+   depends on FSL_MC_BUS
+   ---help---
+ Build drivers for Freescale DataPath Acceleration
+ Architecture (DPAA2) family of SoCs.
+
+config FSL_DPAA2_ETH
+   tristate "Freescale DPAA2 Ethernet"
+   depends on FSL_DPAA2 && FSL_MC_DPIO
+   ---help---
+ Ethernet driver for Freescale DPAA2 SoCs, using the
+ Freescale MC bus driver
diff --git a/drivers/staging/fsl-dpaa2/Makefile 
b/drivers/staging/fsl-dpaa2/Makefile
new file mode 100644
index ..0836ba8977b1
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/Makefile
@@ -0,0 +1,5 @@
+#
+# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
+#
+
+obj-$(CONFIG_FSL_DPAA2_ETH)+= ethernet/
diff --git a/drivers/staging/fsl-dpaa2/ethernet/Makefile 
b/drivers/staging/fsl-dpaa2/ethernet/Makefile
new file mode 100644
index ..83b62644a44b
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the Freescale DPAA2 Ethernet controller
+#
+
+obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o
+
+fsl-dpaa2-eth-objs:= dpni.o
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpkg.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpkg.h
new file mode 100644
index ..02290a088391
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpkg.h
@@ -0,0 +1,176 @@
+/* Copyright 2013-2015 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the above-listed copyright holders nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVI

Re: [PATCH 0/7] staging: rtl8732: Various checkpatch fixes

2017-04-28 Thread Bastien Nocera
On Thu, 2017-04-27 at 18:09 -0600, Justin Vreeland wrote:
> Justin Vreeland (7):
> 
>   staging: rtl8723bs: Fix pointer style
>   staging: rtl8723bs: Fix spacing around '<'
>   staging: rtl8723bs: Do not use assignment in if condition

You can add:
Reviewed-By: Bastien Nocera 

To those last 3 patches.

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


Re: [PATCH v5] Staging: most: use __func__ instead of the function name

2017-04-28 Thread Greg KH
On Wed, Apr 26, 2017 at 04:16:58PM -0700, Chandra Annamaneni wrote:
> 
> Change video.c to use %s, __func__ instead of function names.
> Warnings flagged by checkpatch.pl
> 
> Signed-off-by: Chandra Annamaneni 

This patch does not apply to my staging-next branch at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC] staging: wilc1000: Refactor handling of HT caps fields

2017-04-28 Thread Greg KH
On Tue, Apr 25, 2017 at 10:46:25PM -0600, Jason Litzinger wrote:
> The patch with this RFC addresses the following sparse warnings: 

So are you going to resend this as a non-RFC patch so that I can apply
it?  :)

thanks,

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


Re: [PATCH 1/2] staging: vt6656: use off stack for out buffer USB transfers.

2017-04-28 Thread Greg KH
On Sat, Apr 22, 2017 at 11:14:57AM +0100, Malcolm Priestley wrote:
> Since 4.9 mandated USB buffers be heap allocated this causes the driver
> to fail.

It's really been a requirement since the 2.2 days, it's just that not
many people ran USB drivers on the platforms that required it :)

thanks,

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


[PATCH v3 8/9] staging: fsl-dpaa2/eth: Add TODO file

2017-04-28 Thread Ioana Radulescu
Add a list of TODO items for the Ethernet driver

Signed-off-by: Ioana Radulescu 
---
v3: Add contact info
v2: Add note

 drivers/staging/fsl-dpaa2/ethernet/TODO | 14 ++
 1 file changed, 14 insertions(+)
 create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO

diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO 
b/drivers/staging/fsl-dpaa2/ethernet/TODO
new file mode 100644
index ..110e66d44b42
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethernet/TODO
@@ -0,0 +1,18 @@
+* Add a DPAA2 MAC kernel driver in order to allow PHY management; currently
+  the DPMAC objects and their link to DPNIs are handled by MC internally
+  and all PHYs are seen as fixed-link
+* add more debug support: decide how to expose detailed debug statistics,
+  add ingress error queue support
+* MC firmware uprev; the DPAA2 objects used by the Ethernet driver need to
+  be kept in sync with binary interface changes in MC
+* refine README file
+* cleanup
+
+NOTE: None of the above is must-have before getting the DPAA2 Ethernet driver
+out of staging. The main requirement for that is to have the drivers it
+depends on, fsl-mc bus and DPIO driver, moved to drivers/bus and drivers/soc
+respectively.
+
+ Please send any patches to Greg Kroah-Hartman ,
+ ruxandra.radule...@nxp.com, de...@driverdev.osuosl.org,
+ linux-ker...@vger.kernel.org
-- 
2.11.0

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


Re: [PATCH 1/1] staging: fbtft: Fix Sparse warning in fb_watterott.c

2017-04-28 Thread Greg KH
On Fri, Apr 21, 2017 at 05:54:47PM +0200, Cezary Gapinski wrote:
> Sparse reports the following in fb_watterott.c:
> 
> warning: incorrect type in assignment (different base types)
> expected unsigned short [unsigned] [short] [usertype] 
> got restricted __be16 [usertype] 
> 
> Use __be16 types for endian correctness
> 
> Signed-off-by: Cezary Gapinski 
> ---
>  drivers/staging/fbtft/fb_watterott.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Patch does not apply to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: fbtft: fix character limit, trailing ; warning, etc.

2017-04-28 Thread Greg KH
On Sun, Apr 23, 2017 at 03:21:31PM +0100, Eric Curtin wrote:
> checkpatch spits out a warning about the 80 character line limit. Split
> the parameters of these functions onto different lines. Put the ; with
> the macro caller instead. Lined up parameters as there was another
> CHECK warning about that.
> 
> Signed-off-by: Eric Curtin 
> ---
>  drivers/staging/fbtft/fbtft-bus.c | 36 +---
>  1 file changed, 21 insertions(+), 15 deletions(-)

Patch does not apply to my tree at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: staging: lustre: lustre: llite: file.c - fixed sparse warning about different fmode_t type

2017-04-28 Thread Andrea della Porta
Fixed the following sparse warning:

  CHECK   drivers/staging/lustre/lustre/llite//file.c
  drivers/staging/lustre/lustre/llite//file.c:441:24: warning: incorrect
  type in assignment (different base types)
  drivers/staging/lustre/lustre/llite//file.c:441:24:expected
  restricted fmode_t [usertype] och_flags
  drivers/staging/lustre/lustre/llite//file.c:441:24:got unsigned
  long long [unsigned] [usertype] it_flags
  drivers/staging/lustre/lustre/llite//file.c:465:65: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:465:22: warning: incorrect
  type in assignment (different base types)
  drivers/staging/lustre/lustre/llite//file.c:465:22:expected
  restricted fmode_t [usertype] fd_omode
  drivers/staging/lustre/lustre/llite//file.c:465:22:got unsigned
  long long
  drivers/staging/lustre/lustre/llite//file.c:526:38: warning: invalid
  assignment: |=
  drivers/staging/lustre/lustre/llite//file.c:526:38:left side has
  type unsigned long long
  drivers/staging/lustre/lustre/llite//file.c:526:38:right side has
  type restricted fmode_t
  drivers/staging/lustre/lustre/llite//file.c:533:49: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:553:28: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:556:35: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:778:23: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:1309:62: warning:
  restricted fmode_t degrades to integer
  drivers/staging/lustre/lustre/llite//file.c:1357:23: warning:
  incorrect type in initializer (different base types)
  drivers/staging/lustre/lustre/llite//file.c:1357:23:expected
  unsigned long long [unsigned] [usertype] flags
  drivers/staging/lustre/lustre/llite//file.c:1357:23:got restricted
  fmode_t [usertype] 


Signed-off-by: Andrea della Porta 
---
 drivers/staging/lustre/lustre/include/lustre_intent.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_intent.h 
b/drivers/staging/lustre/lustre/include/lustre_intent.h
index ed2b6c6..c036633 100644
--- a/drivers/staging/lustre/lustre/include/lustre_intent.h
+++ b/drivers/staging/lustre/lustre/include/lustre_intent.h
@@ -38,7 +38,7 @@
 struct lookup_intent {
int it_op;
int it_create_mode;
-   __u64   it_flags;
+   fmode_t it_flags;
int it_disposition;
int it_status;
__u64   it_lock_handle;
-- 
2.4.10

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


Re: [PATCH] staging : rtl8188eu : remove void function return

2017-04-28 Thread Greg KH
On Fri, Apr 21, 2017 at 09:24:57AM +0530, surenderpolsani wrote:
> kernel coding style doesn't allow the return statement
> in void function.
> 
> Signed-off-by: Surenderp 

Your "From" line does not match this line.

And I need a "full" name here.

thanks,

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


Re: [PATCH] staging: rtl8192u: Improve readability and fix sparse warnings: cast from restricted __le16

2017-04-28 Thread Greg KH
On Sat, Apr 22, 2017 at 11:55:23PM +0100, Tuomo Rinne wrote:
> This patch fixes following sparse warnings:
> 
> drivers/staging/rtl8192u//r8192U_dm.c:2307:49: warning: cast from restricted 
> __le16
> drivers/staging/rtl8192u//r8192U_dm.c:2308:44: warning: cast from restricted 
> __le16
> drivers/staging/rtl8192u//r8192U_dm.c:2309:44: warning: cast from restricted 
> __le16
> 
> In order to avoid the warnings the u4bAcParam variable is constructed
> using the cpu's endianness and in case of big endian architectures the
> variable is converted back to little endian before passed to write_nic_dword
> function.
> 
> Also the patch improves readability by getting rid of unnecessary scope
> and splitting complex variable construction to multiple lines.

Don't do multiple things in the same patch, please break this up into
different patches, each one doing only one thing.

thanks,

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


Re: [PATCH] staging: rtl8192u: Fix sparse warning

2017-04-28 Thread Greg Kroah-Hartman
On Sun, Apr 23, 2017 at 05:51:17PM -0300, Marcos Paulo de Souza wrote:
> Fix the following sparse warning:
> rtl8192u/ieee80211/ieee80211_rx.c:1489:45: warning: incorrect type in 
> assignment (different base types)
> rtl8192u/ieee80211/ieee80211_rx.c:1489:45:expected restricted __le16 
> 
> rtl8192u/ieee80211/ieee80211_rx.c:1489:45:got unsigned short [unsigned] 
> [usertype] 
> 
> Since ac_params->tx_op_limit is already an __le16, we shouldn't convert it 
> into cpu type.
> 
> Signed-off-by: Marcos Paulo de Souza 
> ---
> 
>  Sorry, I don't have the hardware to test, so please review and tell me if 
> I'm wrong in this one!

Patch doesn't apply to my tree at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] bus: fsl-mc: dpio: fix alter FQ state command

2017-04-28 Thread Greg KH
On Sat, Apr 22, 2017 at 09:44:49AM +0300, Horia Geantă wrote:
> When checking the response verb, the valid bit should be masked out,
> since its value flips depending on what Response Register
> (RR0 /RR1) it's been read from.
> 
> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
> Signed-off-by: Horia Geantă 
> ---
> v2: use QBMAN_RESULT_MASK instead of hard-coded mask

Why are you not using 'staging' in your subject line?

thanks,

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


[PATCH v4] staging: ks7010: fix block comment style

2017-04-28 Thread Ilia Sergachev
Checkpatch was showing:
WARNING: Block comments use a trailing */ on a separate line.

Move trailing */ to a separate line.

Signed-off-by: Ilia Sergachev 
---
Changes for v4:
  - remove one trailing whitespace in the last hunk, 
which was corrupting the patch

Changes for v3:
  - improve the commit message even more

Changes for v2:
  - improve the commit message


 drivers/staging/ks7010/ks_wlan_net.c | 43 ++--
 1 file changed, 27 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 121e1530fdba..539b503daf71 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -230,7 +230,8 @@ static int ks_wlan_set_freq(struct net_device *dev,
else {
int channel = fwrq->m;
/* We should do a better check than that,
-* based on the card capability !!! */
+* based on the card capability !!!
+*/
if ((channel < 1) || (channel > 14)) {
netdev_dbg(dev,
   "%s: New channel value of %d is invalid!\n",
@@ -343,7 +344,8 @@ static int ks_wlan_get_essid(struct net_device *dev,
 
/* for SLEEP MODE */
/* Note : if dwrq->flags != 0, we should
-* get the relevant SSID from the SSID list... */
+* get the relevant SSID from the SSID list...
+*/
if (priv->reg.ssid.size) {
/* Get the current SSID */
memcpy(extra, priv->reg.ssid.body, priv->reg.ssid.size);
@@ -1137,7 +1139,8 @@ static int ks_wlan_get_range(struct net_device *dev,
range->max_nwid = 0x;
range->num_channels = 14;
/* Should be based on cap_rid.country to give only
-* what the current card support */
+* what the current card support
+*/
k = 0;
for (i = 0; i < 13; i++) {  /* channel 1 -- 13 */
range->freq[k].i = i + 1;   /* List index */
@@ -1189,7 +1192,8 @@ static int ks_wlan_get_range(struct net_device *dev,
 
/* Set an indication of the max TCP throughput
 * in bit/s that we can expect using this interface.
-* May be use for QoS stuff... Jean II */
+* May be use for QoS stuff... Jean II
+*/
if (i > 2)
range->throughput = 5000 * 1000;
else
@@ -1225,7 +1229,8 @@ static int ks_wlan_get_range(struct net_device *dev,
 
/* Experimental measurements - boundary 11/5.5 Mb/s */
/* Note : with or without the (local->rssi), results
-* are somewhat different. - Jean II */
+* are somewhat different. - Jean II
+*/
range->avg_qual.qual = 50;
range->avg_qual.level = 186;/* -70 dBm */
range->avg_qual.noise = 0;
@@ -1497,7 +1502,8 @@ static inline char *ks_wlan_translate_scan(struct 
net_device *dev,
 &(ap->ssid.body[0]));
 
/* Rate : stuffing multiple values in a single event require a bit
-* more of magic - Jean II */
+* more of magic - Jean II
+*/
current_val = current_ev + IW_EV_LCP_LEN;
 
iwe.cmd = SIOCGIWRATE;
@@ -1569,7 +1575,8 @@ static inline char *ks_wlan_translate_scan(struct 
net_device *dev,
}
 
/* The other data in the scan result are not really
-* interesting, so for now drop it - Jean II */
+* interesting, so for now drop it - Jean II
+*/
return current_ev;
 }
 
@@ -1596,7 +1603,8 @@ static int ks_wlan_get_scan(struct net_device *dev,
 
if (priv->aplist.size == 0) {
/* Client error, no scan results...
-* The caller need to restart the scan. */
+* The caller need to restart the scan.
+*/
DPRINTK(2, "aplist 0\n");
return -ENODATA;
}
@@ -1970,12 +1978,13 @@ static int ks_wlan_get_encode_ext(struct net_device 
*dev,
return -EPERM;
 
/* for SLEEP MODE */
-   /*  WPA (not used ?? wpa_supplicant)
-  struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
-  struct iw_encode_ext *enc;
-  enc = (struct iw_encode_ext *)extra;
-  int index = dwrq->flags & IW_ENCODE_INDEX;
-  WPA (not used ?? wpa_supplicant) */
+   /* WPA (not used ?? wpa_supplicant)
+* struct ks_wlan_private *priv = (struct ks_wlan_private *)dev->priv;
+* struct iw_encode_ext *enc;
+* enc = (struct iw_encode_ext *)extra;
+* int index = dwrq->flags & IW_ENCODE_INDEX;
+* WPA (not used ?? wpa_supplicant)
+*/
return 0;
 }
 
@@ -2105,7 +2114,8 @@ static struct iw_statistics *ks_get_wireless_stats(struct 
net_device *dev)
}
 
/* Packets discarded in the wireless adapter due to wireless
-* specific problems */
+

Re: [PATCH] staging: rtl8192u: Fix sparse warning

2017-04-28 Thread Marcos Paulo de Souza
On Fri, Apr 28, 2017 at 12:29:55PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Apr 23, 2017 at 05:51:17PM -0300, Marcos Paulo de Souza wrote:
> > Fix the following sparse warning:
> > rtl8192u/ieee80211/ieee80211_rx.c:1489:45: warning: incorrect type in 
> > assignment (different base types)
> > rtl8192u/ieee80211/ieee80211_rx.c:1489:45:expected restricted __le16 
> > 
> > rtl8192u/ieee80211/ieee80211_rx.c:1489:45:got unsigned short [unsigned] 
> > [usertype] 
> > 
> > Since ac_params->tx_op_limit is already an __le16, we shouldn't convert it 
> > into cpu type.
> > 
> > Signed-off-by: Marcos Paulo de Souza 
> > ---
> > 
> >  Sorry, I don't have the hardware to test, so please review and tell me if 
> > I'm wrong in this one!
> 
> Patch doesn't apply to my tree at all :(

My patch was based on master... my apologies. Will resend based on
staging-next.

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


[PATCH] staging: vt6656: use tabs instead of spaces

2017-04-28 Thread Juan Antonio Pedreira Martos
Fix a checkpatch error: CODE_INDENT (code indent should use tabs where
possible).

Signed-off-by: Juan Antonio Pedreira Martos 
---
 drivers/staging/vt6656/rxtx.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 1835cd13ef49..63413492e61d 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -114,7 +114,7 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, 
u16 rate)
 }
 
 static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type,
-   u32 frame_length, u16 rate, int need_ack)
+   u32 frame_length, u16 rate, int need_ack)
 {
u32 data_time, ack_time;
 
@@ -135,14 +135,14 @@ static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 
pkt_type,
 }
 
 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
-u32 frame_length, u16 rate, int need_ack)
+u32 frame_length, u16 rate, int need_ack)
 {
return cpu_to_le16((u16)vnt_get_rsvtime(priv, pkt_type,
frame_length, rate, need_ack));
 }
 
 static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
-u8 rsv_type, u8 pkt_type, u32 
frame_length, u16 current_rate)
+u8 rsv_type, u8 pkt_type, u32 
frame_length, u16 current_rate)
 {
u32 rrv_time, rts_time, cts_time, ack_time, data_time;
 
@@ -160,19 +160,19 @@ static __le16 vnt_get_rtscts_rsvtime_le(struct 
vnt_private *priv,
rts_time = vnt_get_frame_time(priv->preamble_type,
pkt_type, 20, priv->top_cck_basic_rate);
cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_cck_basic_rate);
+ 14, priv->top_cck_basic_rate);
ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_ofdm_basic_rate);
+ 14, priv->top_ofdm_basic_rate);
} else if (rsv_type == 2) {
rts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 20, priv->top_ofdm_basic_rate);
+ 20, priv->top_ofdm_basic_rate);
cts_time = ack_time = vnt_get_frame_time(priv->preamble_type,
pkt_type, 14, priv->top_ofdm_basic_rate);
} else if (rsv_type == 3) {
cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_cck_basic_rate);
+ 14, priv->top_cck_basic_rate);
ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_ofdm_basic_rate);
+ 14, priv->top_ofdm_basic_rate);
 
rrv_time = cts_time + ack_time + data_time + 2 * priv->sifs;
 
@@ -227,7 +227,7 @@ static __le16 vnt_get_rtscts_duration_le(struct 
vnt_usb_send_context *context,
case RTSDUR_AA_F0:
case RTSDUR_AA_F1:
cts_time = vnt_get_frame_time(priv->preamble_type,
- pkt_type, 14, 
priv->top_ofdm_basic_rate);
+ pkt_type, 14, 
priv->top_ofdm_basic_rate);
dur_time = cts_time + 2 * priv->sifs +
vnt_get_rsvtime(priv, pkt_type,
frame_length, rate, need_ack);
@@ -410,7 +410,7 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context 
*tx_context,
u16 current_rate = tx_context->tx_rate;
 
vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
- PK_TYPE_11B, &buf->b);
+ PK_TYPE_11B, &buf->b);
vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
  tx_context->pkt_type, &buf->a);
 
@@ -437,7 +437,7 @@ static u16 vnt_rxtx_rts_g_fb_head(struct 
vnt_usb_send_context *tx_context,
u16 rts_frame_len = 20;
 
vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
- PK_TYPE_11B, &buf->b);
+ PK_TYPE_11B, &buf->b);
vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
  tx_context->pkt_type, &buf->a);
 
@@ -683,9 +683,9 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context 
*tx_context,
 }
 
 static u16 vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context,
- struct vnt_tx_buffer *tx_buffer,
- struct 

Re: [PATCH] staging: sm750fb: Combine set GPIO 30 & 31 into one statement

2017-04-28 Thread gre...@linuxfoundation.org
On Tue, Apr 25, 2017 at 03:53:02PM +, Lynn Lei wrote:
> Combine two separate set GPIO(30 & 31) operations into one statement.

Why?

> 
> Signed-off-by: Lynn Lei 
> ---
>  drivers/staging/sm750fb/ddk750_hwi2c.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
> b/drivers/staging/sm750fb/ddk750_hwi2c.c
> index 68716ef7cb06..ddb7a6dc265a 100644
> --- a/drivers/staging/sm750fb/ddk750_hwi2c.c
> +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
> @@ -49,8 +49,7 @@ void sm750_hw_i2c_close(void)
>  
>   /* Set GPIO 30 & 31 back as GPIO pins */
>   value = peek32(GPIO_MUX);
> - value &= ~GPIO_MUX_30;
> - value &= ~GPIO_MUX_31;
> + value &= ~(GPIO_MUX_30 | GPIO_MUX_31);

Why does this matter?

thanks,

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


[PATCH] staging: android: ion: Fix unnecessary initialization of static variable

2017-04-28 Thread Fabrizio Perria
Fix checkpatch warning: removed unnecessary initialization of
static variable "heap_id" to 0 in source file "ioc.c".

Signed-off-by: Fabrizio Perria 
---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index fb836c6..03d3a4f 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -41,7 +41,7 @@
 #include "ion.h"
 
 static struct ion_device *internal_dev;
-static int heap_id = 0;
+static int heap_id;
 
 bool ion_buffer_cached(struct ion_buffer *buffer)
 {
-- 
1.9.1

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


Re: [PATCH v4] staging: ks7010: fix block comment style

2017-04-28 Thread Greg Kroah-Hartman
On Fri, Apr 28, 2017 at 12:35:55PM +0200, Ilia Sergachev wrote:
> Checkpatch was showing:
> WARNING: Block comments use a trailing */ on a separate line.
> 
> Move trailing */ to a separate line.
> 
> Signed-off-by: Ilia Sergachev 
> ---
> Changes for v4:
>   - remove one trailing whitespace in the last hunk, 
> which was corrupting the patch

Nope, the whole thing still doesn't apply:

checking file drivers/staging/ks7010/ks_wlan_net.c
Hunk #1 FAILED at 230.
Hunk #2 FAILED at 343.
Hunk #3 FAILED at 1137.
Hunk #4 FAILED at 1189.
Hunk #5 FAILED at 1225.
Hunk #6 FAILED at 1497.
Hunk #7 FAILED at 1569.
Hunk #8 FAILED at 1596.
Hunk #9 FAILED at 1970.
Hunk #10 FAILED at 2105.
Hunk #11 FAILED at 3351.
11 out of 11 hunks FAILED

What tree/branch are you making this patch against?

thanks,

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


Re: [PATCH v2] bus: fsl-mc: dpio: fix alter FQ state command

2017-04-28 Thread Horia Geantă
On 4/28/2017 1:32 PM, Greg KH wrote:
> On Sat, Apr 22, 2017 at 09:44:49AM +0300, Horia Geantă wrote:
>> When checking the response verb, the valid bit should be masked out,
>> since its value flips depending on what Response Register
>> (RR0 /RR1) it's been read from.
>>
>> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
>> Signed-off-by: Horia Geantă 
>> ---
>> v2: use QBMAN_RESULT_MASK instead of hard-coded mask
> 
> Why are you not using 'staging' in your subject line?
> 
I was not aware this is required and followed the statistics:

git log --oneline drivers/staging/fsl-mc/bus/dpio/
141a10aead9c staging: fsl-mc/dpio: Fix early writing of valid bit
993fec7e11ca bus: fsl-mc: dpio: add the DPAA2 DPIO object driver
780b626323d7 bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
321eecb06bfb bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
2704aedb5c21 bus: fsl-mc: dpio: add APIs for DPIO objects
0e6437941e44 bus: fsl-mc: dpio: add DPIO driver overview document

Do I have to resubmit?

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


Re: [PATCH v2] bus: fsl-mc: dpio: fix alter FQ state command

2017-04-28 Thread Greg KH
On Fri, Apr 28, 2017 at 10:47:14AM +, Horia Geantă wrote:
> On 4/28/2017 1:32 PM, Greg KH wrote:
> > On Sat, Apr 22, 2017 at 09:44:49AM +0300, Horia Geantă wrote:
> >> When checking the response verb, the valid bit should be masked out,
> >> since its value flips depending on what Response Register
> >> (RR0 /RR1) it's been read from.
> >>
> >> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
> >> Signed-off-by: Horia Geantă 
> >> ---
> >> v2: use QBMAN_RESULT_MASK instead of hard-coded mask
> > 
> > Why are you not using 'staging' in your subject line?
> > 
> I was not aware this is required and followed the statistics:
> 
> git log --oneline drivers/staging/fsl-mc/bus/dpio/
> 141a10aead9c staging: fsl-mc/dpio: Fix early writing of valid bit
> 993fec7e11ca bus: fsl-mc: dpio: add the DPAA2 DPIO object driver
> 780b626323d7 bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
> 321eecb06bfb bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
> 2704aedb5c21 bus: fsl-mc: dpio: add APIs for DPIO objects
> 0e6437941e44 bus: fsl-mc: dpio: add DPIO driver overview document
> 
> Do I have to resubmit?

No, I have edited the subject, it should be "staging: fsl-mc: bus: ..."
for future patches.

thanks,

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


Re: [PATCH v3 1/9] bus: fsl-mc: add DPCON object APIs

2017-04-28 Thread Greg KH
On Fri, Apr 28, 2017 at 04:50:26AM -0500, Ioana Radulescu wrote:
> From: Ioana Radulescu 
> 
> This patch adds the command building/parsing wrapper functions
> for the DPCON object. The binary interface version is v3.2.

The subject should have "staging: fsl-mc: bus: ..." to match the other
ones (and to catch my filters properly...)

I'll take this as-is for now.

thanks,

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


Re: [PATCH v4] staging: ks7010: fix block comment style

2017-04-28 Thread Ilia Sergachev
On Fri, 28 Apr 2017 14:20:21 +0200
Greg Kroah-Hartman  wrote:

> 
> Nope, the whole thing still doesn't apply:
> 
> checking file drivers/staging/ks7010/ks_wlan_net.c
> Hunk #1 FAILED at 230.
> Hunk #2 FAILED at 343.
> Hunk #3 FAILED at 1137.
> Hunk #4 FAILED at 1189.
> Hunk #5 FAILED at 1225.
> Hunk #6 FAILED at 1497.
> Hunk #7 FAILED at 1569.
> Hunk #8 FAILED at 1596.
> Hunk #9 FAILED at 1970.
> Hunk #10 FAILED at 2105.
> Hunk #11 FAILED at 3351.
> 11 out of 11 hunks FAILED
> 
> What tree/branch are you making this patch against?
> 
> thanks,
> 
> greg k-h

Ok, I was using torvalds/linux instead of next/linux-next.
In fact, the style fixes on this file were already done in 'next'.
So, thank you all for your patience, and sorry about lost time,
these were the necessary lessons for me - I'll find now something else
to fix :) 

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


RE: [PATCH v3 1/9] bus: fsl-mc: add DPCON object APIs

2017-04-28 Thread Ruxandra Ioana Radulescu


> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Friday, April 28, 2017 3:24 PM
> To: Ruxandra Ioana Radulescu 
> Cc: de...@driverdev.osuosl.org; stuyo...@gmail.com; a...@arndb.de;
> Haiying Wang ; Roy Pledge
> ; Alexandru Marginean
> ; linux-ker...@vger.kernel.org;
> ag...@suse.de; Bogdan Hamciuc ; Bogdan
> Purcareata ; linux-arm-
> ker...@lists.infradead.org; Laurentiu Tudor 
> Subject: Re: [PATCH v3 1/9] bus: fsl-mc: add DPCON object APIs
> 
> On Fri, Apr 28, 2017 at 04:50:26AM -0500, Ioana Radulescu wrote:
> > From: Ioana Radulescu 
> >
> > This patch adds the command building/parsing wrapper functions
> > for the DPCON object. The binary interface version is v3.2.
> 
> The subject should have "staging: fsl-mc: bus: ..." to match the other
> ones (and to catch my filters properly...)

My bad, I must have missed this one when I changed the subject
lines for v2.
 
> I'll take this as-is for now.
 
Thanks a lot!
Ioana
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 1/3] staging: typec: USB Type-C Port Manager (tcpm)

2017-04-28 Thread Guenter Roeck

On 04/28/2017 12:28 AM, Greg Kroah-Hartman wrote:

On Thu, Apr 27, 2017 at 02:09:56PM -0700, Guenter Roeck wrote:

--- /dev/null
+++ b/drivers/staging/typec/pd.h
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2015-2017 Google, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.


I have to ask, you really mean "any later version", for all of these
patches, right?

thanks,

greg k-h



I have not really thought about it, but this is ok as-is.

Guenter

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


[bug report] staging: ks7010: add driver from Nanonote extra-repository

2017-04-28 Thread Dan Carpenter
Hello Wolfram Sang,

The patch 13a9930d15b4: "staging: ks7010: add driver from Nanonote
extra-repository" from May 31, 2016, leads to the following static
checker warning:

drivers/staging/ks7010/ks_wlan_net.c:1141 ks_wlan_get_range()
warn: dead code because of 'i > 2' and 'i < 13'

drivers/staging/ks7010/ks_wlan_net.c
  1062  static int ks_wlan_get_range(struct net_device *dev,
  1063   struct iw_request_info *info,
  1064   struct iw_point *dwrq, char *extra)
  1065  {
  1066  struct ks_wlan_private *priv =
  1067  (struct ks_wlan_private *)netdev_priv(dev);
  1068  struct iw_range *range = (struct iw_range *)extra;
  1069  int i, k;
  1070  
  1071  DPRINTK(2, "\n");
  1072  
  1073  if (priv->sleep_mode == SLP_SLEEP)
  1074  return -EPERM;
  1075  
  1076  /* for SLEEP MODE */
  1077  dwrq->length = sizeof(struct iw_range);
  1078  memset(range, 0, sizeof(*range));
  1079  range->min_nwid = 0x;
  1080  range->max_nwid = 0x;
  1081  range->num_channels = 14;
  1082  /* Should be based on cap_rid.country to give only
  1083   * what the current card support
  1084   */
  1085  k = 0;
  1086  for (i = 0; i < 13; i++) {  /* channel 1 -- 13 */
^^
  1087  range->freq[k].i = i + 1;   /* List index */
  1088  range->freq[k].m = frequency_list[i] * 10;
  1089  range->freq[k++].e = 1; /* Values in table in MHz -> * 
10^5 * 10 */
  1090  }

i is always 13 after the loop.

  1091  range->num_frequency = k;
  1092  if (priv->reg.phy_type == D_11B_ONLY_MODE || priv->reg.phy_type 
== D_11BG_COMPATIBLE_MODE) {/* channel 14 */
  1093  range->freq[13].i = 14; /* List index */
  1094  range->freq[13].m = frequency_list[13] * 10;
  1095  range->freq[13].e = 1;  /* Values in table in MHz -> * 
10^5 * 10 */
  1096  range->num_frequency = 14;
  1097  }
  1098  
  1099  /* Hum... Should put the right values there */
  1100  range->max_qual.qual = 100;
  1101  range->max_qual.level = 256 - 128;  /* 0 dBm? */
  1102  range->max_qual.noise = 256 - 128;
  1103  range->sensitivity = 1;
  1104  
  1105  if (priv->reg.phy_type == D_11B_ONLY_MODE) {
  1106  range->bitrate[0] = 1e6;
  1107  range->bitrate[1] = 2e6;
  1108  range->bitrate[2] = 5.5e6;
  1109  range->bitrate[3] = 11e6;
  1110  range->num_bitrates = 4;
    } else {/* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE */
  1112  range->bitrate[0] = 1e6;
  1113  range->bitrate[1] = 2e6;
  1114  range->bitrate[2] = 5.5e6;
  1115  range->bitrate[3] = 11e6;
  1116  
  1117  range->bitrate[4] = 6e6;
  1118  range->bitrate[5] = 9e6;
  1119  range->bitrate[6] = 12e6;
  1120  if (IW_MAX_BITRATES < 9) {
  1121  range->bitrate[7] = 54e6;
  1122  range->num_bitrates = 8;
  1123  } else {
  1124  range->bitrate[7] = 18e6;
  1125  range->bitrate[8] = 24e6;
  1126  range->bitrate[9] = 36e6;
  1127  range->bitrate[10] = 48e6;
  1128  range->bitrate[11] = 54e6;
  1129  
  1130  range->num_bitrates = 12;
  1131  }
  1132  }
  1133  
  1134  /* Set an indication of the max TCP throughput
  1135   * in bit/s that we can expect using this interface.
  1136   * May be use for QoS stuff... Jean II
  1137   */
  1138  if (i > 2)
^
So this condition is always true.  I'm not sure what was intended,
though.

  1139  range->throughput = 5000 * 1000;
  1140  else
  1141  range->throughput = 1500 * 1000;
  1142  

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


[PATCH] staging/atomisp: fix && vs || typos

2017-04-28 Thread Dan Carpenter
These sanity checks don't work because they use && instead of ||.  It's
impossible to be both negative and greater than 5.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c 
b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
index a322539d2621..4b1fa9c7bb81 100644
--- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
+++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
@@ -67,7 +67,7 @@ int vlv2_plat_set_clock_freq(int clk_num, int freq_type)
 {
void __iomem *addr;
 
-   if (clk_num < 0 && clk_num > MAX_CLK_COUNT) {
+   if (clk_num < 0 || clk_num > MAX_CLK_COUNT) {
pr_err("Clock number out of range (%d)\n", clk_num);
return -EINVAL;
}
@@ -103,7 +103,7 @@ int vlv2_plat_get_clock_freq(int clk_num)
 {
u32 ret;
 
-   if (clk_num < 0 && clk_num > MAX_CLK_COUNT) {
+   if (clk_num < 0 || clk_num > MAX_CLK_COUNT) {
pr_err("Clock number out of range (%d)\n", clk_num);
return -EINVAL;
}
@@ -133,7 +133,7 @@ int vlv2_plat_configure_clock(int clk_num, u32 conf)
 {
void __iomem *addr;
 
-   if (clk_num < 0 && clk_num > MAX_CLK_COUNT) {
+   if (clk_num < 0 || clk_num > MAX_CLK_COUNT) {
pr_err("Clock number out of range (%d)\n", clk_num);
return -EINVAL;
}
@@ -169,7 +169,7 @@ int vlv2_plat_get_clock_status(int clk_num)
 {
int ret;
 
-   if (clk_num < 0 && clk_num > MAX_CLK_COUNT) {
+   if (clk_num < 0 || clk_num > MAX_CLK_COUNT) {
pr_err("Clock number out of range (%d)\n", clk_num);
return -EINVAL;
}
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing 751/981] drivers/staging/rtl8723bs/os_dep/sdio_intf.c:627:2-4: WARNING: possible condition with no effect (if == else) (fwd)

2017-04-28 Thread Julia Lawall
As far as I can see, the only code that can be executed in line 621 - 635
is ret = rtw_resume_process(padapter);.  Perhaps it can be simplified.

julia

-- Forwarded message --
Date: Fri, 28 Apr 2017 22:13:26 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: [staging:staging-testing 751/981]
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:627:2-4: WARNING: possible
condition with no effect (if == else)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   7ecb36442d12f197310a336a0e963badd238f35e
commit: 554c0a3abf216c991c5ebddcdb2c08689ecd290b [751/981] staging: Add 
rtl8723bs sdio wifi driver
:: branch date: 4 hours ago
:: commit date: 3 weeks ago

>> drivers/staging/rtl8723bs/os_dep/sdio_intf.c:627:2-4: WARNING: possible 
>> condition with no effect (if == else)

git remote add staging 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout 554c0a3abf216c991c5ebddcdb2c08689ecd290b
vim +627 drivers/staging/rtl8723bs/os_dep/sdio_intf.c

554c0a3a Hans de Goede 2017-03-29  611  struct pwrctrl_priv *pwrpriv = 
dvobj_to_pwrctl(psdpriv);
554c0a3a Hans de Goede 2017-03-29  612  struct adapter *padapter = 
psdpriv->if1;
554c0a3a Hans de Goede 2017-03-29  613  struct mlme_ext_priv *pmlmeext 
= &padapter->mlmeextpriv;
554c0a3a Hans de Goede 2017-03-29  614  int ret = 0;
554c0a3a Hans de Goede 2017-03-29  615  struct debug_priv *pdbgpriv = 
&psdpriv->drv_dbg;
554c0a3a Hans de Goede 2017-03-29  616
554c0a3a Hans de Goede 2017-03-29  617  DBG_871X("==> %s (%s:%d)\n", 
__func__, current->comm, current->pid);
554c0a3a Hans de Goede 2017-03-29  618
554c0a3a Hans de Goede 2017-03-29  619  pdbgpriv->dbg_resume_cnt++;
554c0a3a Hans de Goede 2017-03-29  620
554c0a3a Hans de Goede 2017-03-29  621  if 
(pwrpriv->bInternalAutoSuspend)
554c0a3a Hans de Goede 2017-03-29  622  {
554c0a3a Hans de Goede 2017-03-29  623  ret = 
rtw_resume_process(padapter);
554c0a3a Hans de Goede 2017-03-29  624  }
554c0a3a Hans de Goede 2017-03-29  625  else
554c0a3a Hans de Goede 2017-03-29  626  {
554c0a3a Hans de Goede 2017-03-29 @627  if 
(pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode)
554c0a3a Hans de Goede 2017-03-29  628  {
554c0a3a Hans de Goede 2017-03-29  629  ret = 
rtw_resume_process(padapter);
554c0a3a Hans de Goede 2017-03-29  630  }
554c0a3a Hans de Goede 2017-03-29  631  else
554c0a3a Hans de Goede 2017-03-29  632  {
554c0a3a Hans de Goede 2017-03-29  633  ret = 
rtw_resume_process(padapter);
554c0a3a Hans de Goede 2017-03-29  634  }
554c0a3a Hans de Goede 2017-03-29  635  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: remove line continuations in quoted strings

2017-04-28 Thread Ilia Sergachev
Checkpatch emits WARNING: Avoid line continuations in quoted strings.

Remove line continuations - split strings using quotes.

Signed-off-by: Ilia Sergachev 
---
 drivers/staging/ks7010/ks_hostif.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 7151f16e2f9c..a0c632a52f48 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -191,9 +191,15 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
link_ap_info_t *ap_info)
wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
}
DPRINTK(4, "\nLink AP\n");
-   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
-   essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n
channel=%d\n \
-   rssi=%d\nsq=%d\ncapability=%04X\n", ap->bssid[0], ap->bssid[1], 
ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5], &(ap->ssid.body[0]), 
ap->rate_set.body[0], ap->rate_set.body[1], ap->rate_set.body[2], 
ap->rate_set.body[3], ap->rate_set.body[4], ap->rate_set.body[5], 
ap->rate_set.body[6], ap->rate_set.body[7], ap->channel, ap->rssi, ap->sq, 
ap->capability);
+   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
+   "essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
+   "channel=%d\nrssi=%d\nsq=%d\ncapability=%04X\n",
+   ap->bssid[0], ap->bssid[1], ap->bssid[2],
+   ap->bssid[3], ap->bssid[4], ap->bssid[5],
+   &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
+   ap->rate_set.body[2], ap->rate_set.body[3], ap->rate_set.body[4],
+   ap->rate_set.body[5], ap->rate_set.body[6], ap->rate_set.body[7],
+   ap->channel, ap->rssi, ap->sq, ap->capability);
DPRINTK(4, "\nLink AP\nrsn.mode=%d\nrsn.size=%d\n",
ap_info->rsn_mode, ap_info->rsn.size);
DPRINTK(4, "\next_rate_set_size=%d\nrate_set_size=%d\n",
@@ -1014,9 +1020,11 @@ void hostif_phy_information_confirm(struct 
ks_wlan_private *priv)
wstats->qual.noise = 0; /* invalid noise value */
wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
 
-   DPRINTK(3, "\nrssi=%u\nsignal=%u\nLinkSpeed=%ux500Kbps\n \
-   TransmittedFrameCount=%u\nReceivedFragmentCount=%u\n
FailedCount=%u\n \
-   FCSErrorCount=%u\n", rssi, signal, LinkSpeed, TransmittedFrameCount, 
ReceivedFragmentCount, FailedCount, FCSErrorCount);
+   DPRINTK(3, "\nrssi=%u\nsignal=%u\nLinkSpeed=%ux500Kbps\n"
+   "TransmittedFrameCount=%u\nReceivedFragmentCount=%u\n"
+   "FailedCount=%u\nFCSErrorCount=%u\n",
+   rssi, signal, LinkSpeed, TransmittedFrameCount,
+   ReceivedFragmentCount, FailedCount, FCSErrorCount);
 
/* wake_up_interruptible_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
-- 
2.11.0

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


Re: [PATCH] staging: ks7010: remove line continuations in quoted strings

2017-04-28 Thread Dan Carpenter
On Fri, Apr 28, 2017 at 04:19:28PM +0200, Ilia Sergachev wrote:
> Checkpatch emits WARNING: Avoid line continuations in quoted strings.
> 
> Remove line continuations - split strings using quotes.
> 
> Signed-off-by: Ilia Sergachev 
> ---
>  drivers/staging/ks7010/ks_hostif.c | 20 ++--
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.c 
> b/drivers/staging/ks7010/ks_hostif.c
> index 7151f16e2f9c..a0c632a52f48 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -191,9 +191,15 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
> link_ap_info_t *ap_info)
>   wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
>   }
>   DPRINTK(4, "\nLink AP\n");
> - DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
> -   essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n
> channel=%d\n \
> -   rssi=%d\nsq=%d\ncapability=%04X\n", ap->bssid[0], ap->bssid[1], 
> ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5], &(ap->ssid.body[0]), 
> ap->rate_set.body[0], ap->rate_set.body[1], ap->rate_set.body[2], 
> ap->rate_set.body[3], ap->rate_set.body[4], ap->rate_set.body[5], 
> ap->rate_set.body[6], ap->rate_set.body[7], ap->channel, ap->rssi, ap->sq, 
> ap->capability);
> + DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
> + "essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
> + "channel=%d\nrssi=%d\nsq=%d\ncapability=%04X\n",
> + ap->bssid[0], ap->bssid[1], ap->bssid[2],
> + ap->bssid[3], ap->bssid[4], ap->bssid[5],
> + &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
> + ap->rate_set.body[2], ap->rate_set.body[3], ap->rate_set.body[4],
> + ap->rate_set.body[5], ap->rate_set.body[6], ap->rate_set.body[7],
> + ap->channel, ap->rssi, ap->sq, ap->capability);

Could you indent it like this:

DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
   "essid=%s\n
rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
   "channel=%d\nrssi=%d\nsq=%d\n
capability=%04X\n",
ap->bssid[0], ap->bssid[1], ap->bssid[2],
ap->bssid[3], ap->bssid[4], ap->bssid[5],
&(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
ap->rate_set.body[2], ap->rate_set.body[3], 
ap->rate_set.body[4],
ap->rate_set.body[5], ap->rate_set.body[6], 
ap->rate_set.body[7],
ap->channel, ap->rssi, ap->sq, ap->capability);

And actually it might be more readable to break it up more:

DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
   "essid=%s\n"
   "rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
   "channel=%d\n"
   "rssi=%d\n"
   "sq=%d\n"
   "capability=%04X\n",
ap->bssid[0], ap->bssid[1], ap->bssid[2],
ap->bssid[3], ap->bssid[4], ap->bssid[5],
&(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
ap->rate_set.body[2], ap->rate_set.body[3], 
ap->rate_set.body[4],
ap->rate_set.body[5], ap->rate_set.body[6], 
ap->rate_set.body[7],
ap->channel, ap->rssi, ap->sq, ap->capability);

Except that's not really how newlines are supposed to work in dmesg...
Whatever.

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


Re: [bug report] staging: ks7010: add driver from Nanonote extra-repository

2017-04-28 Thread Wolfram Sang
On Fri, Apr 28, 2017 at 04:41:33PM +0300, Dan Carpenter wrote:

Adding Tobin to CC, he is way more into the driver than I am these
days...

> Hello Wolfram Sang,
> 
> The patch 13a9930d15b4: "staging: ks7010: add driver from Nanonote
> extra-repository" from May 31, 2016, leads to the following static
> checker warning:
> 
>   drivers/staging/ks7010/ks_wlan_net.c:1141 ks_wlan_get_range()
>   warn: dead code because of 'i > 2' and 'i < 13'
> 
> drivers/staging/ks7010/ks_wlan_net.c
>   1062  static int ks_wlan_get_range(struct net_device *dev,
>   1063   struct iw_request_info *info,
>   1064   struct iw_point *dwrq, char *extra)
>   1065  {
>   1066  struct ks_wlan_private *priv =
>   1067  (struct ks_wlan_private *)netdev_priv(dev);
>   1068  struct iw_range *range = (struct iw_range *)extra;
>   1069  int i, k;
>   1070  
>   1071  DPRINTK(2, "\n");
>   1072  
>   1073  if (priv->sleep_mode == SLP_SLEEP)
>   1074  return -EPERM;
>   1075  
>   1076  /* for SLEEP MODE */
>   1077  dwrq->length = sizeof(struct iw_range);
>   1078  memset(range, 0, sizeof(*range));
>   1079  range->min_nwid = 0x;
>   1080  range->max_nwid = 0x;
>   1081  range->num_channels = 14;
>   1082  /* Should be based on cap_rid.country to give only
>   1083   * what the current card support
>   1084   */
>   1085  k = 0;
>   1086  for (i = 0; i < 13; i++) {  /* channel 1 -- 13 */
> ^^
>   1087  range->freq[k].i = i + 1;   /* List index */
>   1088  range->freq[k].m = frequency_list[i] * 10;
>   1089  range->freq[k++].e = 1; /* Values in table in MHz -> 
> * 10^5 * 10 */
>   1090  }
> 
> i is always 13 after the loop.
> 
>   1091  range->num_frequency = k;
>   1092  if (priv->reg.phy_type == D_11B_ONLY_MODE || 
> priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) {/* channel 14 */
>   1093  range->freq[13].i = 14; /* List index */
>   1094  range->freq[13].m = frequency_list[13] * 10;
>   1095  range->freq[13].e = 1;  /* Values in table in MHz -> 
> * 10^5 * 10 */
>   1096  range->num_frequency = 14;
>   1097  }
>   1098  
>   1099  /* Hum... Should put the right values there */
>   1100  range->max_qual.qual = 100;
>   1101  range->max_qual.level = 256 - 128;  /* 0 dBm? */
>   1102  range->max_qual.noise = 256 - 128;
>   1103  range->sensitivity = 1;
>   1104  
>   1105  if (priv->reg.phy_type == D_11B_ONLY_MODE) {
>   1106  range->bitrate[0] = 1e6;
>   1107  range->bitrate[1] = 2e6;
>   1108  range->bitrate[2] = 5.5e6;
>   1109  range->bitrate[3] = 11e6;
>   1110  range->num_bitrates = 4;
>     } else {/* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE 
> */
>   1112  range->bitrate[0] = 1e6;
>   1113  range->bitrate[1] = 2e6;
>   1114  range->bitrate[2] = 5.5e6;
>   1115  range->bitrate[3] = 11e6;
>   1116  
>   1117  range->bitrate[4] = 6e6;
>   1118  range->bitrate[5] = 9e6;
>   1119  range->bitrate[6] = 12e6;
>   1120  if (IW_MAX_BITRATES < 9) {
>   1121  range->bitrate[7] = 54e6;
>   1122  range->num_bitrates = 8;
>   1123  } else {
>   1124  range->bitrate[7] = 18e6;
>   1125  range->bitrate[8] = 24e6;
>   1126  range->bitrate[9] = 36e6;
>   1127  range->bitrate[10] = 48e6;
>   1128  range->bitrate[11] = 54e6;
>   1129  
>   1130  range->num_bitrates = 12;
>   1131  }
>   1132  }
>   1133  
>   1134  /* Set an indication of the max TCP throughput
>   1135   * in bit/s that we can expect using this interface.
>   1136   * May be use for QoS stuff... Jean II
>   1137   */
>   1138  if (i > 2)
> ^
> So this condition is always true.  I'm not sure what was intended,
> though.
> 
>   1139  range->throughput = 5000 * 1000;
>   1140  else
>   1141  range->throughput = 1500 * 1000;
>   1142  
> 
> regards,
> dan carpenter


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


[PATCH] staging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fd

2017-04-28 Thread Horia Geantă
While dpaa2_fd.simple structure fields are marked __leXX,
corresponding cpu_to_leXX / leXX_to_cpu conversions are missing.

While here, fix dpaa2_fd_{get,set}_bpid such that BMT, IVP bits
sharing the 16-bit field with BPID are not affected.

Fixes: d3269bdc7ebc ("bus: fsl-mc: dpio: add frame descriptor and 
scatter/gather APIs")
Signed-off-by: Horia Geantă 
---
 drivers/staging/fsl-mc/include/dpaa2-fd.h | 45 ---
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/fsl-mc/include/dpaa2-fd.h 
b/drivers/staging/fsl-mc/include/dpaa2-fd.h
index 9500123cc7f9..cf7857f00a5c 100644
--- a/drivers/staging/fsl-mc/include/dpaa2-fd.h
+++ b/drivers/staging/fsl-mc/include/dpaa2-fd.h
@@ -81,6 +81,7 @@ struct dpaa2_fd {
 #define FD_OFFSET_MASK 0x0FFF
 #define FD_FORMAT_MASK 0x3
 #define FD_FORMAT_SHIFT12
+#define FD_BPID_MASK   0x3FFF
 #define SG_SHORT_LEN_FLAG_MASK 0x1
 #define SG_SHORT_LEN_FLAG_SHIFT14
 #define SG_SHORT_LEN_MASK  0x1
@@ -105,7 +106,7 @@ enum dpaa2_fd_format {
  */
 static inline dma_addr_t dpaa2_fd_get_addr(const struct dpaa2_fd *fd)
 {
-   return (dma_addr_t)fd->simple.addr;
+   return (dma_addr_t)le64_to_cpu(fd->simple.addr);
 }
 
 /**
@@ -115,7 +116,7 @@ static inline dma_addr_t dpaa2_fd_get_addr(const struct 
dpaa2_fd *fd)
  */
 static inline void dpaa2_fd_set_addr(struct dpaa2_fd *fd, dma_addr_t addr)
 {
-   fd->simple.addr = addr;
+   fd->simple.addr = cpu_to_le64(addr);
 }
 
 /**
@@ -126,7 +127,7 @@ static inline void dpaa2_fd_set_addr(struct dpaa2_fd *fd, 
dma_addr_t addr)
  */
 static inline u32 dpaa2_fd_get_frc(const struct dpaa2_fd *fd)
 {
-   return fd->simple.frc;
+   return le32_to_cpu(fd->simple.frc);
 }
 
 /**
@@ -136,7 +137,7 @@ static inline u32 dpaa2_fd_get_frc(const struct dpaa2_fd 
*fd)
  */
 static inline void dpaa2_fd_set_frc(struct dpaa2_fd *fd, u32 frc)
 {
-   fd->simple.frc = frc;
+   fd->simple.frc = cpu_to_le32(frc);
 }
 
 /**
@@ -147,7 +148,7 @@ static inline void dpaa2_fd_set_frc(struct dpaa2_fd *fd, 
u32 frc)
  */
 static inline u32 dpaa2_fd_get_ctrl(const struct dpaa2_fd *fd)
 {
-   return fd->simple.ctrl;
+   return le32_to_cpu(fd->simple.ctrl);
 }
 
 /**
@@ -157,7 +158,7 @@ static inline u32 dpaa2_fd_get_ctrl(const struct dpaa2_fd 
*fd)
  */
 static inline void dpaa2_fd_set_ctrl(struct dpaa2_fd *fd, u32 ctrl)
 {
-   fd->simple.ctrl = ctrl;
+   fd->simple.ctrl = cpu_to_le32(ctrl);
 }
 
 /**
@@ -168,7 +169,7 @@ static inline void dpaa2_fd_set_ctrl(struct dpaa2_fd *fd, 
u32 ctrl)
  */
 static inline dma_addr_t dpaa2_fd_get_flc(const struct dpaa2_fd *fd)
 {
-   return (dma_addr_t)fd->simple.flc;
+   return (dma_addr_t)le64_to_cpu(fd->simple.flc);
 }
 
 /**
@@ -178,13 +179,13 @@ static inline dma_addr_t dpaa2_fd_get_flc(const struct 
dpaa2_fd *fd)
  */
 static inline void dpaa2_fd_set_flc(struct dpaa2_fd *fd,  dma_addr_t flc_addr)
 {
-   fd->simple.flc = flc_addr;
+   fd->simple.flc = cpu_to_le64(flc_addr);
 }
 
 static inline bool dpaa2_fd_short_len(const struct dpaa2_fd *fd)
 {
-   return !!((fd->simple.format_offset >> FD_SHORT_LEN_FLAG_SHIFT)
-   & FD_SHORT_LEN_FLAG_MASK);
+   return !!((le16_to_cpu(fd->simple.format_offset) >>
+ FD_SHORT_LEN_FLAG_SHIFT) & FD_SHORT_LEN_FLAG_MASK);
 }
 
 /**
@@ -196,9 +197,9 @@ static inline bool dpaa2_fd_short_len(const struct dpaa2_fd 
*fd)
 static inline u32 dpaa2_fd_get_len(const struct dpaa2_fd *fd)
 {
if (dpaa2_fd_short_len(fd))
-   return fd->simple.len & FD_SHORT_LEN_MASK;
+   return le32_to_cpu(fd->simple.len) & FD_SHORT_LEN_MASK;
 
-   return fd->simple.len;
+   return le32_to_cpu(fd->simple.len);
 }
 
 /**
@@ -208,7 +209,7 @@ static inline u32 dpaa2_fd_get_len(const struct dpaa2_fd 
*fd)
  */
 static inline void dpaa2_fd_set_len(struct dpaa2_fd *fd, u32 len)
 {
-   fd->simple.len = len;
+   fd->simple.len = cpu_to_le32(len);
 }
 
 /**
@@ -219,7 +220,7 @@ static inline void dpaa2_fd_set_len(struct dpaa2_fd *fd, 
u32 len)
  */
 static inline uint16_t dpaa2_fd_get_offset(const struct dpaa2_fd *fd)
 {
-   return fd->simple.format_offset & FD_OFFSET_MASK;
+   return le16_to_cpu(fd->simple.format_offset) & FD_OFFSET_MASK;
 }
 
 /**
@@ -229,8 +230,8 @@ static inline uint16_t dpaa2_fd_get_offset(const struct 
dpaa2_fd *fd)
  */
 static inline void dpaa2_fd_set_offset(struct dpaa2_fd *fd, uint16_t offset)
 {
-   fd->simple.format_offset &= ~FD_OFFSET_MASK;
-   fd->simple.format_offset |= offset;
+   fd->simple.format_offset &= cpu_to_le16(~FD_OFFSET_MASK);
+   fd->simple.format_offset |= cpu_to_le16(offset);
 }
 
 /**
@@ -242,7 +243,7 @@ static inline void dpaa2_fd_set_offset(struct dpaa2_fd *fd, 
uint16_t offset)
 static inline enum dpaa2_fd_format dpaa2_fd_get_format(
const struct dpaa2_fd *fd)
 {
-   retur

[PATCH v2] staging: ks7010: remove line continuations in quoted strings

2017-04-28 Thread Ilia Sergachev
Checkpatch emits WARNING: Avoid line continuations in quoted strings.

Remove line continuations - split strings using quotes.

Signed-off-by: Ilia Sergachev 
---
Changes for v4:
 - improve indentation for better readability

 drivers/staging/ks7010/ks_hostif.c | 30 --
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 7151f16e2f9c..ad8c09dd2ed1 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -191,9 +191,21 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
link_ap_info_t *ap_info)
wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
}
DPRINTK(4, "\nLink AP\n");
-   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
-   essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n
channel=%d\n \
-   rssi=%d\nsq=%d\ncapability=%04X\n", ap->bssid[0], ap->bssid[1], 
ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5], &(ap->ssid.body[0]), 
ap->rate_set.body[0], ap->rate_set.body[1], ap->rate_set.body[2], 
ap->rate_set.body[3], ap->rate_set.body[4], ap->rate_set.body[5], 
ap->rate_set.body[6], ap->rate_set.body[7], ap->channel, ap->rssi, ap->sq, 
ap->capability);
+   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
+  "essid=%s\n"
+  "rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
+  "channel=%d\n"
+  "rssi=%d\n"
+  "sq=%d\n"
+  "capability=%04X\n",
+   ap->bssid[0], ap->bssid[1], ap->bssid[2],
+   ap->bssid[3], ap->bssid[4], ap->bssid[5],
+   &(ap->ssid.body[0]),
+   ap->rate_set.body[0], ap->rate_set.body[1],
+   ap->rate_set.body[2], ap->rate_set.body[3],
+   ap->rate_set.body[4], ap->rate_set.body[5],
+   ap->rate_set.body[6], ap->rate_set.body[7],
+   ap->channel, ap->rssi, ap->sq, ap->capability);
DPRINTK(4, "\nLink AP\nrsn.mode=%d\nrsn.size=%d\n",
ap_info->rsn_mode, ap_info->rsn.size);
DPRINTK(4, "\next_rate_set_size=%d\nrate_set_size=%d\n",
@@ -1014,9 +1026,15 @@ void hostif_phy_information_confirm(struct 
ks_wlan_private *priv)
wstats->qual.noise = 0; /* invalid noise value */
wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
 
-   DPRINTK(3, "\nrssi=%u\nsignal=%u\nLinkSpeed=%ux500Kbps\n \
-   TransmittedFrameCount=%u\nReceivedFragmentCount=%u\n
FailedCount=%u\n \
-   FCSErrorCount=%u\n", rssi, signal, LinkSpeed, TransmittedFrameCount, 
ReceivedFragmentCount, FailedCount, FCSErrorCount);
+   DPRINTK(3, "\nrssi=%u\n"
+  "signal=%u\n"
+  "LinkSpeed=%ux500Kbps\n"
+  "TransmittedFrameCount=%u\n"
+  "ReceivedFragmentCount=%u\n"
+  "FailedCount=%u\n"
+  "FCSErrorCount=%u\n",
+   rssi, signal, LinkSpeed, TransmittedFrameCount,
+   ReceivedFragmentCount, FailedCount, FCSErrorCount);
 
/* wake_up_interruptible_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
-- 
2.11.0

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


Re: [PATCH v7 1/3] staging: typec: USB Type-C Port Manager (tcpm)

2017-04-28 Thread Greg Kroah-Hartman
On Fri, Apr 28, 2017 at 06:14:44AM -0700, Guenter Roeck wrote:
> On 04/28/2017 12:28 AM, Greg Kroah-Hartman wrote:
> > On Thu, Apr 27, 2017 at 02:09:56PM -0700, Guenter Roeck wrote:
> > > --- /dev/null
> > > +++ b/drivers/staging/typec/pd.h
> > > @@ -0,0 +1,281 @@
> > > +/*
> > > + * Copyright 2015-2017 Google, Inc
> > > + *
> > > + * This program is free software; you can redistribute it and/or modify
> > > + * it under the terms of the GNU General Public License as published by
> > > + * the Free Software Foundation; either version 2 of the License, or
> > > + * (at your option) any later version.
> > 
> > I have to ask, you really mean "any later version", for all of these
> > patches, right?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> I have not really thought about it, but this is ok as-is.

Ok, patches are now applied in my USB tree, as I had to do that so they
would build properly due to dependencies there.

thanks,

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


[PATCH] staging: iio: isl29028: add isl29030 support

2017-04-28 Thread Sebastian Reichel
isl29030 is basically the same chip. The only difference
is the chip's first pin. For isl29028 its named ADDR0 and
can be used to change the chip's i2c address. For isl29030
on the other hand that pin is named Ials and is an analog
current output proportional to ALS/IR. This change is
irrelevant for the Linux driver.

This has been tested on Motorola Droid 4.

Signed-off-by: Sebastian Reichel 
---
 Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
 drivers/staging/iio/light/isl29028.c  | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt 
b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index ad10fbe61562..010e2ac43f62 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -55,6 +55,7 @@ gmt,g751  G751: Digital Temperature Sensor and 
Thermal Watchdog with Two-Wire In
 infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 
100khz)
 infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
 isil,isl29028  Intersil ISL29028 Ambient Light and Proximity Sensor
+isil,isl29030  Intersil ISL29030 Ambient Light and Proximity Sensor
 maxim,ds1050   5 Bit Programmable, Pulse-Width Modulator
 maxim,max1237  Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
 maxim,max6625  9-Bit/12-Bit Temperature Sensors with I²C-Compatible 
Serial Interface
diff --git a/drivers/staging/iio/light/isl29028.c 
b/drivers/staging/iio/light/isl29028.c
index 6bb6d37cc7d1..564a62e54b05 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -15,6 +15,10 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see .
+ *
+ * Datasheets:
+ *  - http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29028.pdf
+ *  - http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29030.pdf
  */
 
 #include 
@@ -651,6 +655,7 @@ static const struct dev_pm_ops isl29028_pm_ops = {
 
 static const struct i2c_device_id isl29028_id[] = {
{"isl29028", 0},
+   {"isl29030", 0},
{}
 };
 MODULE_DEVICE_TABLE(i2c, isl29028_id);
@@ -658,6 +663,7 @@ MODULE_DEVICE_TABLE(i2c, isl29028_id);
 static const struct of_device_id isl29028_of_match[] = {
{ .compatible = "isl,isl29028", }, /* for backward compat., don't use */
{ .compatible = "isil,isl29028", },
+   { .compatible = "isil,isl29030", },
{ },
 };
 MODULE_DEVICE_TABLE(of, isl29028_of_match);
-- 
2.11.0

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


Re: [PATCH RFC] staging: wilc1000: Refactor handling of HT caps fields

2017-04-28 Thread Jason Litzinger
> So are you going to resend this as a non-RFC patch so that I can apply
> it?  :)
Yep, apologies for the delay.

Was hoping to get my test setup up and going, but some Errata with
that version of the dev board have complicated access to the SDIO port.
I'll prepare a proper patch and get it sent out tonight (tomorrow
latest) after I update my trees and do the usual build/apply/test cycle.

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


Re: [PATCH] staging: iio: isl29028: add isl29030 support

2017-04-28 Thread Brian Masney
On Fri, Apr 28, 2017 at 05:55:58PM +0200, Sebastian Reichel wrote:
> isl29030 is basically the same chip. The only difference
> is the chip's first pin. For isl29028 its named ADDR0 and
> can be used to change the chip's i2c address. For isl29030
> on the other hand that pin is named Ials and is an analog
> current output proportional to ALS/IR. This change is
> irrelevant for the Linux driver.
> 
> This has been tested on Motorola Droid 4.
> 
> Signed-off-by: Sebastian Reichel 
> ---
>  Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
>  drivers/staging/iio/light/isl29028.c  | 6 ++
>  2 files changed, 7 insertions(+)

Hi Sebastian,

I moved this driver out of the staging directory earlier this week.
You'll need to base your patch off of IIO testing:

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/log/?h=testing

Your patch should apply cleanly once you update the file path.

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


Re: [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function

2017-04-28 Thread Logan Gunthorpe


On 28/04/17 12:30 AM, Herbert Xu wrote:
> You are right.  Indeed the existing code looks buggy as they
> don't take sg->offset into account when doing the kmap.  Could
> you send me some patches that fix these problems first so that
> they can be easily backported?

Ok, I think the only buggy one in crypto is hifn_795x. Shash and caam
both do have the sg->offset accounted for. I'll send a patch for the
buggy one shortly.

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


Re: [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function

2017-04-28 Thread Herbert Xu
On Fri, Apr 28, 2017 at 10:53:45AM -0600, Logan Gunthorpe wrote:
> 
> 
> On 28/04/17 12:30 AM, Herbert Xu wrote:
> > You are right.  Indeed the existing code looks buggy as they
> > don't take sg->offset into account when doing the kmap.  Could
> > you send me some patches that fix these problems first so that
> > they can be easily backported?
> 
> Ok, I think the only buggy one in crypto is hifn_795x. Shash and caam
> both do have the sg->offset accounted for. I'll send a patch for the
> buggy one shortly.

I think they're all buggy when sg->offset is greater than PAGE_SIZE.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function

2017-04-28 Thread Logan Gunthorpe


On 28/04/17 11:51 AM, Herbert Xu wrote:
> On Fri, Apr 28, 2017 at 10:53:45AM -0600, Logan Gunthorpe wrote:
>>
>>
>> On 28/04/17 12:30 AM, Herbert Xu wrote:
>>> You are right.  Indeed the existing code looks buggy as they
>>> don't take sg->offset into account when doing the kmap.  Could
>>> you send me some patches that fix these problems first so that
>>> they can be easily backported?
>>
>> Ok, I think the only buggy one in crypto is hifn_795x. Shash and caam
>> both do have the sg->offset accounted for. I'll send a patch for the
>> buggy one shortly.
> 
> I think they're all buggy when sg->offset is greater than PAGE_SIZE.

Yes, technically. But that's a _very_ common mistake. Pretty nearly
every case I looked at did not take that into account. I don't think
sg's that point to more than one continuous page are all that common.

Fixing all those cases without making a common function is a waste of
time IMO.

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


[staging:staging-testing 393/1005] drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:503:6-12: ERROR: invalid reference to the index variable of the iterator on line 456 (fwd)

2017-04-28 Thread Julia Lawall
The code under the error label may not be meaningful if error is reached
from line 495.

julia


-- Forwarded message --
Date: Sat, 29 Apr 2017 01:52:34 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: [staging:staging-testing 393/1005]
drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:503:6-12: ERROR:
invalid reference to the index variable of the iterator on line 456

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   11270059e8d0b6f80801fac910c4ef751ca05c4c
commit: 49637a458b61629672a8ae19fdae2058c64815cf [393/1005] staging: media: 
atomisp: remove '.' from pci Makefile
:: branch date: 2 hours ago
:: commit date: 7 weeks ago

>> drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:503:6-12: ERROR: 
>> invalid reference to the index variable of the iterator on line 456

git remote add staging 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout 49637a458b61629672a8ae19fdae2058c64815cf
vim +503 drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c

a49d2536 Alan Cox 2017-02-17  450   if (asd->acc.pipeline || 
asd->acc.extension_mode)
a49d2536 Alan Cox 2017-02-17  451   return -EBUSY;
a49d2536 Alan Cox 2017-02-17  452
a49d2536 Alan Cox 2017-02-17  453   /* Invalidate caches. FIXME: should 
flush only necessary buffers */
a49d2536 Alan Cox 2017-02-17  454   wbinvd();
a49d2536 Alan Cox 2017-02-17  455
a49d2536 Alan Cox 2017-02-17 @456   list_for_each_entry(acc_fw, 
&asd->acc.fw, list) {
a49d2536 Alan Cox 2017-02-17  457   if (acc_fw->type != 
ATOMISP_ACC_FW_LOAD_TYPE_OUTPUT &&
a49d2536 Alan Cox 2017-02-17  458   acc_fw->type != 
ATOMISP_ACC_FW_LOAD_TYPE_VIEWFINDER)
a49d2536 Alan Cox 2017-02-17  459   continue;
a49d2536 Alan Cox 2017-02-17  460
a49d2536 Alan Cox 2017-02-17  461   for (i = 0; i < 
ARRAY_SIZE(acc_flag_to_pipe); i++) {
a49d2536 Alan Cox 2017-02-17  462   /* QoS (ACC pipe) 
acceleration stages are currently
a49d2536 Alan Cox 2017-02-17  463* allowed only in 
continuous mode. Skip them for
a49d2536 Alan Cox 2017-02-17  464* all other modes. */
a49d2536 Alan Cox 2017-02-17  465   if (!continuous &&
a49d2536 Alan Cox 2017-02-17  466   
acc_flag_to_pipe[i].flag ==
a49d2536 Alan Cox 2017-02-17  467   
ATOMISP_ACC_FW_LOAD_FL_ACC)
a49d2536 Alan Cox 2017-02-17  468   continue;
a49d2536 Alan Cox 2017-02-17  469
a49d2536 Alan Cox 2017-02-17  470   if (acc_fw->flags & 
acc_flag_to_pipe[i].flag) {
a49d2536 Alan Cox 2017-02-17  471   ret = 
atomisp_css_load_acc_extension(asd,
a49d2536 Alan Cox 2017-02-17  472   
acc_fw->fw,
a49d2536 Alan Cox 2017-02-17  473   
acc_flag_to_pipe[i].pipe_id,
a49d2536 Alan Cox 2017-02-17  474   
acc_fw->type);
a49d2536 Alan Cox 2017-02-17  475   if (ret) {
a49d2536 Alan Cox 2017-02-17  476   i--;
a49d2536 Alan Cox 2017-02-17  477   goto 
error;
a49d2536 Alan Cox 2017-02-17  478   }
a49d2536 Alan Cox 2017-02-17  479
a49d2536 Alan Cox 2017-02-17  480   ext_loaded = 
true;
a49d2536 Alan Cox 2017-02-17  481   }
a49d2536 Alan Cox 2017-02-17  482   }
a49d2536 Alan Cox 2017-02-17  483
a49d2536 Alan Cox 2017-02-17  484   ret = 
atomisp_css_set_acc_parameters(acc_fw);
a49d2536 Alan Cox 2017-02-17  485   if (ret < 0)
a49d2536 Alan Cox 2017-02-17  486   goto error;
a49d2536 Alan Cox 2017-02-17  487   }
a49d2536 Alan Cox 2017-02-17  488
a49d2536 Alan Cox 2017-02-17  489   if (!ext_loaded)
a49d2536 Alan Cox 2017-02-17  490   return ret;
a49d2536 Alan Cox 2017-02-17  491
a49d2536 Alan Cox 2017-02-17  492   ret = atomisp_css_update_stream(asd);
a49d2536 Alan Cox 2017-02-17  493   if (ret) {
a49d2536 Alan Cox 2017-02-17  494   dev_err(isp->dev, "%s: update 
stream failed.\n", __func__);
a49d2536 Alan Cox 2017-02-17  495   goto error;
a49d2536 Alan Cox 2017-02-17  496   }
a49d2536 Alan Cox 2017-02-17  497
a49d2536 Alan Cox 2017-02-17  498   asd->acc.extension_mode = true;
a49d2536 Alan Cox 2017-02-17  499   return 0;
a49d2536 Alan Cox 2017-02-17  500
a49d2536 Alan Cox 2017-02-17  501  error:
a49d2536 Alan Cox 2017-02-17  502   for (; i >= 0; i--) {
a49d2536 Alan Cox 2017-02-17 @503   if (acc_fw->flags & 
acc_flag_to_pipe[i].flag) {
a49d2536 Alan Cox 2017-02-17  504   
atomisp_css_unload_acc_extensi

Re: [PATCH] staging: ks7010: remove line continuations in quoted strings

2017-04-28 Thread Joe Perches
On Fri, 2017-04-28 at 17:26 +0300, Dan Carpenter wrote:
> On Fri, Apr 28, 2017 at 04:19:28PM +0200, Ilia Sergachev wrote:
> > Checkpatch emits WARNING: Avoid line continuations in quoted strings.
> > 
> > Remove line continuations - split strings using quotes.
> > 
> > Signed-off-by: Ilia Sergachev 
> > ---
> >  drivers/staging/ks7010/ks_hostif.c | 20 ++--
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks_hostif.c 
> > b/drivers/staging/ks7010/ks_hostif.c
> > index 7151f16e2f9c..a0c632a52f48 100644
> > --- a/drivers/staging/ks7010/ks_hostif.c
> > +++ b/drivers/staging/ks7010/ks_hostif.c
> > @@ -191,9 +191,15 @@ int get_current_ap(struct ks_wlan_private *priv, 
> > struct link_ap_info_t *ap_info)
> > wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
> > }
> > DPRINTK(4, "\nLink AP\n");
> > -   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
> > -   essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n
> > channel=%d\n \
> > -   rssi=%d\nsq=%d\ncapability=%04X\n", ap->bssid[0], ap->bssid[1], 
> > ap->bssid[2], ap->bssid[3], ap->bssid[4], ap->bssid[5], 
> > &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1], 
> > ap->rate_set.body[2], ap->rate_set.body[3], ap->rate_set.body[4], 
> > ap->rate_set.body[5], ap->rate_set.body[6], ap->rate_set.body[7], 
> > ap->channel, ap->rssi, ap->sq, ap->capability);
> > +   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02bX:%02X\n"
> > +   "essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
> > +   "channel=%d\nrssi=%d\nsq=%d\ncapability=%04X\n",
> > +   ap->bssid[0], ap->bssid[1], ap->bssid[2],
> > +   ap->bssid[3], ap->bssid[4], ap->bssid[5],
> > +   &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
> > +   ap->rate_set.body[2], ap->rate_set.body[3], ap->rate_set.body[4],
> > +   ap->rate_set.body[5], ap->rate_set.body[6], ap->rate_set.body[7],
> > +   ap->channel, ap->rssi, ap->sq, ap->capability);
> 
> Could you indent it like this:
> 
>   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
>  "essid=%s\n
> rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
>  "channel=%d\nrssi=%d\nsq=%d\n
> capability=%04X\n",
>   ap->bssid[0], ap->bssid[1], ap->bssid[2],
>   ap->bssid[3], ap->bssid[4], ap->bssid[5],
>   &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
>   ap->rate_set.body[2], ap->rate_set.body[3], 
> ap->rate_set.body[4],
>   ap->rate_set.body[5], ap->rate_set.body[6], 
> ap->rate_set.body[7],
>   ap->channel, ap->rssi, ap->sq, ap->capability);
> 
> And actually it might be more readable to break it up more:
> 
>   DPRINTK(4, "bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
>  "essid=%s\n"
>  "rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n"
>  "channel=%d\n"
>  "rssi=%d\n"
>  "sq=%d\n"
>  "capability=%04X\n",
>   ap->bssid[0], ap->bssid[1], ap->bssid[2],
>   ap->bssid[3], ap->bssid[4], ap->bssid[5],
>   &(ap->ssid.body[0]), ap->rate_set.body[0], ap->rate_set.body[1],
>   ap->rate_set.body[2], ap->rate_set.body[3], 
> ap->rate_set.body[4],
>   ap->rate_set.body[5], ap->rate_set.body[6], 
> ap->rate_set.body[7],
>   ap->channel, ap->rssi, ap->sq, ap->capability);

And it might be smaller object code for some arches
to use one DPRINTK call for each line.

Probably more readable in the logs too with each line
timestamped instead of just the first line.

(and use %pM assuming bssid is char)

DPRINTK(4, "bssid=%pM\n", ap->bssid);
DPRINTK(4, "essud=%s\n", ap->ssid.body);
DPRINTK(4, "rate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n",
ap->rate_set.body[0], ap->rate_set.body[1],
ap->rate_set.body[2], ap->rate_set.body[3],
ap->rate_set.body[4], ap->rate_set.body[5],
ap->rate_set.body[6], ap->rate_set.body[7]);
DPRINTK(4, "channel=%d\n", ap->channel);
DPRINTK(4, "rssi=%d\n", ap->rssi);
DPRINTK(4, "sq=%d\n", ap->sq);
DPRINTK(4, "capability=%04X\n", ap->capability);


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


[PATCH] staging: fbtft: fbtft-core.c: EXPORT_SYMBOL should immediately follow its function

2017-04-28 Thread Shiva Kerdel
This patch fixes the following checkpatch.pl warning
- EXPORT_SYMBOL(foo); should immediately follow its function/variable

Signed-off-by: Shiva Kerdel 
---
 drivers/staging/fbtft/fbtft-core.c | 25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c 
b/drivers/staging/fbtft/fbtft-core.c
index b742ee7..b004a4d 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -275,23 +275,31 @@ static int fbtft_backlight_get_brightness(struct 
backlight_device *bd)
return bd->props.brightness;
 }
 
+static const struct backlight_ops fbtft_bl_ops = {
+   .get_brightness = fbtft_backlight_get_brightness,
+   .update_status  = fbtft_backlight_update_status,
+};
+#endif
+
 void fbtft_unregister_backlight(struct fbtft_par *par)
 {
+   #ifdef CONFIG_FB_BACKLIGHT
+
if (par->info->bl_dev) {
par->info->bl_dev->props.power = FB_BLANK_POWERDOWN;
backlight_update_status(par->info->bl_dev);
backlight_device_unregister(par->info->bl_dev);
par->info->bl_dev = NULL;
}
-}
 
-static const struct backlight_ops fbtft_bl_ops = {
-   .get_brightness = fbtft_backlight_get_brightness,
-   .update_status  = fbtft_backlight_update_status,
-};
+   #endif
+}
+EXPORT_SYMBOL(fbtft_unregister_backlight);
 
 void fbtft_register_backlight(struct fbtft_par *par)
 {
+   #ifdef CONFIG_FB_BACKLIGHT
+
struct backlight_device *bd;
struct backlight_properties bl_props = { 0, };
 
@@ -320,13 +328,10 @@ void fbtft_register_backlight(struct fbtft_par *par)
 
if (!par->fbtftops.unregister_backlight)
par->fbtftops.unregister_backlight = fbtft_unregister_backlight;
+
+   #endif
 }
-#else
-void fbtft_register_backlight(struct fbtft_par *par) { };
-void fbtft_unregister_backlight(struct fbtft_par *par) { };
-#endif
 EXPORT_SYMBOL(fbtft_register_backlight);
-EXPORT_SYMBOL(fbtft_unregister_backlight);
 
 static void fbtft_set_addr_win(struct fbtft_par *par, int xs, int ys, int xe,
   int ye)
-- 
2.10.2

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


[PATCH] Fix check-patch symbolic permissions warnings

2017-04-28 Thread Quentin Swain
---
 drivers/staging/iio/light/tsl2x7x_core.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index af3910b..c63fe6a 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1498,34 +1498,34 @@ static int tsl2x7x_write_raw(struct iio_dev *indio_dev,
return 0;
 }
 
-static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(power_state, 0644,
tsl2x7x_power_state_show, tsl2x7x_power_state_store);
 
-static DEVICE_ATTR(in_proximity0_calibscale_available, S_IRUGO,
+static DEVICE_ATTR(in_proximity0_calibscale_available, 0444,
tsl2x7x_prox_gain_available_show, NULL);
 
-static DEVICE_ATTR(in_illuminance0_calibscale_available, S_IRUGO,
+static DEVICE_ATTR(in_illuminance0_calibscale_available, 0444,
tsl2x7x_gain_available_show, NULL);
 
-static DEVICE_ATTR(in_illuminance0_integration_time, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_integration_time, 0644,
tsl2x7x_als_time_show, tsl2x7x_als_time_store);
 
-static DEVICE_ATTR(in_illuminance0_target_input, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_target_input, 0644,
tsl2x7x_als_cal_target_show, tsl2x7x_als_cal_target_store);
 
-static DEVICE_ATTR(in_illuminance0_calibrate, S_IWUSR, NULL,
+static DEVICE_ATTR(in_illuminance0_calibrate, 0200, NULL,
tsl2x7x_do_calibrate);
 
-static DEVICE_ATTR(in_proximity0_calibrate, S_IWUSR, NULL,
+static DEVICE_ATTR(in_proximity0_calibrate, 0200, NULL,
tsl2x7x_do_prox_calibrate);
 
-static DEVICE_ATTR(in_illuminance0_lux_table, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_lux_table, 0644,
tsl2x7x_luxtable_show, tsl2x7x_luxtable_store);
 
-static DEVICE_ATTR(in_intensity0_thresh_period, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_intensity0_thresh_period, 0644,
tsl2x7x_als_persistence_show, tsl2x7x_als_persistence_store);
 
-static DEVICE_ATTR(in_proximity0_thresh_period, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_proximity0_thresh_period, 0644,
tsl2x7x_prox_persistence_show, tsl2x7x_prox_persistence_store);
 
 /* Use the default register values to identify the Taos device */
-- 
2.10.2

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


Fix permissions warning from check-patch for tsl2x7x

2017-04-28 Thread Quentin Swain

Mistyped the address for the staging list in the first email. Sorry about that.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: use memdup_user

2017-04-28 Thread Geliang Tang
Use memdup_user() helper instead of open-coding to simplify the code.

Signed-off-by: Geliang Tang 
---
 drivers/staging/comedi/comedi_fops.c | 22 +++---
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index f191c2a..4797c8f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1450,22 +1450,14 @@ static int do_insnlist_ioctl(struct comedi_device *dev,
return -EFAULT;
 
data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
-   if (!data) {
-   ret = -ENOMEM;
-   goto error;
-   }
-
-   insns = kcalloc(insnlist.n_insns, sizeof(*insns), GFP_KERNEL);
-   if (!insns) {
-   ret = -ENOMEM;
-   goto error;
-   }
+   if (!data)
+   return -ENOMEM;
 
-   if (copy_from_user(insns, insnlist.insns,
-  sizeof(*insns) * insnlist.n_insns)) {
-   dev_dbg(dev->class_dev, "copy_from_user failed\n");
-   ret = -EFAULT;
-   goto error;
+   insns = memdup_user(insnlist.insns, sizeof(*insns) * insnlist.n_insns);
+   if (IS_ERR(insns)) {
+   dev_dbg(dev->class_dev, "memdup_user failed\n");
+   kfree(data);
+   return PTR_ERR(insns);
}
 
for (i = 0; i < insnlist.n_insns; i++) {
-- 
2.9.3

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


Re: [PATCH] staging: comedi: use memdup_user

2017-04-28 Thread Joe Perches
On Sat, 2017-04-29 at 09:45 +0800, Geliang Tang wrote:
> Use memdup_user() helper instead of open-coding to simplify the code.

While I doubt this is a problem, this loses
the multiplication overflow check for
sizeof(*insns) * insnlist.n_isns

> diff --git a/drivers/staging/comedi/comedi_fops.c 
> b/drivers/staging/comedi/comedi_fops.c
[]
> @@ -1450,22 +1450,14 @@ static int do_insnlist_ioctl(struct comedi_device 
> *dev,
>   return -EFAULT;
>  
>   data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
> - if (!data) {
> - ret = -ENOMEM;
> - goto error;
> - }
> -
> - insns = kcalloc(insnlist.n_insns, sizeof(*insns), GFP_KERNEL);
> - if (!insns) {
> - ret = -ENOMEM;
> - goto error;
> - }
> + if (!data)
> + return -ENOMEM;
>  
> - if (copy_from_user(insns, insnlist.insns,
> -sizeof(*insns) * insnlist.n_insns)) {
> - dev_dbg(dev->class_dev, "copy_from_user failed\n");
> - ret = -EFAULT;
> - goto error;
> + insns = memdup_user(insnlist.insns, sizeof(*insns) * insnlist.n_insns);
> + if (IS_ERR(insns)) {
> + dev_dbg(dev->class_dev, "memdup_user failed\n");
> + kfree(data);
> + return PTR_ERR(insns);
>   }
>  
>   for (i = 0; i < insnlist.n_insns; i++) {
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Fix check-patch symbolic permissions warnings

2017-04-28 Thread Greg KH
On Fri, Apr 28, 2017 at 07:12:46PM -0400, Quentin Swain wrote:
> ---
>  drivers/staging/iio/light/tsl2x7x_core.c | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
> b/drivers/staging/iio/light/tsl2x7x_core.c
> index af3910b..c63fe6a 100644
> --- a/drivers/staging/iio/light/tsl2x7x_core.c
> +++ b/drivers/staging/iio/light/tsl2x7x_core.c
> @@ -1498,34 +1498,34 @@ static int tsl2x7x_write_raw(struct iio_dev 
> *indio_dev,
>   return 0;
>  }
>  
> -static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(power_state, 0644,
>   tsl2x7x_power_state_show, tsl2x7x_power_state_store);
>  
> -static DEVICE_ATTR(in_proximity0_calibscale_available, S_IRUGO,
> +static DEVICE_ATTR(in_proximity0_calibscale_available, 0444,
>   tsl2x7x_prox_gain_available_show, NULL);
>  
> -static DEVICE_ATTR(in_illuminance0_calibscale_available, S_IRUGO,
> +static DEVICE_ATTR(in_illuminance0_calibscale_available, 0444,
>   tsl2x7x_gain_available_show, NULL);
>  
> -static DEVICE_ATTR(in_illuminance0_integration_time, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(in_illuminance0_integration_time, 0644,
>   tsl2x7x_als_time_show, tsl2x7x_als_time_store);
>  
> -static DEVICE_ATTR(in_illuminance0_target_input, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(in_illuminance0_target_input, 0644,
>   tsl2x7x_als_cal_target_show, tsl2x7x_als_cal_target_store);
>  
> -static DEVICE_ATTR(in_illuminance0_calibrate, S_IWUSR, NULL,
> +static DEVICE_ATTR(in_illuminance0_calibrate, 0200, NULL,
>   tsl2x7x_do_calibrate);
>  
> -static DEVICE_ATTR(in_proximity0_calibrate, S_IWUSR, NULL,
> +static DEVICE_ATTR(in_proximity0_calibrate, 0200, NULL,
>   tsl2x7x_do_prox_calibrate);
>  
> -static DEVICE_ATTR(in_illuminance0_lux_table, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(in_illuminance0_lux_table, 0644,
>   tsl2x7x_luxtable_show, tsl2x7x_luxtable_store);
>  
> -static DEVICE_ATTR(in_intensity0_thresh_period, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(in_intensity0_thresh_period, 0644,
>   tsl2x7x_als_persistence_show, tsl2x7x_als_persistence_store);
>  
> -static DEVICE_ATTR(in_proximity0_thresh_period, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(in_proximity0_thresh_period, 0644,
>   tsl2x7x_prox_persistence_show, tsl2x7x_prox_persistence_store);
>  
>  /* Use the default register values to identify the Taos device */
> -- 
> 2.10.2
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch contains warnings and/or errors noticed by the
  scripts/checkpatch.pl tool.

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: use memdup_user

2017-04-28 Thread Greg Kroah-Hartman
On Fri, Apr 28, 2017 at 06:53:32PM -0700, Joe Perches wrote:
> On Sat, 2017-04-29 at 09:45 +0800, Geliang Tang wrote:
> > Use memdup_user() helper instead of open-coding to simplify the code.
> 
> While I doubt this is a problem, this loses
> the multiplication overflow check for
> sizeof(*insns) * insnlist.n_isns

Yes it is a problem, we need that check.

thanks,

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


Re: [PATCH] staging: fbtft: fbtft-core.c: EXPORT_SYMBOL should immediately follow its function

2017-04-28 Thread Greg KH
On Sat, Apr 29, 2017 at 01:07:34AM +0200, Shiva Kerdel wrote:
> This patch fixes the following checkpatch.pl warning
> - EXPORT_SYMBOL(foo); should immediately follow its function/variable
> 
> Signed-off-by: Shiva Kerdel 
> ---
>  drivers/staging/fbtft/fbtft-core.c | 25 +++--
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-core.c 
> b/drivers/staging/fbtft/fbtft-core.c
> index b742ee7..b004a4d 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -275,23 +275,31 @@ static int fbtft_backlight_get_brightness(struct 
> backlight_device *bd)
>   return bd->props.brightness;
>  }
>  
> +static const struct backlight_ops fbtft_bl_ops = {
> + .get_brightness = fbtft_backlight_get_brightness,
> + .update_status  = fbtft_backlight_update_status,
> +};
> +#endif
> +
>  void fbtft_unregister_backlight(struct fbtft_par *par)
>  {
> + #ifdef CONFIG_FB_BACKLIGHT

Ick, no, does this really look like good style?

> +
>   if (par->info->bl_dev) {
>   par->info->bl_dev->props.power = FB_BLANK_POWERDOWN;
>   backlight_update_status(par->info->bl_dev);
>   backlight_device_unregister(par->info->bl_dev);
>   par->info->bl_dev = NULL;
>   }
> -}
>  
> -static const struct backlight_ops fbtft_bl_ops = {
> - .get_brightness = fbtft_backlight_get_brightness,
> - .update_status  = fbtft_backlight_update_status,
> -};
> + #endif
> +}
> +EXPORT_SYMBOL(fbtft_unregister_backlight);
>  
>  void fbtft_register_backlight(struct fbtft_par *par)
>  {
> + #ifdef CONFIG_FB_BACKLIGHT
> +
>   struct backlight_device *bd;
>   struct backlight_properties bl_props = { 0, };
>  
> @@ -320,13 +328,10 @@ void fbtft_register_backlight(struct fbtft_par *par)
>  
>   if (!par->fbtftops.unregister_backlight)
>   par->fbtftops.unregister_backlight = fbtft_unregister_backlight;
> +
> + #endif
>  }
> -#else
> -void fbtft_register_backlight(struct fbtft_par *par) { };
> -void fbtft_unregister_backlight(struct fbtft_par *par) { };
> -#endif
>  EXPORT_SYMBOL(fbtft_register_backlight);
> -EXPORT_SYMBOL(fbtft_unregister_backlight);

The original code here is fine, please leave it as-is.

thanks,

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


[PATCH] staging: fbtft: fbtft-io.c: Fix sparse warning

2017-04-28 Thread AbdAllah-MEZITI
This patch fixes the following sparse warning in fbtft/fbtft-io.c

  CHECK   drivers/staging/fbtft/fbtft-io.c
drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment 
(different base types)
drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
[unsigned] [long] [long long] [usertype] 
drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 


Signed-off-by: AbdAllah-MEZITI 
---
 drivers/staging/fbtft/fbtft-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index d868405..8d436f9 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
*buf, size_t len)
src++;
}
tmp |= ((*src & 0x0100) ? 1 : 0);
-   *(u64 *)dst = cpu_to_be64(tmp);
+   *(u64 *)dst = tmp;
dst += 8;
*dst++ = (u8)(*src++ & 0x00FF);
added++;
-- 
2.7.4

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