Re: [PATCH] staging: ft1000: code style cleanup

2015-09-14 Thread Sudip Mukherjee
On Sun, Sep 13, 2015 at 12:55:42AM +0200, lucasg wrote:
> There was a stray '*' in a comment block.
> 
> Signed-off-by: lucasg 
> ---
Greg has already applied your patch, but next time you send a patch
please use your full name in the From and Signed-off-by.

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


Re: [PATCH] Staging: wilc1000: Use NULL instead of zero

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 11:03:34AM +0530, Ronit Halder wrote:
> This patch fixes the warning generated by sparse
> "Using plain integer as NULL pointer" by using NULL
> instead of zero.
> 
> Signed-off-by: Ronit halder 
> ---
This fixes sparse warning but introduces new checkpatch warnings about
NULL comparison.

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


Re: [PATCH 1/4] Staging: rtl8192u: space required before open parentheses

2015-09-14 Thread Sudip Mukherjee
On Sun, Sep 13, 2015 at 10:42:44PM -0800, mike dupuis wrote:
> From: Mike Dupuis 
In your previous patches this From: line was not there. Why now?

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


[PATCH] Staging: lustre: lustre: lov: lov_dev.c: Added missing blank line

2015-09-14 Thread Sakshi Vaid
Added a missing blank line after declarations.

158: WARNING: Missing a blank line after declarations
183: WARNING: Missing a blank line after declarations

Signed-off-by: Sakshi Vaid 
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 4 ++--
 drivers/staging/lustre/lustre/lov/lov_dev.c| 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index d31bf73..68cf1b7 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -828,8 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct 
cl_object *obj,
 * --bug 17336 */
loff_t size = cl_isize_read(inode);
loff_t cur_index = start >> PAGE_CACHE_SHIFT;
-   loff_t size_index = ((size - 1)
-   >> PAGE_CACHE_SHIFT);
+   loff_t size_index =
+   ((size - 1) >> PAGE_CACHE_SHIFT);
 
if ((size == 0 && cur_index != 0) ||
size_index < cur_index)
diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c 
b/drivers/staging/lustre/lustre/lov/lov_dev.c
index 796a015..aadb8f2 100644
--- a/drivers/staging/lustre/lustre/lov/lov_dev.c
+++ b/drivers/staging/lustre/lustre/lov/lov_dev.c
@@ -155,6 +155,7 @@ static void lov_key_fini(const struct lu_context *ctx,
 struct lu_context_key *key, void *data)
 {
struct lov_thread_info *info = data;
+
LINVRNT(list_empty(&info->lti_closure.clc_list));
OBD_SLAB_FREE_PTR(info, lov_thread_kmem);
 }
@@ -180,6 +181,7 @@ static void lov_session_key_fini(const struct lu_context 
*ctx,
 struct lu_context_key *key, void *data)
 {
struct lov_session *info = data;
+
OBD_SLAB_FREE_PTR(info, lov_session_kmem);
 }
 
-- 
1.9.1

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


[PATCH] Staging: lustre: lustre: lclient: lcommon_cl.c: Fixed coding style error

2015-09-14 Thread Sakshi Vaid
Fixed the following error.
WARNING: More than 80 characters in a line.

Signed-off-by: Sakshi Vaid 
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index 23095bb..68cf1b7 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -828,7 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct 
cl_object *obj,
 * --bug 17336 */
loff_t size = cl_isize_read(inode);
loff_t cur_index = start >> PAGE_CACHE_SHIFT;
-   loff_t size_index = ((size - 1) >> 
PAGE_CACHE_SHIFT);
+   loff_t size_index =
+   ((size - 1) >> PAGE_CACHE_SHIFT);
 
if ((size == 0 && cur_index != 0) ||
size_index < cur_index)
-- 
1.9.1

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


Re: [PATCHv3 3/3] drm: bridge: anx78xx: Add anx78xx driver support by analogix.

2015-09-14 Thread Nicolas Boichat
Hi Enric,

Partial review for now, thanks for you work.

Best,

On Thu, Sep 10, 2015 at 06:35:52PM +0200, Enric Balletbo i Serra wrote:
> At the moment it only supports ANX7814.
> 
> The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
> designed for portable devices.
> 
> This driver adds initial support and supports HDMI to DP pass-through mode.
> 
> Signed-off-by: Enric Balletbo i Serra 
> ---

Please include a revision log here, stating what you changed between each
version.

>  drivers/gpu/drm/bridge/Kconfig   |2 +
>  drivers/gpu/drm/bridge/Makefile  |1 +
>  drivers/gpu/drm/bridge/anx78xx/Kconfig   |7 +
>  drivers/gpu/drm/bridge/anx78xx/Makefile  |4 +
>  drivers/gpu/drm/bridge/anx78xx/anx78xx.h |   44 +
>  drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c|  241 ++
>  drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c | 3198 
> ++
>  drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h |  215 ++
>  drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h |  786 ++
>  9 files changed, 4498 insertions(+)
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/Kconfig
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/Makefile
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx.h
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h
>  create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h
> 
> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> index 2de52a5..aa6fe12 100644
> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -29,4 +29,6 @@ config DRM_PARADE_PS8622
>   ---help---
> Parade eDP-LVDS bridge chip driver.
>  
> +source "drivers/gpu/drm/bridge/anx78xx/Kconfig"
> +
>  endmenu
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index e2eef1c..e5bd38b 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -3,3 +3,4 @@ ccflags-y := -Iinclude/drm
>  obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
>  obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
>  obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
> +obj-$(CONFIG_DRM_ANX78XX) += anx78xx/
> diff --git a/drivers/gpu/drm/bridge/anx78xx/Kconfig 
> b/drivers/gpu/drm/bridge/anx78xx/Kconfig
> new file mode 100644
> index 000..08f9c08
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/anx78xx/Kconfig
> @@ -0,0 +1,7 @@
> +config DRM_ANX78XX
> + tristate "Analogix ANX78XX bridge"
> + help
> + ANX78XX is a HD video transmitter chip over micro-USB
> + connector for smartphone device.
> +
> +
> diff --git a/drivers/gpu/drm/bridge/anx78xx/Makefile 
> b/drivers/gpu/drm/bridge/anx78xx/Makefile
> new file mode 100644
> index 000..a843733
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/anx78xx/Makefile
> @@ -0,0 +1,4 @@
> +obj-${CONFIG_DRM_ANX78XX} :=  anx78xx.o
> +
> +anx78xx-y += anx78xx_main.o
> +anx78xx-y += slimport_tx_drv.o
> diff --git a/drivers/gpu/drm/bridge/anx78xx/anx78xx.h 
> b/drivers/gpu/drm/bridge/anx78xx/anx78xx.h
> new file mode 100644
> index 000..4f6dd1d
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/anx78xx/anx78xx.h
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright(c) 2015, Analogix Semiconductor. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#ifndef __ANX78xx_H
> +#define __ANX78xx_H
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define AUX_ERR  1
> +#define AUX_OK   0
> +
> +struct anx78xx_platform_data {
> + struct gpio_desc *gpiod_pd;
> + struct gpio_desc *gpiod_reset;
> + spinlock_t lock;
> +};
> +
> +struct anx78xx {
> + struct i2c_client *client;
> + struct anx78xx_platform_data *pdata;
> + struct delayed_work work;
> + struct workqueue_struct *workqueue;
> + struct mutex lock;
> +};
> +
> +void anx78xx_poweron(struct anx78xx *data);
> +void anx78xx_poweroff(struct anx78xx *data);
> +
> +#endif
> diff --git a/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c 
> b/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
> new file mode 100644
> index 000..b92d2bc
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
> @@ -0,0 +1,241 @@
> +/*
> + * Copyright(c) 2015, Analogix Semiconductor. All rights reserved.
> + *
> + * This program is free software; you can redistribute 

[PATCH] staging: sm750fb: Added a space

2015-09-14 Thread Anjali Menon
Added a space to fix the following coding style error detected by
checkpatch.

ERROR: space required before the open parenthesis '('

Signed-off-by: Anjali Menon 
---
 drivers/staging/sm750fb/ddk750_dvi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/ddk750_dvi.c 
b/drivers/staging/sm750fb/ddk750_dvi.c
index f5932bb..1eea768 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -45,7 +45,7 @@ int dviInit(
 {
dvi_ctrl_device_t *pCurrentDviCtrl;
pCurrentDviCtrl = g_dcftSupportedDviController;
-   if(pCurrentDviCtrl->pfnInit != NULL)
+   if (pCurrentDviCtrl->pfnInit != NULL)
{
return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, 
dualEdgeClkSelect, hsyncEnable,
   vsyncEnable, deskewEnable, deskewSetting, 
continuousSyncEnable,
-- 
1.9.1

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


Re: [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

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


Re: [PATCH] Staging: wilc1000: Use NULL instead of zero

2015-09-14 Thread Ronit Halder
I checked but it didn't show me any warning.
Can you please specify the warning?

regards

On Mon, Sep 14, 2015 at 2:06 PM, Sudip Mukherjee
 wrote:
> On Mon, Sep 14, 2015 at 11:03:34AM +0530, Ronit Halder wrote:
>> This patch fixes the warning generated by sparse
>> "Using plain integer as NULL pointer" by using NULL
>> instead of zero.
>>
>> Signed-off-by: Ronit halder 
>> ---
> This fixes sparse warning but introduces new checkpatch warnings about
> NULL comparison.
>
> regards
> sudip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wilc1000: Use NULL instead of zero

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 05:37:45PM +0530, Ronit Halder wrote:
> I checked but it didn't show me any warning.
> Can you please specify the warning?
try with --strict option of checkpatch.

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


[PATCH 1/2] Staging: lustre: libcfs: Use pr_info and pr_warn macros

2015-09-14 Thread Shraddha Barke
Replace all occurrences of  printk(KERN_* by pr_info and pr_warn macros.

Build tested it.

Signed-off-by: Shraddha Barke 
---
 drivers/staging/lustre/lustre/libcfs/tracefile.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index effa2af..bba665a 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -196,7 +196,7 @@ static void cfs_tcd_shrink(struct cfs_trace_cpu_data *tcd)
 */
 
if (printk_ratelimit())
-   printk(KERN_WARNING "debug daemon buffer overflowed; discarding 
10%% of pages (%d of %ld)\n",
+   pr_warn("debug daemon buffer overflowed; discarding 10%% of 
pages (%d of %ld)\n",
   pgcount + 1, tcd->tcd_cur_pages);
 
INIT_LIST_HEAD(&pc.pc_pages);
@@ -355,7 +355,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data 
*msgdata,
}
 
if (*(string_buf+needed-1) != '\n')
-   printk(KERN_INFO "format at %s:%d:%s doesn't end in newline\n",
+   pr_info("format at %s:%d:%s doesn't end in newline\n",
   file, msgdata->msg_line, msgdata->msg_fn);
 
header.ph_len = known_size + needed;
@@ -713,7 +713,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
kunmap(tage->page);
 
if (rc != (int)tage->used) {
-   printk(KERN_WARNING "wanted to write %u but wrote %d\n",
+   pr_warn("wanted to write %u but wrote %d\n",
   tage->used, rc);
put_pages_back(&pc);
__LASSERT(list_empty(&pc.pc_pages));
@@ -872,8 +872,7 @@ int cfs_trace_daemon_command(char *str)
} else {
strcpy(cfs_tracefile, str);
 
-   printk(KERN_INFO
-  "Lustre: debug daemon will attempt to start writing to 
%s (%lukB max)\n",
+   pr_info("Lustre: debug daemon will attempt to start writing to 
%s (%lukB max)\n",
   cfs_tracefile,
   (long)(cfs_tracefile_size >> 10));
 
@@ -911,15 +910,13 @@ int cfs_trace_set_debug_mb(int mb)
struct cfs_trace_cpu_data *tcd;
 
if (mb < num_possible_cpus()) {
-   printk(KERN_WARNING
-  "Lustre: %d MB is too small for debug buffer size, 
setting it to %d MB.\n",
+   pr_warn("Lustre: %d MB is too small for debug buffer size, 
setting it to %d MB.\n",
   mb, num_possible_cpus());
mb = num_possible_cpus();
}
 
if (mb > limit) {
-   printk(KERN_WARNING
-  "Lustre: %d MB is too large for debug buffer size, 
setting it to %d MB.\n",
+   pr_warn("Lustre: %d MB is too large for debug buffer size, 
setting it to %d MB.\n",
   mb, limit);
mb = limit;
}
@@ -990,7 +987,7 @@ static int tracefiled(void *arg)
if (IS_ERR(filp)) {
rc = PTR_ERR(filp);
filp = NULL;
-   printk(KERN_WARNING "couldn't open %s: %d\n",
+   pr_warn("couldn't open %s: %d\n",
   cfs_tracefile, rc);
}
}
@@ -1103,8 +1100,7 @@ void cfs_trace_stop_thread(void)
 
mutex_lock(&cfs_trace_thread_mutex);
if (thread_running) {
-   printk(KERN_INFO
-  "Lustre: shutting down debug daemon thread...\n");
+   pr_info("Lustre: shutting down debug daemon thread...\n");
atomic_set(&tctl->tctl_shutdown, 1);
wait_for_completion(&tctl->tctl_stop);
thread_running = 0;
-- 
2.1.4

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


[PATCH 2/2] Staging: rtl8192u: ieee80211: Use pr_info/pr_warn/pr_alert/pr_debug macros

2015-09-14 Thread Shraddha Barke
Replace all occurrences of  printk(KERN_* by pr_info and pr_alert macros.

Build tested it.

Signed-off-by: Shraddha Barke 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index f2d09fe..7656e56 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -139,7 +139,7 @@ static void ieee80211_TURBO_Info(struct ieee80211_device 
*ieee, u8 **tag_p)
*tag++ = 0x00;
 
*tag_p = tag;
-   printk(KERN_ALERT "This is enable turbo mode IE process\n");
+   pr_alert("This is enable turbo mode IE process\n");
 }
 #endif
 
@@ -1337,15 +1337,15 @@ static void ieee80211_associate_step2(struct 
ieee80211_device *ieee)
 static void ieee80211_associate_complete_wq(struct work_struct *work)
 {
struct ieee80211_device *ieee = container_of(work, struct 
ieee80211_device, associate_complete_wq);
-   printk(KERN_INFO "Associated successfully\n");
+   pr_info("Associated successfully\n");
if(ieee80211_is_54g(&ieee->current_network) &&
(ieee->modulation & IEEE80211_OFDM_MODULATION)){
 
ieee->rate = 108;
-   printk(KERN_INFO"Using G rates:%d\n", ieee->rate);
+   pr_info("Using G rates:%d\n", ieee->rate);
}else{
ieee->rate = 22;
-   printk(KERN_INFO"Using B rates:%d\n", ieee->rate);
+   pr_info("Using B rates:%d\n", ieee->rate);
}
if (ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT)
{
@@ -1707,7 +1707,7 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, 
struct sk_buff *skb)
ieee80211_resp_to_assoc_rq(ieee, dest);
}
 
-   printk(KERN_INFO"New client associated: %pM\n", dest);
+   pr_info("New client associated: %pM\n", dest);
//FIXME
 }
 
-- 
2.1.4

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


Re: [PATCH] Staging: lustre: lustre: lov: lov_dev.c: Added missing blank line

2015-09-14 Thread Greg KH
On Mon, Sep 14, 2015 at 02:41:24PM +0530, Sakshi Vaid wrote:
> Added a missing blank line after declarations.
> 
> 158: WARNING: Missing a blank line after declarations
> 183: WARNING: Missing a blank line after declarations
> 
> Signed-off-by: Sakshi Vaid 
> ---
>  drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 4 ++--
>  drivers/staging/lustre/lustre/lov/lov_dev.c| 2 ++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
> b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
> index d31bf73..68cf1b7 100644
> --- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
> +++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
> @@ -828,8 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct 
> cl_object *obj,
>* --bug 17336 */
>   loff_t size = cl_isize_read(inode);
>   loff_t cur_index = start >> PAGE_CACHE_SHIFT;
> - loff_t size_index = ((size - 1)
> - >> PAGE_CACHE_SHIFT);
> + loff_t size_index =
> + ((size - 1) >> PAGE_CACHE_SHIFT);

This change has nothing to do with what you said you were doing up at
the top of the changelog :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] Staging: lustre: libcfs: Use pr_info and pr_warn macros

2015-09-14 Thread Greg Kroah-Hartman
On Mon, Sep 14, 2015 at 07:14:12PM +0530, Shraddha Barke wrote:
> Replace all occurrences of  printk(KERN_* by pr_info and pr_warn macros.
> 
> Build tested it.

Why put this here in the changelog area?  You always have to at least
build test your changes, so this is always implied.

And can some of these be changed to be dev_* calls instead?

thanks,

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


Re: [PATCH 2/2] Staging: rtl8192u: ieee80211: Use pr_info/pr_warn/pr_alert/pr_debug macros

2015-09-14 Thread Greg Kroah-Hartman
On Mon, Sep 14, 2015 at 07:17:30PM +0530, Shraddha Barke wrote:
> Replace all occurrences of  printk(KERN_* by pr_info and pr_alert macros.
> 
> Build tested it.

Same comments as the other patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] Staging: lustre: libcfs: Use pr_info and pr_warn macros

2015-09-14 Thread Shraddha Barke



On Mon, 14 Sep 2015, Greg Kroah-Hartman wrote:


On Mon, Sep 14, 2015 at 07:14:12PM +0530, Shraddha Barke wrote:

Replace all occurrences of  printk(KERN_* by pr_info and pr_warn macros.

Build tested it.


Why put this here in the changelog area?  You always have to at least
build test your changes, so this is always implied.


Yes I'll take it off in this and future patches.



And can some of these be changed to be dev_* calls instead?


Since there is no network device pointer in this function, isn't pr_* 
preferred?


Thanks,

Shraddha



thanks,

greg k-h


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


Re: [PATCH 1/2] Staging: lustre: libcfs: Use pr_info and pr_warn macros

2015-09-14 Thread Greg Kroah-Hartman
On Mon, Sep 14, 2015 at 07:54:30PM +0530, Shraddha Barke wrote:
> 
> 
> On Mon, 14 Sep 2015, Greg Kroah-Hartman wrote:
> 
> >On Mon, Sep 14, 2015 at 07:14:12PM +0530, Shraddha Barke wrote:
> >>Replace all occurrences of  printk(KERN_* by pr_info and pr_warn macros.
> >>
> >>Build tested it.
> >
> >Why put this here in the changelog area?  You always have to at least
> >build test your changes, so this is always implied.
> 
> Yes I'll take it off in this and future patches.
> 
> >
> >And can some of these be changed to be dev_* calls instead?
> 
> Since there is no network device pointer in this function, isn't pr_*
> preferred?

dev_* is not just for network drivers.

And I don't know, look at the rest of the code for hints as to what to
use, don't just blindly convert code without looking at it first...
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: ft1000: code style cleanup

2015-09-14 Thread Greg KH
On Mon, Sep 14, 2015 at 01:48:09PM +0530, Sudip Mukherjee wrote:
> On Sun, Sep 13, 2015 at 12:55:42AM +0200, lucasg wrote:
> > There was a stray '*' in a comment block.
> > 
> > Signed-off-by: lucasg 
> > ---
> Greg has already applied your patch, but next time you send a patch
> please use your full name in the From and Signed-off-by.

Ugh, good catch, I'll go rip this out of my tree.

"Lucas", can you please resend this with your real name in the
signed-off-by area, as Sudip asks?

thanks,

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


[PATCH] staging: ft1000: code style cleanup

2015-09-14 Thread Lucas Georges
There was a stray '*' in a comment block.

Signed-off-by: Lucas Georges 
---
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c 
b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index 5f4794b..6a6e345 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -1544,7 +1544,7 @@ int ft1000_poll(void *dev_id)
   FT1000_REG_MAG_WATERMARK);
/* ring doorbell to tell DSP that
 * ASIC is out of reset
-* */
+*/
status = ft1000_write_register(dev,
   FT1000_ASIC_RESET_DSP,
   FT1000_REG_DOORBELL);
-- 
2.5.1

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


Re: [PATCH] staging: ft1000: code style cleanup

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 07:33:47AM -0700, Greg KH wrote:
> On Mon, Sep 14, 2015 at 01:48:09PM +0530, Sudip Mukherjee wrote:
> > On Sun, Sep 13, 2015 at 12:55:42AM +0200, lucasg wrote:
> > > There was a stray '*' in a comment block.
> > > 
> > > Signed-off-by: lucasg 
> > > ---
> > Greg has already applied your patch, but next time you send a patch
> > please use your full name in the From and Signed-off-by.
> 
> Ugh, good catch, I'll go rip this out of my tree.
U can remove patches from your tree? Then in that case there is one
more.
d0e574a097f5 ("staging: lustre: lnet: lnet: Added a space")

I didnot comment there but the subject and the commit message says
"added space" but the patch actually removed space.

Adding cc to the author of the patch so that she can also know.

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


Re: [PATCH v2 00/12] New paravirtual PCI front-end for Hyper-V VMs

2015-09-14 Thread Marc Zyngier
Hi Jake,

In the future, please CC me on anything that touches irqdomains, along
with Jiang Liu as we both co-maintain this piece of code.

On 11/09/15 01:00, ja...@microsoft.com wrote:
> From: Jake Oshins 
> 
> The patch series updates the one sent about a month ago in three ways.  It
> integrated with other IRQ domain work done in linux-next in that time, it
> distributes interrupts to multiple virtual processors in the guest VM, and it
> incorporates feedback from Thomas Gleixner and others.
> 
> These patches change the IRQ domain code so that an IRQ domain can match on 
> both
> bus type and on the PCI domain.  The IRQ domain match code is modified so that
> IRQ domains can have a "rank," allowing for a default one which matches every
> x86 PC and more specific ones that replace the default.

I'm not really fond of this approach. We already have a way to match an
IRQ domain, and that's the device node. It looks to me that you're going
through a lot of pain inventing a new infrastructure to avoid divorcing
the two. If you could lookup your PCI IRQ domain directly based some
(non-DT) identifier, and then possibly fallback to the default one,
would that help?

If so, here's the deal: I have been working on a patch series that
addresses the above for unrelated reasons (ACPI support on arm64). It
has been posted twice already:

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/358768.html

and the latest version is there:

https://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git/log/?h=irq/gsi-irq-domain-v3

I have the feeling that you could replace a lot of your patches with
this infrastructure.

Thoughts?

M.
-- 
Jazz is not dead. It just smells funny...
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] Staging: lustre: lustre: lov: lov_dev.c: Added missing blank line

2015-09-14 Thread Sakshi Vaid
line 158: WARNING: Missing a blank line after declarations
line 183: WARNING: Missing a blank line after declarations

Added a missing blank line after declartions.

Signed-off-by: Sakshi Vaid 
---
 drivers/staging/lustre/lustre/lov/lov_dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c 
b/drivers/staging/lustre/lustre/lov/lov_dev.c
index 796a015..aadb8f2 100644
--- a/drivers/staging/lustre/lustre/lov/lov_dev.c
+++ b/drivers/staging/lustre/lustre/lov/lov_dev.c
@@ -155,6 +155,7 @@ static void lov_key_fini(const struct lu_context *ctx,
 struct lu_context_key *key, void *data)
 {
struct lov_thread_info *info = data;
+
LINVRNT(list_empty(&info->lti_closure.clc_list));
OBD_SLAB_FREE_PTR(info, lov_thread_kmem);
 }
@@ -180,6 +181,7 @@ static void lov_session_key_fini(const struct lu_context 
*ctx,
 struct lu_context_key *key, void *data)
 {
struct lov_session *info = data;
+
OBD_SLAB_FREE_PTR(info, lov_session_kmem);
 }
 
-- 
1.9.1

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


Re: [PATCH] staging: ft1000: code style cleanup

2015-09-14 Thread Greg KH
On Mon, Sep 14, 2015 at 08:24:24PM +0530, Sudip Mukherjee wrote:
> On Mon, Sep 14, 2015 at 07:33:47AM -0700, Greg KH wrote:
> > On Mon, Sep 14, 2015 at 01:48:09PM +0530, Sudip Mukherjee wrote:
> > > On Sun, Sep 13, 2015 at 12:55:42AM +0200, lucasg wrote:
> > > > There was a stray '*' in a comment block.
> > > > 
> > > > Signed-off-by: lucasg 
> > > > ---
> > > Greg has already applied your patch, but next time you send a patch
> > > please use your full name in the From and Signed-off-by.
> > 
> > Ugh, good catch, I'll go rip this out of my tree.
> U can remove patches from your tree?

If they are only in my staging-testing branch, yes.

> Then in that case there is one more.
> d0e574a097f5 ("staging: lustre: lnet: lnet: Added a space")
> 
> I didnot comment there but the subject and the commit message says
> "added space" but the patch actually removed space.

Now dropped as well, good catch.

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


[PATCH] drivers: stating: wilc1000: Add a check for SPI availability

2015-09-14 Thread Chandra S Gorentla
NULL pointer deference is observed in the wilc1000.ko module
with bus type SPI and when SPI is not ready.

Signed-off-by: Chandra S Gorentla 
---

Following are the steps to reproduce.

$ sudo insmod drivers/staging/wilc1000/wilc1000.ko
$ sudo ifconfig wlan1 up

wlan1 in the above command is the device controlled by 'wilc1000.ko'.

 drivers/staging/wilc1000/linux_wlan.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 63f44f8..48f063d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1634,6 +1634,12 @@ int mac_open(struct net_device *ndev)
int i = 0;
struct WILC_WFI_priv *priv;
 
+#ifdef WILC_SPI
+   if (!g_linux_wlan || !g_linux_wlan->wilc_spidev) {
+   netdev_err(ndev, "wilc1000: SPI device not ready\n");
+   return -ENODEV;
+   }
+#endif
nic = netdev_priv(ndev);
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
PRINT_D(INIT_DBG, "MAC OPEN[%p]\n", ndev);
-- 
2.5.0

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


RE: [PATCH v2 00/12] New paravirtual PCI front-end for Hyper-V VMs

2015-09-14 Thread Jake Oshins
> -Original Message-
> From: Marc Zyngier [mailto:marc.zyng...@arm.com]
> Sent: Monday, September 14, 2015 8:01 AM
> To: Jake Oshins ; gre...@linuxfoundation.org; KY
> Srinivasan ; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; linux-...@vger.kernel.org; bhelg...@google.com;
> t...@linutronix.de; Jiang Liu 
> Subject: Re: [PATCH v2 00/12] New paravirtual PCI front-end for Hyper-V
> VMs
> 
> Hi Jake,
> 
> In the future, please CC me on anything that touches irqdomains, along
> with Jiang Liu as we both co-maintain this piece of code.
> 

Absolutely.  Sorry for that omission.

> On 11/09/15 01:00, ja...@microsoft.com wrote:
> > From: Jake Oshins 
> >
> > The patch series updates the one sent about a month ago in three ways.  It
> > integrated with other IRQ domain work done in linux-next in that time, it
> > distributes interrupts to multiple virtual processors in the guest VM, and 
> > it
> > incorporates feedback from Thomas Gleixner and others.
> >
> > These patches change the IRQ domain code so that an IRQ domain can
> match on both
> > bus type and on the PCI domain.  The IRQ domain match code is modified
> so that
> > IRQ domains can have a "rank," allowing for a default one which matches
> every
> > x86 PC and more specific ones that replace the default.
> 
> I'm not really fond of this approach. We already have a way to match an
> IRQ domain, and that's the device node. It looks to me that you're going
> through a lot of pain inventing a new infrastructure to avoid divorcing
> the two. If you could lookup your PCI IRQ domain directly based some
> (non-DT) identifier, and then possibly fallback to the default one,
> would that help?
> 
> If so, here's the deal: I have been working on a patch series that
> addresses the above for unrelated reasons (ACPI support on arm64). It
> has been posted twice already:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/358768.html
> 
> and the latest version is there:
> 
> https://git.kernel.org/cgit/linux/kernel/git/maz/arm-
> platforms.git/log/?h=irq/gsi-irq-domain-v3
> 
> I have the feeling that you could replace a lot of your patches with
> this infrastructure.
> 
> Thoughts?
> 
>   M.
> --

First, thank you so much for reviewing this.  I've read the patch series above, 
but I'm sure that I might have misinterpreted it.  It seems to merge the DT and 
ACPI GSI infrastructure, which I think is a great idea.  I'm not sure, however, 
that it would, as it stands, provide what I need here.  Please do tell me if 
I'm wrong.

The series above allows you to supply different IRQ domains for separate parts 
of the ACPI GSI space, which is fine for IRQs which are actually defined by 
ACPI.  Message-signaled interrupts (MSI), however, aren't defined by ACPI.  
ACPI only talks about the routing of interrupts with pins and traces (or ones 
which have equivalent mechanisms like the INTx# protocol in PCI Express.)

What the older DT layer code allowed was for the PCI driver to look up an IRQ 
domain by walking up the device tree looking for a node that claimed to be an 
IRQ domain.  The match() function on the IRQ domain allowed it to say that it 
supported interrupts on PCI buses.

What's not clear to me is how I would create an IRQ domain that matches not on 
ACPI GSI ranges (because ACPI doesn't talk about MSI) and not just on generic 
PCI buses.  I need to be able to ask for an IRQ domain "from my parent" which 
doesn't really exist without the OF device tree or "for a specific PCI bus 
domain."  That second one is what I was trying to enable.

Is there a way to do that with the infrastructure that you're introducing?

Thanks again,
Jake Oshins

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


[PATCH] staging/rtl8192u: remove unused function

2015-09-14 Thread Nicolas Joseph
Remove N_DBPSOfRate used in ComputeTxTime, remove by
commit 742728f97a99 ("staging: rtl8192u: remove unused function.")

Signed-off-by: Nicolas Joseph 
---
 drivers/staging/rtl8192u/r8192U_core.c | 44 --
 1 file changed, 44 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index b143b36..80a6a4f 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1227,50 +1227,6 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
return 0;
 }

-u16 N_DBPSOfRate(u16 DataRate)
-{
-   u16 N_DBPS = 24;
-
-   switch (DataRate) {
-   case 60:
-   N_DBPS = 24;
-   break;
-
-   case 90:
-   N_DBPS = 36;
-   break;
-
-   case 120:
-   N_DBPS = 48;
-   break;
-
-   case 180:
-   N_DBPS = 72;
-   break;
-
-   case 240:
-   N_DBPS = 96;
-   break;
-
-   case 360:
-   N_DBPS = 144;
-   break;
-
-   case 480:
-   N_DBPS = 192;
-   break;
-
-   case 540:
-   N_DBPS = 216;
-   break;
-
-   default:
-   break;
-   }
-
-   return N_DBPS;
-}
-
 short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
--
2.5.2

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


Re: [PATCH] staging/rtl8192u: remove unused function

2015-09-14 Thread Raphaƫl Beamonte
2015-09-14 14:00 GMT-04:00 Nicolas Joseph :
> Remove N_DBPSOfRate used in ComputeTxTime, remove by
> commit 742728f97a99 ("staging: rtl8192u: remove unused function.")
>
> Signed-off-by: Nicolas Joseph 
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 44 
> --
>  1 file changed, 44 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> b/drivers/staging/rtl8192u/r8192U_core.c
> index b143b36..80a6a4f 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -1227,50 +1227,6 @@ inline u8 rtl8192_IsWirelessBMode(u16 rate)
> return 0;
>  }
>
> -u16 N_DBPSOfRate(u16 DataRate)
> -{
> -   u16 N_DBPS = 24;
> -
> -   switch (DataRate) {
> -   case 60:
> -   N_DBPS = 24;
> -   break;
> -
> -   case 90:
> -   N_DBPS = 36;
> -   break;
> -
> -   case 120:
> -   N_DBPS = 48;
> -   break;
> -
> -   case 180:
> -   N_DBPS = 72;
> -   break;
> -
> -   case 240:
> -   N_DBPS = 96;
> -   break;
> -
> -   case 360:
> -   N_DBPS = 144;
> -   break;
> -
> -   case 480:
> -   N_DBPS = 192;
> -   break;
> -
> -   case 540:
> -   N_DBPS = 216;
> -   break;
> -
> -   default:
> -   break;
> -   }
> -
> -   return N_DBPS;
> -}
> -
>  short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> --
> 2.5.2
>

Not sure the commit message is really clear. Something like this seems
more clean to me:
"Remove unused function N_DBPSOfRate. This function was only
used by function ComputeTxTime that was removed in a previous
commit."
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] staging: wilc1000: wilc_mq_send: refactor allocation errors handling

2015-09-14 Thread Mike Rapoport
In case the first allocation fails, we can return directly, and if the
second allocation fails we can goto to the end of the function where we
free the memory and return error.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 127b3e5..6e032b8 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -65,11 +65,13 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage);
+   if (!pstrMessage)
+   return WILC_NULL_PTR;
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage->pvBuffer);
+   if (!pstrMessage->pvBuffer)
+   goto err_alloc_buffer;
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
 
/* add it to the message queue */
@@ -90,16 +92,13 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
up(&pHandle->hSem);
 
-   WILC_CATCH(s32RetStatus)
-   {
-   /* error occured, free any allocations */
-   if (pstrMessage) {
-   kfree(pstrMessage->pvBuffer);
-   kfree(pstrMessage);
-   }
-   }
-
return s32RetStatus;
+
+err_alloc_buffer:
+   /* error occurred, free any allocations */
+   kfree(pstrMessage);
+
+   return WILC_NULL_PTR;
 }
 
 /*!
-- 
2.1.0

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


[PATCH 03/13] staging: wilc1000: wilc_mq_send: reorder spin_lock and allocations

2015-09-14 Thread Mike Rapoport
Make memory allocations outside of spin lock, so that ellocation errors
handling will not require unlocking

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 4b1c36e..127b3e5 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -63,8 +63,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
if (pHandle->bExiting)
return WILC_FAIL;
 
-   spin_lock_irqsave(&pHandle->strCriticalSection, flags);
-
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
WILC_NULLCHECK(s32RetStatus, pstrMessage);
@@ -75,6 +73,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
 
/* add it to the message queue */
+   spin_lock_irqsave(&pHandle->strCriticalSection, flags);
+
if (!pHandle->pstrMessageList) {
pHandle->pstrMessageList  = pstrMessage;
} else {
-- 
2.1.0

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


[PATCH 09/13] staging: wilc1000: hif_ger_cfg: refactor error handling

2015-09-14 Thread Mike Rapoport
Check whether the driver is initialized before getting the semaphore
thus eliminating the need for WILC_ERRORREPORT and WILC_CATCH constructs
and s32Error variable.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4a6effd..54dd1dd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6220,16 +6220,16 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, 
tstrCfgParamVal *pstrCfgParamVal)
  */
 s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
 {
-   s32 s32Error = WILC_SUCCESS;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
-   down(&(pstrWFIDrv->gtOsCfgValuesSem));
-
if (pstrWFIDrv == NULL) {
PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   return WILC_INVALID_ARGUMENT;
}
PRINT_D(HOSTINF_DBG, "Getting configuration parameters\n");
+
+   down(&(pstrWFIDrv->gtOsCfgValuesSem));
+
switch (u16WID) {
 
case WID_BSS_TYPE:
@@ -6310,10 +6310,7 @@ s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, 
u16 *pu16WID_Value)
 
up(&(pstrWFIDrv->gtOsCfgValuesSem));
 
-   WILC_CATCH(s32Error)
-   {
-   }
-   return s32Error;
+   return WILC_SUCCESS;
 
 }
 
-- 
2.1.0

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


[PATCH 10/13] staging: wilc1000: host_interface: refactor error handling

2015-09-14 Thread Mike Rapoport
Use error value assignment and goto instead of WILC_ERRORREPORT and
WILC_CATCH.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 93 +--
 1 file changed, 52 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 54dd1dd..0f23260 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1521,8 +1521,7 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
  MAX_SURVEY_RESULT_FRAG_SIZE);
if (s32Err) {
PRINT_ER("Failed to get site survey results\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
-
+   return WILC_FAIL;
}
s32Err = ParseSurveyResults(gapu8RcvdSurveyResults, &pstrSurveyResults,
&pstrWFIDrv->u32SurveyResultsCount);
@@ -1538,8 +1537,9 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
 
DeallocateSurveyResults(pstrSurveyResults);
} else {
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
-   PRINT_ER("ParseSurveyResults() Error(%d)\n", s32Err);
+   s32Error = WILC_FAIL;
+   PRINT_ER("ParseSurveyResults() Error(%d)\n", s32Error);
+   goto err_handler;
}
 
 
@@ -1652,14 +1652,16 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Handle_Connect()] failed to send config 
packet\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   s32Error = WILC_INVALID_STATE;
+   goto err_handler;
} else {
pstrWFIDrv->enuHostIFstate = HOST_IF_WAITING_CONN_RESP;
}
 
} else {
PRINT_ER("Required BSSID not found\n");
-   WILC_ERRORREPORT(s32Error, WILC_NOT_FOUND);
+   s32Error = WILC_NOT_FOUND;
+   goto err_handler;
}
 
#else
@@ -1680,7 +1682,8 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
ptstrJoinBssParam = (tstrJoinBssParam 
*)pstrHostIFconnectAttr->pJoinParams;
if (ptstrJoinBssParam == NULL) {
PRINT_ER("Required BSSID not found\n");
-   WILC_ERRORREPORT(s32Error, WILC_NOT_FOUND);
+   s32Error = WILC_NOT_FOUND;
+   goto err_handler;
}
#endif /*WILC_PARSE_SCAN_IN_HOST*/
 
@@ -1788,8 +1791,10 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = MAX_SSID_LEN + 7;
strWIDList[u32WidsCount].ps8WidVal = 
kmalloc(strWIDList[u32WidsCount].s32ValueSize, GFP_KERNEL);
 
-   if (strWIDList[u32WidsCount].ps8WidVal == NULL)
-   WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+   if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+   s32Error = WILC_NO_MEM;
+   goto err_handler;
+   }
 
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
 
@@ -1825,8 +1830,10 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].s32ValueSize;
gu8FlushedJoinReq = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
}
-   if (strWIDList[u32WidsCount].ps8WidVal == NULL)
-   WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+   if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+   s32Error = WILC_NO_MEM;
+   goto err_handler;
+   }
 
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
 
@@ -1976,15 +1983,16 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Handle_Connect()] failed to send config packet\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   s32Error = WILC_INVALID_STATE;
+   goto err_handler;
} else {
PRINT_D(GENERIC_DBG, "set HOST_IF_WAITING_CONN_RESP\n");
pstrWFIDrv->enuHostIFstate = HOST_IF_WAITING_CONN_RESP;
}
#endif
 
-   WILC_CATCH(s32Error)
-   {
+err_handler:
+   if (s32Error) {
tstrConnectInfo strConnectInfo;
 
del_timer(&pstrWFIDrv->hConnectTimer);
@@ -3085,7 +3093,7 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
 
if (s32Error) {
PRINT_ER("Failed to send dissconect config packet\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ 

[PATCH 06/13] staging: wilc1000: remove usage of WILC_ERRORCHECK

2015-09-14 Thread Mike Rapoport
The WILC_ERRORCHECK macro is replaced with printout or direct call to
return statement, together with removal of several WILC_CATCH accompaniyng
WILC_ERRORCHECK.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c |  6 ++
 drivers/staging/wilc1000/wilc_msgqueue.c  |  3 ++-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 26 +--
 3 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 7ef5d18..143e35f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7074,11 +7074,9 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
 
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("Failed to send delete beacon message\n");
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 6e032b8..fd50f11 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -135,7 +135,8 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
} else {
/* other non-timeout scenarios */
-   WILC_ERRORCHECK(s32RetStatus);
+   if (s32RetStatus)
+   return s32RetStatus;
 
if (pHandle->bExiting)
return WILC_FAIL;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 0d5ffaf..f4cc53f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3306,11 +3306,9 @@ static int stop_ap(struct wiphy *wiphy, struct 
net_device *dev)
 
s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
 
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("Delete beacon failed\n");
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3376,12 +3374,10 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_add_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("Add station failed\n");
}
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3421,11 +3417,10 @@ static int del_station(struct wiphy *wiphy, struct 
net_device *dev,
 
s32Error = host_int_del_station(priv->hWILCWFIDrv, mac);
 
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   PRINT_ER("Delete station failed\n");
}
+
return s32Error;
 }
 
@@ -3492,11 +3487,10 @@ static int change_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_edit_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   PRINT_ER("Edit station failed\n");
}
+
return s32Error;
 }
 
-- 
2.1.0

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


[PATCH 01/13] staging: wilc1000: replace WILC_ERRORREPORT with return

2015-09-14 Thread Mike Rapoport
In cases where WILC_ERRORREPORT does not require cleanup actions, but
causes immediate return from the function it can be replaced with return
statement.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/coreconfigurator.c   |   3 +-
 drivers/staging/wilc1000/host_interface.c | 105 +++---
 drivers/staging/wilc1000/wilc_msgqueue.c  |  29 +++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   2 +-
 4 files changed, 66 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 544c12d..566fb59 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -594,7 +594,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
/* Check whether the received message type is 'N' */
if ('N' != u8MsgType) {
PRINT_ER("Received Message format incorrect.\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   return WILC_FAIL;
}
 
/* Extract message ID */
@@ -690,7 +690,6 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
 
*ppstrNetworkInfo = pstrNetworkInfo;
 
-ERRORHANDLER:
return s32Error;
 }
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 59a1a9d..0d26887 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1318,13 +1318,13 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFscanAttr *pstrHost
if ((pstrWFIDrv->enuHostIFstate >= HOST_IF_SCANNING) && 
(pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTED)) {
/* here we either in HOST_IF_SCANNING, HOST_IF_WAITING_CONN_REQ 
or HOST_IF_WAITING_CONN_RESP */
PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] 
state\n", pstrWFIDrv->enuHostIFstate);
-   WILC_ERRORREPORT(s32Error, WILC_BUSY);
+   return WILC_BUSY;
}
 
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
if (g_obtainingIP || connecting) {
PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until 
IP adresss is obtained\n");
-   WILC_ERRORREPORT(s32Error, WILC_BUSY);
+   return WILC_BUSY;
}
#endif
 
@@ -2298,7 +2298,7 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdNetworkInfo
ParseNetworkInfo(pstrRcvdNetworkInfo->pu8Buffer, 
&pstrNetworkInfo);
if ((pstrNetworkInfo == NULL)
|| (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult == 
NULL)) {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   return WILC_INVALID_ARGUMENT;
}
 
/* check whether this network is discovered before */
@@ -2424,7 +2424,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult) {
if ((pstrRcvdGnrlAsyncInfo->pu8Buffer == NULL) ||
(pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult == 
NULL)) {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   return WILC_INVALID_ARGUMENT;
}
 
u8MsgType = pstrRcvdGnrlAsyncInfo->pu8Buffer[0];
@@ -2432,7 +2432,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
/* Check whether the received message type is 'I' */
if ('I' != u8MsgType) {
PRINT_ER("Received Message format incorrect.\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   return WILC_FAIL;
}
 
/* Extract message ID */
@@ -3524,7 +3524,7 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFSetBeacon *p
strWID.s32ValueSize = pstrSetBeaconParam->u32HeadLen + 
pstrSetBeaconParam->u32TailLen + 16;
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
-   WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+   return;
 
pu8CurrByte = strWID.ps8WidVal;
*pu8CurrByte++ = (pstrSetBeaconParam->u32Interval & 0xFF);
@@ -3596,7 +3596,7 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFDelBeacon *p
strWID.ps8WidVal = &gu8DelBcn;
 
if (strWID.ps8WidVal == NULL)
-   WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+   return;
 
pu8CurrByte = strWID.ps8WidVal;
 
@@ -3695,7 +3695,7 @@ static void Handle_AddStation(tstrWILC_WFIDrv 
*drvHandler, tstrWILC_AddStaParam
 
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
-   WILC_ERRORREPORT(s32Error, 

[PATCH 08/13] staging: wilc1000: Handle_Scan: refactor error handling

2015-09-14 Thread Mike Rapoport
In case SendConfigPkt fails, the error handling code performs deletion of
timer, calls Handle_ScanDone and falls through freeing of allocated memory
which is common for both success and error paths. The deletion of timer and
invocation of Handle_ScanDone can be performed in 'then' clause of check of
SendConfigPkt return value, thus eliminating the need for goto (wrapped in
WILC_ERRORREPORT) and label (wrapped in WILC_CATCH).

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8dd8034..4a6effd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1386,16 +1386,11 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFscanAttr *pstrHost
 
if (s32Error) {
PRINT_ER("Failed to send scan paramters config packet\n");
-   WILC_ERRORREPORT(s32Error, s32Error);
-   } else {
-   PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config 
packet\n");
-   }
-
-   WILC_CATCH(s32Error)
-   {
del_timer(&pstrWFIDrv->hScanTimer);
/*if there is an ongoing scan request*/
Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
+   } else {
+   PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config 
packet\n");
}
 
/* Deallocate pstrHostIFscanAttr->u8ChnlListLen which was prevoisuly 
allocated by the sending thread */
-- 
2.1.0

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


[PATCH 05/13] staging: wilc1000: replace WILC_NULLCHECK with return

2015-09-14 Thread Mike Rapoport
WILC_NULLPTR can be replaced with test for NULL pointer and return of
WILC_NULL_PTR.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c |  8 
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index bfade25..7ef5d18 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7116,7 +7116,8 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSta
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (!rates)
+   return WILC_NULL_PTR;
 
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
@@ -7127,7 +7128,6 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSta
if (s32Error)
PRINT_ER("Failed to send add station message\n");
 
-ERRORHANDLER:
return s32Error;
 }
 
@@ -7262,7 +7262,8 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (!rates)
+   return WILC_NULL_PTR;
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
}
@@ -7271,7 +7272,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
if (s32Error)
PRINT_ER("Failed to send edit station message\n");
 
-ERRORHANDLER:
return s32Error;
 }
 #endif /*WILC_AP_EXTERNAL_MLME*/
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 461cf50..0d5ffaf 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -382,7 +382,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
if (priv->bCfgScanning == true) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
-   WILC_NULLCHECK(s32Error, wiphy);
+   if (!wiphy)
+   return;
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC
&&
s32)pstrNetworkInfo->s8rssi) * 100) < 0
@@ -396,7 +397,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
s32Freq = 
ieee80211_channel_to_frequency((s32)pstrNetworkInfo->u8channel, 
IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);
 
-   WILC_NULLCHECK(s32Error, channel);
+   if (!channel)
+   return;
 
PRINT_INFO(CFG80211_DBG, "Network Info:: 
CHANNEL Frequency: %d, RSSI: %d, CapabilityInfo: %d,"
   "BeaconPeriod: %d\n", 
channel->center_freq, (((s32)pstrNetworkInfo->s8rssi) * 100),
@@ -3292,8 +3294,8 @@ static int stop_ap(struct wiphy *wiphy, struct net_device 
*dev)
struct WILC_WFI_priv *priv;
u8 NullBssid[ETH_ALEN] = {0};
 
-
-   WILC_NULLCHECK(s32Error, wiphy);
+   if (!wiphy)
+   return WILC_NULL_PTR;
 
priv = wiphy_priv(wiphy);
 
@@ -3329,8 +3331,8 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
tstrWILC_AddStaParam strStaParams = { {0} };
perInterface_wlan_t *nic;
 
-
-   WILC_NULLCHECK(s32Error, wiphy);
+   if (!wiphy)
+   return WILC_NULL_PTR;
 
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);
@@ -3400,7 +3402,8 @@ static int del_station(struct wiphy *wiphy, struct 
net_device *dev,
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
 
-   WILC_NULLCHECK(s32Error, wiphy);
+   if (!wiphy)
+   return WILC_NULL_PTR;
 
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);
@@ -3446,7 +3449,8 @@ static int change_station(struct wiphy *wiphy, struct 
net_device *dev,
 
PRINT_D(HOSTAPD_DBG, "Change station paramters\n");
 
-   WILC_NULLCHECK(s32Error, wiphy);
+   if (!wiphy)
+   return WILC_NULL_PTR;
 
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);
-- 
2.1.0

_

[PATCH 00/13] staging: wilc1000: remove WILC_CATCH and friends

2015-09-14 Thread Mike Rapoport
Hi,

These patches replace usage of WILC_ERRORREPORT, WILC_ERRORCHECK,
WILC_NULLCHECK and WILC_CATCH by plain code that either returns the error
value or sets the error code and uses goto to jump to error handling code. 

Mike Rapoport (13):
  staging: wilc1000: replace WILC_ERRORREPORT with return
  staging: wilc1000: reduce WILC_{ERRORREPORT,CATCH} usage
  staging: wilc1000: wilc_mq_send: reorder spin_lock and allocations
  staging: wilc1000: wilc_mq_send: refactor allocation errors handling
  staging: wilc1000: replace WILC_NULLCHECK with return
  staging: wilc1000: remove usage of WILC_ERRORCHECK
  staging: wilc1000: Handle_CfgParam: refactor error handling
  staging: wilc1000: Handle_Scan: refactor error handling
  staging: wilc1000: hif_ger_cfg: refactor error handling
  staging: wilc1000: host_interface: refactor error handling
  staging: wilc1000: stop using WILC_CATCH
  staging: wilc1000: fix compilation warning
  staging: wilc1000: wilc_errorsupport: remove unused macros

 drivers/staging/wilc1000/coreconfigurator.c   |   3 +-
 drivers/staging/wilc1000/host_interface.c | 652 +++---
 drivers/staging/wilc1000/wilc_errorsupport.h  |  27 -
 drivers/staging/wilc1000/wilc_msgqueue.c  |  61 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  54 +-
 5 files changed, 237 insertions(+), 560 deletions(-)

-- 
2.1.0

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


[PATCH 02/13] staging: wilc1000: reduce WILC_{ERRORREPORT, CATCH} usage

2015-09-14 Thread Mike Rapoport
In cases when WILC_ERRORREPORT is immidiately followed by WILC_CATCH, no
goto is actually performed and therefore WILC_ERRORREPORT may be replaced
with either printout or assignment of the error value, and WILC_CATCH may
be completely removed.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 312 +-
 1 file changed, 52 insertions(+), 260 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0d26887..bfade25 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -670,11 +670,7 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFSetChan *pst
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to set channel\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   s32Error = WILC_INVALID_STATE;
}
 
return s32Error;
@@ -714,11 +710,7 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv 
*drvHandler,
 
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   s32Error = WILC_INVALID_STATE;
}
 
return s32Error;
@@ -760,11 +752,7 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetOpe
 
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   s32Error = WILC_INVALID_STATE;
}
 
return s32Error;
@@ -808,16 +796,11 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
 
if (s32Error) {
PRINT_D(HOSTINF_DBG, "Failed to set IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   s32Error = WILC_INVALID_STATE;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address set\n");
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -859,18 +842,13 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
 
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to get IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   s32Error = WILC_INVALID_STATE;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = 
%d\n", idx);
PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
PRINT_INFO(HOSTINF_DBG, "\n");
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -910,13 +888,9 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetMacAdd
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to set mac address\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   s32Error = WILC_FAIL;
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
kfree(mac_buf);
return s32Error;
 }
@@ -949,12 +923,9 @@ static s32 Handle_GetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfGetMacAdd
 get_id_from_handler(drvHandler));
if (s32Error) {
PRINT_ER("Failed to get mac address\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   s32Error = WILC_FAIL;
}
-   WILC_CATCH(s32Error)
-   {
 
-   }
up(&hWaitResponse);
 
return s32Error;
@@ -1494,10 +1465,7 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, 
tenuScanEvent enuEvent)
 get_id_from_handler(pstrWFIDrv));
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to set abort running scan\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
-   }
-   WILC_CATCH(s32Error)
-   {
+   s32Error = WILC_FAIL;
}
}
 
@@ -2145,12 +2113,7 @@ static s32 Handle_FlushConnect(tstrWILC_WFIDrv 
*drvHandler)
 
get_id_from_handler(gu8FlushedJoinReqDrvHandler));
if (s32Error) {
PRINT_ER("Handle_Flush_Connect()] failed to send config 
packet\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-
-   WILC_CATCH(s32Error)
-   {
-
+   s32Error = WILC_INVALID_STATE;
}
 
return s32Error;
@@ -3244,16 +3207,9 @@ static s32 Switch_Log_Terminal(tstrWILC_WFIDrv 
*drvHandler)
 
if (s32Error) {
PRINT_D(HOSTINF_DBG, 

[PATCH 12/13] staging: wilc1000: fix compilation warning

2015-09-14 Thread Mike Rapoport
Fix the following compilation warning:

  CC [M]  drivers/staging/wilc1000/wilc_wfi_cfgoperations.o
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c: In function ā€˜CfgScanResult’:
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:378:6: warning: unused 
variable ā€˜s32Error’ [-Wunused-variable]
  s32 s32Error = WILC_SUCCESS;
  ^

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 81e75c9..e8d7572 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -375,7 +375,6 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
struct wiphy *wiphy;
s32 s32Freq;
struct ieee80211_channel *channel;
-   s32 s32Error = WILC_SUCCESS;
struct cfg80211_bss *bss = NULL;
 
priv = (struct WILC_WFI_priv *)pUserVoid;
-- 
2.1.0

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


[PATCH 07/13] staging: wilc1000: Handle_CfgParam: refactor error handling

2015-09-14 Thread Mike Rapoport
Use plain goto instead of WILC_ERRORREPORT

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 42 +++
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 143e35f..8dd8034 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -943,7 +943,7 @@ static s32 Handle_GetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfGetMacAdd
  */
 static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr 
*strHostIFCfgParamAttr)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = WILC_INVALID_ARGUMENT;
tstrWID strWIDList[32];
u8 u8WidCnt = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -968,7 +968,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.bss_type = 
(u8)strHostIFCfgParamAttr->pstrCfgParamVal.bss_type;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -986,7 +986,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.auth_type = 
(u8)strHostIFCfgParamAttr->pstrCfgParamVal.auth_type;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -999,7 +999,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.auth_timeout = 
strHostIFCfgParamAttr->pstrCfgParamVal.auth_timeout;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1018,7 +1018,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.power_mgmt_mode = 
(u8)strHostIFCfgParamAttr->pstrCfgParamVal.power_mgmt_mode;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1031,7 +1031,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.short_retry_limit = 
strHostIFCfgParamAttr->pstrCfgParamVal.short_retry_limit;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1045,7 +1045,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.long_retry_limit = 
strHostIFCfgParamAttr->pstrCfgParamVal.long_retry_limit;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1058,7 +1058,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.frag_threshold = 
strHostIFCfgParamAttr->pstrCfgParamVal.frag_threshold;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1071,7 +1071,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.rts_threshold = 
strHostIFCfgParamAttr->pstrCfgParamVal.rts_threshold;
} else {
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+   goto err_inv_arg;
}
u8WidCnt++;
}
@@ -1088,7 +1088,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof

[PATCH 13/13] staging: wilc1000: wilc_errorsupport: remove unused macros

2015-09-14 Thread Mike Rapoport
The macros WILC_IS_ERR, WILC_ERRORCHECK, WILC_ERRORREPORT,
WILC_NULLCHECK and WILC_CATCH are not used and may be removed.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 27 ---
 1 file changed, 27 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 6012ec4..f9727f0 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -35,31 +35,4 @@
 #define WILC_UNSUPPORTED_VERSION   -115
 #define WILC_FILE_EOF  -116
 
-
-
-#define WILC_IS_ERR(__status__) (__status__ < WILC_SUCCESS)
-
-#define WILC_ERRORCHECK(__status__) do { \
-   if (WILC_IS_ERR(__status__)) { \
-   PRINT_ER("PRINT_ER(%d)\n", __status__); \
-   goto ERRORHANDLER; \
-   } \
-} while (0)
-
-#define WILC_ERRORREPORT(__status__, __err__) do { \
-   PRINT_ER("PRINT_ER(%d)\n", __err__); \
-   __status__ = __err__; \
-   goto ERRORHANDLER; \
-} while (0)
-
-#define  WILC_NULLCHECK(__status__, __ptr__)   do { \
-   if (__ptr__ == NULL) { \
-   WILC_ERRORREPORT(__status__, WILC_NULL_PTR); \
-   } \
-} while (0)
-
-#define WILC_CATCH(__status__) \
-ERRORHANDLER: \
-   if (WILC_IS_ERR(__status__)) \
-
 #endif
-- 
2.1.0

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


[PATCH 11/13] staging: wilc1000: stop using WILC_CATCH

2015-09-14 Thread Mike Rapoport
There are few WILC_CATCH() uses that still remain. They are not needed
and can be removed.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/wilc1000/host_interface.c | 68 ---
 drivers/staging/wilc1000/wilc_msgqueue.c  |  4 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  5 --
 3 files changed, 77 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0f23260..afb98d2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2329,12 +2329,6 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdNetworkInfo
}
}
 
-
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
 done:
/* Deallocate pstrRcvdNetworkInfo->pu8Buffer which was prevoisuly 
allocated by the sending thread */
if (pstrRcvdNetworkInfo->pu8Buffer != NULL) {
@@ -2668,11 +2662,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv 
*drvHandler, tstrRcvdGnrlAsy
 
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
/* Deallocate pstrRcvdGnrlAsyncInfo->pu8Buffer which was prevoisuly 
allocated by the sending thread */
if (pstrRcvdGnrlAsyncInfo->pu8Buffer != NULL) {
kfree(pstrRcvdGnrlAsyncInfo->pu8Buffer);
@@ -4625,10 +4614,6 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 
u8keyIdx)
PRINT_ER("Error in sending message queue : Request to remove 
WEP key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
return s32Error;
 }
 
@@ -4673,11 +4658,6 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv 
*hWFIDrv, u8 u8Index)
PRINT_ER("Error in sending message queue : Default key 
index\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -4740,10 +4720,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv 
*hWFIDrv, const u8 *pu8WepKey,
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
return s32Error;
 
 }
@@ -4816,10 +4792,6 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv 
*hWFIDrv, const u8 *pu8WepKey, u
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
return s32Error;
 
 }
@@ -4918,11 +4890,6 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 
*pu8Ptk, u8 u8PtkKeylen,
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /// */
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -5018,10 +4985,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const 
u8 *pu8RxGtk, u8 u8GtkKe
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /// */
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
return s32Error;
 }
 
@@ -5078,11 +5041,6 @@ s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, 
tstrHostIFpmkidAttr *pu8Pm
if (s32Error)
PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -5462,11 +5420,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 
*pu8bssid,
mod_timer(&pstrWFIDrv->hConnectTimer,
  jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -5549,11 +5502,6 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 
u16ReasonCode)
down(&(pstrWFIDrv->hSemTestDisconnectBlock));
/* /// */
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -5842,10 +5790,6 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, 
u8 *pu8ChNo)
 
*pu8ChNo = gu8Chnl;
 
-   WILC_CATCH(s32Error)
-   {
-   }
-
return s32Error;
 
 
@@ -5935,10 +5879,6 @@ s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, 
const u8 *mac, u32 *pu3
 
*pu32InactiveTime = gu32InactiveTime;
 
-   WILC_CATCH(s32Error)
-   {
-   }
-
return s32Error;
 }
 #endif
@@ -6166,10 +6106,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 
u8ScanSource,
mod_timer(&pstrWFIDrv->hScanTimer,
  jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT));
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
return s32Error;
 
 }
@@ -6203,10 +6139,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, 
tstrCfgParamVal *pstrCfgParamVal)
 
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
 
-   WILC_CATCH(s32Error)
-   {
-   }
-
return s32Error;
 
 }
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wi

[PATCH] staging: netlogic: platform: Fix miscellaneous coding style issues

2015-09-14 Thread Martin Pietryka
This patch fixes all alignment issues, as well as a multiple
assignment and multiple blank lines issues.

Signed-off-by: Martin Pietryka 
---
 drivers/staging/netlogic/platform_net.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/netlogic/platform_net.c 
b/drivers/staging/netlogic/platform_net.c
index e914147..9a542a7 100644
--- a/drivers/staging/netlogic/platform_net.c
+++ b/drivers/staging/netlogic/platform_net.c
@@ -58,7 +58,6 @@
 #define MAX_NUM_XLS_GMAC   8
 #define MAX_NUM_XLR_GMAC   4
 
-
 static u32 xlr_gmac_offsets[] = {
NETLOGIC_IO_GMAC_0_OFFSET, NETLOGIC_IO_GMAC_1_OFFSET,
NETLOGIC_IO_GMAC_2_OFFSET, NETLOGIC_IO_GMAC_3_OFFSET,
@@ -87,7 +86,8 @@ static void xlr_resource_init(struct resource *res, int 
offset, int irq)
 
res++;
res->name = "gmac";
-   res->start = res->end = irq;
+   res->start = irq;
+   res->end = irq;
res->flags = IORESOURCE_IRQ;
 }
 
@@ -122,8 +122,8 @@ static struct platform_device *gmac_controller2_init(void 
*gmac0_addr)
ndata1.phy_addr[mac] = mac + 4 + 0x10;
 
xlr_resource_init(&xlr_net1_res[mac * 2],
-   xlr_gmac_offsets[mac + 4],
-   xlr_gmac_irqs[mac + 4]);
+ xlr_gmac_offsets[mac + 4],
+ xlr_gmac_irqs[mac + 4]);
}
xlr_net_dev1.num_resources = 8;
 
@@ -170,7 +170,7 @@ static void xls_gmac_init(void)
xlr_net_dev0.num_resources = 2;
 
xlr_resource_init(&xlr_net0_res[0], xlr_gmac_offsets[0],
-   xlr_gmac_irqs[0]);
+ xlr_gmac_irqs[0]);
platform_device_register(&xlr_net_dev0);
 
/* second block is XAUI, not supported yet */
@@ -183,8 +183,8 @@ static void xls_gmac_init(void)
ndata0.phy_addr[mac] = mac + 0x10;
 
xlr_resource_init(&xlr_net0_res[mac * 2],
-   xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_offsets[mac],
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
platform_device_register(&xlr_net_dev0);
@@ -209,7 +209,6 @@ static void xlr_gmac_init(void)
.gpio_addr  = NULL,
};
 
-
static struct platform_device xlr_net_dev0 = {
.name   = "xlr-net",
.id = 0,
@@ -224,7 +223,7 @@ static void xlr_gmac_init(void)
ndata0.tx_stnid[mac] = FMN_STNID_GMAC0_TX0 + mac;
ndata0.phy_addr[mac] = mac;
xlr_resource_init(&xlr_net0_res[mac * 2], xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
xlr_net_dev0.resource = xlr_net0_res;
-- 
2.5.0

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


Re: [PATCH] staging: lustre: lnet: lnet: Added a space

2015-09-14 Thread Trevor Woerner
On 09/13/15 06:14, Anjali Menon wrote:
> Added a space to fix the following coding style warning detected by
> checkpatch:

Both your commit title and message say (or imply) you've added a space,
but this patch, in fact, removes a space, doesn't it?

> WARNING: space prohibited between function name and open parenthesis '('
>
> Signed-off-by: Anjali Menon 
> ---
>  drivers/staging/lustre/lnet/lnet/router.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
> b/drivers/staging/lustre/lnet/lnet/router.c
> index 8510bae..be23e06 100644
> --- a/drivers/staging/lustre/lnet/lnet/router.c
> +++ b/drivers/staging/lustre/lnet/lnet/router.c
> @@ -1511,7 +1511,7 @@ lnet_notify(lnet_ni_t *ni, lnet_nid_t nid, int alive, 
> unsigned long when)
>   unsigned long   now = cfs_time_current();
>   int cpt = lnet_cpt_of_nid(nid);
>  
> - LASSERT(!in_interrupt ());
> + LASSERT(!in_interrupt());
>  
>   CDEBUG(D_NET, "%s notifying %s: %s\n",
>   (ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),

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


Re: [PATCH] linux-firmware: Add firmware blobs for Digi International Acceleport Xr cards

2015-09-14 Thread Ben Hutchings
On Mon, 2015-09-14 at 16:29 -0400, Mark Hounschell wrote:
[...]
> +Driver: dgap - Digi International Acceleport Xr PCI, Acceleport Xr 920 PCI,
> +   Acceleport Xem PCI, Acceleport C/X PCI, and Acceleport EPC/X
> +   PCI families of adapters.
> +
> +File: dgap/cxcon.bin
> +File: dgap/cxpbios.bin
> +File: dgap/cxpfep.bin
> +File: dgap/fxcon.bin
> +File: dgap/ibmcxcon.bin
> +File: dgap/ibmencon.bin
> +File: dgap/pcibios.bin
> +File: dgap/pcifep.bin
> +File: dgap/sxbios.bin
> +File: dgap/sxfep.bin
> +File: dgap/xrbios.bin
> +File: dgap/xrfep.bin
> +
> +License: Unknown but Redistributable.
[...]

Although there are some old firmware blobs in this state, we require an
explicit and clear licence for any additions.

Ben.

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


[PATCH] Staging: fbtft: Replace pr_info with dev_info

2015-09-14 Thread Shraddha Barke
Replace pr_info with dev_info when appropriate device structure
is present

Signed-off-by: Shraddha Barke 
---
 drivers/staging/fbtft/fbtft_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index fa916e8..3f2c69c 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1222,7 +1222,7 @@ static int spi_device_found(struct device *dev, void 
*data)
 {
struct spi_device *spi = container_of(dev, struct spi_device, dev);
 
-   pr_info(DRVNAME":  %s %s %dkHz %d bits mode=0x%02X\n",
+   dev_info(dev, DRVNAME":  %s %s %dkHz %d bits mode=0x%02X\n",
spi->modalias, dev_name(dev), spi->max_speed_hz/1000,
spi->bits_per_word, spi->mode);
 
@@ -1241,7 +1241,7 @@ static int p_device_found(struct device *dev, void *data)
*pdev = container_of(dev, struct platform_device, dev);
 
if (strstr(pdev->name, "fb"))
-   pr_info(DRVNAME":  %s id=%d pdata? %s\n",
+   dev_info(dev, DRVNAME":  %s id=%d pdata? %s\n",
pdev->name, pdev->id,
pdev->dev.platform_data ? "yes" : "no");
 
-- 
2.1.4

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


Re: [PATCH RESEND 01/16] staging: rtl8188eu: rtw_mlme_ext.c: reorder the report functions

2015-09-14 Thread Luca Ceresoli

Dear Larry, All,

Luca Ceresoli wrote:

Dear Larry,

thanks for your review.

Larry Finger wrote:

On 08/28/2015 03:45 PM, Luca Ceresoli wrote:

Some of the report_*() functions are internal and will be declared
static,
and their declaration removed from rtw_mlme_ext.h, in a later commit.

This would break compilation, since they are are referenced before their
definition.

Reorder these functions so that symbols are defined before they are
referenced, without the need for forward declarations.

Also move near the beginning of the file the collect_bss_info() and
process_80211d(), since they are called from the report_*() functions.

This commit only reorders code, there is no content change.

Signed-off-by: Luca Ceresoli 
Cc: Larry Finger 
Cc: Greg Kroah-Hartman 


Even though you are just moving code, I think you should fix the long
line warnings from scripts/checkpatch, otherwise note that they are not
fixed here, but they will be fixed in a later patch. As for the other
warnings, they should be noted and fixed later.


How much strict is this rule?

Below is the reason for my question.



I understand your point. However, the coding style of rtw_mlme_ext.c is
so far away from the Linux requirements that cleaning it up is a
daunting task.

There are 151 lines over 80 characters, and several (maybe one third)
cannot or should not be fixed by simply adding newlines. Restructuring
the code is needed in some cases, and the complexity of the change
(and of the code review, correspondingly) can well be larger than the
whole impact of my first patchset. In some cases it will require more
understanding of the code that it took to produce this patchset.

Nevertheless I started the cleanup job, but it will take time. When
completed I expect the number of patches in this patchset to at least
double...


And it turns out I was too optimistic. rtw_mlme_ext.c is huge, and it's
a goldmine of coding style errors. The cleanup work is in progress, it
currently counts 50 patches (not including these 16 patches) and there
are still several checkpatch errors to fix, mostly lines over 80
characters.

The problem is most of these lines cannot or should not be fixed by just
adding newlines, as I told earlier. In several cases I first need to
restructure the code, which in turn makes new checkpatch errors visible
in my patches. To fix them I need more patches, which highlight more
errors etc etc... I have no idea how many patches are needed to converge
so I can submit a patchset with a clean
'git diff staging/staging-testing HEAD'.

Thus my question above, clarified: would you accept a patchset that:
 1. fixes checkpatch and other coding style errors, and has minor
improvements;
 2. does not introduce any coding style error;
 3. _does_ have errors in
'git diff staging/staging-testing HEAD | ./scripts/checkpatch.pl -';
 4. contains a written promise that the errors in point 3 will be fixed
by one or more later patchsets?

After these patchsets I'd be able to resubmit this one.

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


[PATCH 03/19] staging/lustre/llite: cleanup open handle for client open failure

2015-09-14 Thread green
From: Fan Yong 

For open case, the client side open handling thread may hit error
after the MDT grant the open. Under such case, the client should
send close RPC to the MDT as cleanup; otherwise, the open handle
on the MDT will be leaked there until the client umount or evicted.

If the LFSCK marks LU_OBJECT_HEARD_BANSHEE on the MDT-object that is
opened by others for repairing some inconsistency, such as repairing
multiple-referenced OST-object, because the leaked open handle still
references the MDT-object, then it will block the subsequent threads
that want to locate such object via FID.

Signed-off-by: Fan Yong 
Reviewed-on: http://review.whamcloud.com/13709
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6301
Reviewed-by: Andreas Dilger 
Reviewed-by: Lai Siyao 
Reviewed-by: Alex Zhuravlev 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/llite/llite_internal.h   |  1 +
 drivers/staging/lustre/lustre/llite/llite_lib.c| 48 +-
 drivers/staging/lustre/lustre/llite/namei.c| 14 +--
 3 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 2de64c2..8a3b03e 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -801,6 +801,7 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
 void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
+void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
 
 /* llite/llite_nfs.c */
 extern struct export_operations lustre_export_operations;
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index c60eb46e..725481d 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1973,6 +1973,47 @@ int ll_remount_fs(struct super_block *sb, int *flags, 
char *data)
return 0;
 }
 
+/**
+ * Cleanup the open handle that is cached on MDT-side.
+ *
+ * For open case, the client side open handling thread may hit error
+ * after the MDT grant the open. Under such case, the client should
+ * send close RPC to the MDT as cleanup; otherwise, the open handle
+ * on the MDT will be leaked there until the client umount or evicted.
+ *
+ * In further, if someone unlinked the file, because the open handle
+ * holds the reference on such file/object, then it will block the
+ * subsequent threads that want to locate such object via FID.
+ *
+ * \param[in] sb   super block for this file-system
+ * \param[in] open_req pointer to the original open request
+ */
+void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req)
+{
+   struct mdt_body *body;
+   struct md_op_data   *op_data;
+   struct ptlrpc_request   *close_req = NULL;
+   struct obd_export   *exp   = ll_s2sbi(sb)->ll_md_exp;
+
+   body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
+   OBD_ALLOC_PTR(op_data);
+   if (!op_data) {
+   CWARN("%s: cannot allocate op_data to release open handle for "
+ DFID "\n",
+ ll_get_fsname(sb, NULL, 0), PFID(&body->fid1));
+
+   return;
+   }
+
+   op_data->op_fid1 = body->fid1;
+   op_data->op_ioepoch = body->ioepoch;
+   op_data->op_handle = body->handle;
+   op_data->op_mod_time = get_seconds();
+   md_close(exp, op_data, NULL, &close_req);
+   ptlrpc_req_finished(close_req);
+   ll_finish_md_op_data(op_data);
+}
+
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
  struct super_block *sb, struct lookup_intent *it)
 {
@@ -1985,7 +2026,7 @@ int ll_prep_inode(struct inode **inode, struct 
ptlrpc_request *req,
rc = md_get_lustre_md(sbi->ll_md_exp, req, sbi->ll_dt_exp,
  sbi->ll_md_exp, &md);
if (rc)
-   return rc;
+   goto cleanup;
 
if (*inode) {
ll_update_inode(*inode, &md);
@@ -2047,6 +2088,11 @@ out:
if (md.lsm != NULL)
obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
md_free_lustre_md(sbi->ll_md_exp, &md);
+
+cleanup:
+   if (rc != 0 && it && it->it_op & IT_OPEN)
+   ll_open_cleanup(sb ? sb : (*inode)->i_sb, req);
+
return rc;
 }
 
diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 05e7dc8..2635678 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -409,7 +409,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request 
*request,
 {
struct inode *inode

[PATCH 02/19] staging/lustre/obdclass: reorganize busy object accounting

2015-09-14 Thread green
From: Frank Zago 

Due to some accounting bug, lsb_busy of a hash bucket can become
larger than the total number of objects in said bucket. A busy object
can be counted more than once. When that happens, a negative value is
returned by the shrinker callback.

Instead of trying (and failing) to count the busy objects, count the
objects than are not busy, i.e. the objects that are present on the
lsb_lru list. The number of busy objects is then the difference
between the number of objects in the hash and the objects on the
lsb_lru list.

Signed-off-by: frank zago 
Reviewed-on: http://review.whamcloud.com/12468
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5722
Reviewed-by: Andreas Dilger 
Reviewed-by: Mike Pershin 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h  |  4 +--
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 35 +-
 2 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index a16c9ea..ea13a82 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -554,9 +554,9 @@ struct fld;
 
 struct lu_site_bkt_data {
/**
-* number of busy object on this bucket
+* number of object in this bucket on the lsb_lru list.
 */
-   long  lsb_busy;
+   longlsb_lru_len;
/**
 * LRU list, updated on each access to object. Protected by
 * bucket lock of lu_site::ls_obj_hash.
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c 
b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 3111982..4f7899f 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -113,8 +113,6 @@ void lu_object_put(const struct lu_env *env, struct 
lu_object *o)
return;
}
 
-   LASSERT(bkt->lsb_busy > 0);
-   bkt->lsb_busy--;
/*
 * When last reference is released, iterate over object
 * layers, and notify them that object is no longer busy.
@@ -127,6 +125,7 @@ void lu_object_put(const struct lu_env *env, struct 
lu_object *o)
if (!lu_object_is_dying(top)) {
LASSERT(list_empty(&top->loh_lru));
list_add_tail(&top->loh_lru, &bkt->lsb_lru);
+   bkt->lsb_lru_len++;
cfs_hash_bd_unlock(site->ls_obj_hash, &bd, 1);
return;
}
@@ -179,7 +178,13 @@ void lu_object_unhash(const struct lu_env *env, struct 
lu_object *o)
struct cfs_hash_bd bd;
 
cfs_hash_bd_get_and_lock(obj_hash, &top->loh_fid, &bd, 1);
+   if (!list_empty(&top->loh_lru)) {
+   struct lu_site_bkt_data *bkt;
+
list_del_init(&top->loh_lru);
+   bkt = cfs_hash_bd_extra_get(obj_hash, &bd);
+   bkt->lsb_lru_len--;
+   }
cfs_hash_bd_del_locked(obj_hash, &bd, &top->loh_hash);
cfs_hash_bd_unlock(obj_hash, &bd, 1);
}
@@ -349,6 +354,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site 
*s, int nr)
cfs_hash_bd_del_locked(s->ls_obj_hash,
   &bd2, &h->loh_hash);
list_move(&h->loh_lru, &dispose);
+   bkt->lsb_lru_len--;
if (did_sth == 0)
did_sth = 1;
 
@@ -561,7 +567,10 @@ static struct lu_object *htable_lookup(struct lu_site *s,
if (likely(!lu_object_is_dying(h))) {
cfs_hash_get(s->ls_obj_hash, hnode);
lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_HIT);
+   if (!list_empty(&h->loh_lru)) {
list_del_init(&h->loh_lru);
+   bkt->lsb_lru_len--;
+   }
return lu_object_top(h);
}
 
@@ -599,7 +608,6 @@ static struct lu_object *lu_object_new(const struct lu_env 
*env,
struct lu_object*o;
struct cfs_hash   *hs;
struct cfs_hash_bd  bd;
-   struct lu_site_bkt_data *bkt;
 
o = lu_object_alloc(env, dev, f, conf);
if (IS_ERR(o))
@@ -607,9 +615,7 @@ static struct lu_object *lu_object_new(const struct lu_env 
*env,
 
hs = dev->ld_site->ls_obj_hash;
cfs_hash_bd_get_and_lock(hs, (void *)f, &bd, 1);
-   bkt = cfs_hash_bd_extra_get(hs, &bd);
cfs_hash_bd_add_locked(hs, &bd, &o->lo_header->loh_hash);
-   bkt->lsb_busy++;
cfs_hash_bd_unlock(hs, &bd, 1);
return o;
 }
@@ -675,11 +681,7 @@ static struct lu_object *lu_object_find_try(const struct 
lu_env *env,
 
shadow = htable_lookup(s, &bd, f, waiter, &version);
if (likely(PTR_ERR(shadow) == -ENOENT)) {
-   struct lu_site

[PATCH 00/19] Lustre fixes

2015-09-14 Thread green
From: Oleg Drokin 

This batch of changes is for various accumulated fixes since the
last time I had a chance to look at it.

The only "exception" is the last patch in the series - the
CPT-aware ptlrpcd patch. This one is included because
there was a strange code in that area otherwise that was flagged
as we were working on cpumasks code.

Please consider.

Andreas Dilger (1):
  staging/lustre/ptlrpc: remove LUSTRE_MSG_MAGIC_V1 support

Andrew Perepechko (1):
  staging/lustre/llite: ASSERTION( atomic_read(&d->ld_ref) == 0 ) failed

Ann Koehler (1):
  staging/lustre/obdclass: Eliminate hash bucket scans in
lu_cache_shrink

Ben Evans (1):
  staging/lustre: Remove unused MAY_ constants

Bruno Faccini (1):
  staging/lustre/llite: strengthen checks for hsm flags and archive id

Fan Yong (1):
  staging/lustre/llite: cleanup open handle for client open failure

Frank Zago (1):
  staging/lustre/obdclass: reorganize busy object accounting

Hiroya Nozaki (1):
  staging/lustre/osc: LBUG in osc_lru_reclaim

Isaac Huang (1):
  staging/lustre/o2iblnd: wrong uses of kib_tx_t::tx_nfrags

James Simmons (1):
  staging/lustre/libcfs: remove unused cfs_timer_done

Li Xi (1):
  staging/lustre/osc: use global osc_rq_pool to reduce memory usage

Liang Zhen (3):
  staging/lustre/o2iblnd: connection refcount fix for kiblnd_post_rx
  staging/lustre/lnet: fix deadloop in ksocknal_push
  staging/lustre/o2iblnd: leak cmid in kiblnd_dev_need_failover

Niu Yawei (2):
  staging/lustre/llite: deny non-root user for changelog operations
  staging/lustre/libcfs: minor fix in cfs_hash_for_each_relax()

Olaf Weber (1):
  staging/lustre/ptlrpc: make ptlrpcd threads cpt-aware

Oleg Drokin (2):
  staging/lustre/lnet: Reenable lnet router debugfs
  staging/lustre/lmv: fix potential null pointer dereference

 .../staging/lustre/include/linux/libcfs/libcfs.h   |   8 +
 .../lustre/include/linux/libcfs/libcfs_prim.h  |   1 -
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |   4 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|   9 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|   3 -
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |  55 +-
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c|  51 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c  |   4 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c |  43 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |   5 +-
 .../lustre/lustre/include/lustre/lustre_idl.h  |  27 +-
 .../staging/lustre/lustre/include/lustre_import.h  |   2 -
 drivers/staging/lustre/lustre/include/lustre_net.h |  63 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |   4 -
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   8 +-
 drivers/staging/lustre/lustre/libcfs/hash.c|   4 +
 .../lustre/lustre/libcfs/linux/linux-prim.c|   6 -
 drivers/staging/lustre/lustre/libcfs/module.c  | 188 +++---
 drivers/staging/lustre/lustre/llite/dir.c  |   3 +
 drivers/staging/lustre/lustre/llite/file.c |   9 +
 .../staging/lustre/lustre/llite/llite_internal.h   |  11 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|  48 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c|   5 +-
 drivers/staging/lustre/lustre/llite/namei.c|  14 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   8 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   2 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|   1 -
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 101 +--
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |  17 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c  |  28 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h|   2 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   6 +-
 drivers/staging/lustre/lustre/osc/osc_page.c   |   3 +-
 drivers/staging/lustre/lustre/osc/osc_request.c| 120 ++--
 drivers/staging/lustre/lustre/ptlrpc/client.c  |  32 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c  |   7 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |   3 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  96 +--
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |   2 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 702 +
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c|   4 -
 43 files changed, 923 insertions(+), 790 deletions(-)

-- 
2.1.0

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


[PATCH 11/19] staging/lustre/lnet: fix deadloop in ksocknal_push

2015-09-14 Thread green
From: Liang Zhen 

ksocknal_push() should break the loop if it can't find matching peer

Signed-off-by: Liang Zhen 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4423
Reviewed-on: http://review.whamcloud.com/10128
Reviewed-by: James Simmons 
Reviewed-by: Doug Oucharek 
Reviewed-by: Isaac Huang 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c| 51 +++---
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index d8bfcad..22f4cd0 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -1874,52 +1874,51 @@ ksocknal_push_peer(ksock_peer_t *peer)
}
 }
 
-static int
-ksocknal_push(lnet_ni_t *ni, lnet_process_id_t id)
+static int ksocknal_push(lnet_ni_t *ni, lnet_process_id_t id)
 {
-   ksock_peer_t *peer;
+   struct list_head *start;
+   struct list_head *end;
struct list_head *tmp;
-   int index;
-   int i;
-   int j;
int rc = -ENOENT;
+   unsigned int hsize = ksocknal_data.ksnd_peer_hash_size;
 
-   for (i = 0; i < ksocknal_data.ksnd_peer_hash_size; i++) {
-   for (j = 0; ; j++) {
-   read_lock(&ksocknal_data.ksnd_global_lock);
+   if (id.nid == LNET_NID_ANY) {
+   start = &ksocknal_data.ksnd_peers[0];
+   end = &ksocknal_data.ksnd_peers[hsize - 1];
+   } else {
+   start = end = ksocknal_nid2peerlist(id.nid);
+   }
 
-   index = 0;
-   peer = NULL;
+   for (tmp = start; tmp <= end; tmp++) {
+   int peer_off; /* searching offset in peer hash table */
 
-   list_for_each(tmp, &ksocknal_data.ksnd_peers[i]) {
-   peer = list_entry(tmp, ksock_peer_t,
- ksnp_list);
+   for (peer_off = 0; ; peer_off++) {
+   ksock_peer_t *peer;
+   int i = 0;
 
+   read_lock(&ksocknal_data.ksnd_global_lock);
+   list_for_each_entry(peer, tmp, ksnp_list) {
if (!((id.nid == LNET_NID_ANY ||
   id.nid == peer->ksnp_id.nid) &&
  (id.pid == LNET_PID_ANY ||
-  id.pid == peer->ksnp_id.pid))) {
-   peer = NULL;
+  id.pid == peer->ksnp_id.pid)))
continue;
-   }
 
-   if (index++ == j) {
+   if (i++ == peer_off) {
ksocknal_peer_addref(peer);
break;
}
}
-
read_unlock(&ksocknal_data.ksnd_global_lock);
 
-   if (peer != NULL) {
-   rc = 0;
-   ksocknal_push_peer(peer);
-   ksocknal_peer_decref(peer);
-   }
-   }
+   if (i == 0) /* no match */
+   break;
 
+   rc = 0;
+   ksocknal_push_peer(peer);
+   ksocknal_peer_decref(peer);
+   }
}
-
return rc;
 }
 
-- 
2.1.0

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


[PATCH 04/19] staging/lustre/llite: strengthen checks for hsm flags and archive id

2015-09-14 Thread green
From: Bruno Faccini 

Prior to this patch undefined flags bits and out of range
archive id can be set.

Signed-off-by: Bruno Faccini 
Reviewed-on: http://review.whamcloud.com/13337
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5757
Reviewed-by: frank zago 
Reviewed-by: Henri Doreau 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 7 +++
 drivers/staging/lustre/lustre/llite/file.c| 9 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index e79af19..9416d95 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -365,6 +365,13 @@ static inline __u64 fid_ver_oid(const struct lu_fid *fid)
return ((__u64)fid_ver(fid) << 32 | fid_oid(fid));
 }
 
+/* copytool uses a 32b bitmask field to encode archive-Ids during register
+ * with MDT thru kuc.
+ * archive num = 0 => all
+ * archive num from 1 to 32
+ */
+#define LL_HSM_MAX_ARCHIVE (sizeof(__u32) * 8)
+
 /**
  * Note that reserved SEQ numbers below 12 will conflict with ldiskfs
  * inodes in the IGIF namespace, so these reserved SEQ numbers can be
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index e332326..b610032 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2118,12 +2118,21 @@ static int ll_hsm_state_set(struct inode *inode, struct 
hsm_state_set *hss)
struct md_op_data   *op_data;
int  rc;
 
+   /* Detect out-of range masks */
+   if ((hss->hss_setmask | hss->hss_clearmask) & ~HSM_FLAGS_MASK)
+   return -EINVAL;
+
/* Non-root users are forbidden to set or clear flags which are
 * NOT defined in HSM_USER_MASK. */
if (((hss->hss_setmask | hss->hss_clearmask) & ~HSM_USER_MASK) &&
!capable(CFS_CAP_SYS_ADMIN))
return -EPERM;
 
+   /* Detect out-of range archive id */
+   if ((hss->hss_valid & HSS_ARCHIVE_ID) &&
+   (hss->hss_archive_id > LL_HSM_MAX_ARCHIVE))
+   return -EINVAL;
+
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
 LUSTRE_OPC_ANY, hss);
if (IS_ERR(op_data))
-- 
2.1.0

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


[PATCH 05/19] staging/lustre/ptlrpc: remove LUSTRE_MSG_MAGIC_V1 support

2015-09-14 Thread green
From: Andreas Dilger 

Remove the remains of LUSTRE_MSG_MAGIC_V1 support from ptlrpc.
It has not been supported since 1.8 and is not functional since 2.0.

In lustre_msg_check_version(), return an error for unsupported RPC
versions so that the server will reject such RPCs early.  Otherwise
the server only prints an error message and continue on.

Signed-off-by: Andreas Dilger 
Reviewed-on: http://review.whamcloud.com/14007
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6349
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  |  3 -
 drivers/staging/lustre/lustre/include/lustre_net.h |  2 -
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  3 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 96 ++
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c|  4 -
 5 files changed, 24 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 9416d95..b0c4433 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -154,10 +154,7 @@
 #define PTL_RPC_MSG_REPLY   4713
 
 /* DON'T use swabbed values of MAGIC as magic! */
-#define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
 #define LUSTRE_MSG_MAGIC_V2 0x0BD00BD3
-
-#define LUSTRE_MSG_MAGIC_V1_SWABBED 0xD00BD00B
 #define LUSTRE_MSG_MAGIC_V2_SWABBED 0xD30BD00B
 
 #define LUSTRE_MSG_MAGIC LUSTRE_MSG_MAGIC_V2
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index 3341b5d..5df493e 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -2610,7 +2610,6 @@ void lustre_msg_set_flags(struct lustre_msg *msg, int 
flags);
 void lustre_msg_clear_flags(struct lustre_msg *msg, int flags);
 __u32 lustre_msg_get_op_flags(struct lustre_msg *msg);
 void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags);
-void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags);
 struct lustre_handle *lustre_msg_get_handle(struct lustre_msg *msg);
 __u32 lustre_msg_get_type(struct lustre_msg *msg);
 __u32 lustre_msg_get_version(struct lustre_msg *msg);
@@ -2626,7 +2625,6 @@ void lustre_msg_set_slv(struct lustre_msg *msg, __u64 
slv);
 void lustre_msg_set_limit(struct lustre_msg *msg, __u64 limit);
 int lustre_msg_get_status(struct lustre_msg *msg);
 __u32 lustre_msg_get_conn_cnt(struct lustre_msg *msg);
-int lustre_msg_is_v1(struct lustre_msg *msg);
 __u32 lustre_msg_get_magic(struct lustre_msg *msg);
 __u32 lustre_msg_get_timeout(struct lustre_msg *msg);
 __u32 lustre_msg_get_service_time(struct lustre_msg *msg);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c 
b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
index 92c746b..22194c0 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
@@ -337,9 +337,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, 
int flags)
 
if (req->rq_reqmsg &&
!(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) {
-   CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x 
req_flags=%#x magic=%d:%x/%x len=%d\n",
+   CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x 
req_flags=%#x magic=%x/%x len=%d\n",
   flags, lustre_msg_get_flags(req->rq_reqmsg),
-  lustre_msg_is_v1(req->rq_reqmsg),
   lustre_msg_get_magic(req->rq_reqmsg),
   lustre_msg_get_magic(req->rq_repmsg), req->rq_replen);
}
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c 
b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index e9f8aa0..f138061 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -103,6 +103,7 @@ static inline int lustre_msg_check_version_v2(struct 
lustre_msg_v2 *msg,
 
 int lustre_msg_check_version(struct lustre_msg *msg, __u32 version)
 {
+#define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
switch (msg->lm_magic) {
case LUSTRE_MSG_MAGIC_V1:
CERROR("msg v1 not supported - please upgrade you system\n");
@@ -113,6 +114,7 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 
version)
CERROR("incorrect message magic: %08x\n", msg->lm_magic);
return 0;
}
+#undef LUSTRE_MSG_MAGIC_V1
 }
 EXPORT_SYMBOL(lustre_msg_check_version);
 
@@ -433,7 +435,8 @@ void *lustre_msg_buf(struct lustre_msg *m, int n, int 
min_size)
case LUSTRE_MSG_MAGIC_V2:
return lustre_msg_buf_v2(m, n, min_size);
default:
-   LASSERTF(0, "incorrect message magic: %08x(msg:%p)\n", 
m->lm_magic, m);
+   LASSERTF(0, "incorrect messa

[PATCH 01/19] staging/lustre/lnet: Reenable lnet router debugfs

2015-09-14 Thread green
From: Oleg Drokin 

It looks like router proc files were defined out, so I missed them
during debugfs conversion.
Reenable the code and move all the variables to debugfs.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |   8 +
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |   4 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c  |   4 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c |  43 +
 drivers/staging/lustre/lustre/libcfs/module.c  | 188 ++---
 5 files changed, 105 insertions(+), 142 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 01961d9..259a336 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -161,4 +161,12 @@ extern struct cfs_psdev_ops libcfs_psdev_ops;
 
 extern struct cfs_wi_sched *cfs_sched_rehash;
 
+struct lnet_debugfs_symlink_def {
+   char *name;
+   char *target;
+};
+
+void lustre_insert_debugfs(struct ctl_table *table,
+  const struct lnet_debugfs_symlink_def *symlinks);
+
 #endif /* _LIBCFS_H */
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index a9c9a07..22d54b2 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -443,8 +443,8 @@ int lnet_del_route(__u32 net, lnet_nid_t gw_nid);
 void lnet_destroy_routes(void);
 int lnet_get_route(int idx, __u32 *net, __u32 *hops,
   lnet_nid_t *gateway, __u32 *alive, __u32 *priority);
-void lnet_proc_init(void);
-void lnet_proc_fini(void);
+void lnet_router_debugfs_init(void);
+void lnet_router_debugfs_fini(void);
 int  lnet_rtrpools_alloc(int im_a_router);
 void lnet_rtrpools_free(void);
 lnet_remotenet_t *lnet_find_net_locked(__u32 net);
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index d14fe70..7fab03b 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1262,7 +1262,7 @@ LNetNIInit(lnet_pid_t requested_pid)
if (rc != 0)
goto failed4;
 
-   lnet_proc_init();
+   lnet_router_debugfs_init();
goto out;
 
  failed4:
@@ -1305,7 +1305,7 @@ LNetNIFini(void)
} else {
LASSERT(!the_lnet.ln_niinit_self);
 
-   lnet_proc_fini();
+   lnet_router_debugfs_fini();
lnet_router_checker_stop();
lnet_ping_target_fini();
 
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c 
b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 40f418b..a9f4cbf 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -25,13 +25,9 @@
 #include "../../include/linux/libcfs/libcfs.h"
 #include "../../include/linux/lnet/lib-lnet.h"
 
-#if  defined(LNET_ROUTER)
-
 /* This is really lnet_proc.c. You might need to update sanity test 215
  * if any file format is changed. */
 
-static struct ctl_table_header *lnet_table_header;
-
 #define LNET_LOFFT_BITS(sizeof(loff_t) * 8)
 /*
  * NB: max allowed LNET_CPT_BITS is 8 on 64-bit system and 2 on 32-bit system
@@ -914,44 +910,11 @@ static struct ctl_table lnet_table[] = {
}
 };
 
-static struct ctl_table top_table[] = {
-   {
-   .procname = "lnet",
-   .mode = 0555,
-   .data = NULL,
-   .maxlen   = 0,
-   .child= lnet_table,
-   },
-   {
-   }
-};
-
-void
-lnet_proc_init(void)
+void lnet_router_debugfs_init(void)
 {
-   if (lnet_table_header == NULL)
-   lnet_table_header = register_sysctl_table(top_table);
+   lustre_insert_debugfs(lnet_table, NULL);
 }
 
-void
-lnet_proc_fini(void)
+void lnet_router_debugfs_fini(void)
 {
-   if (lnet_table_header != NULL)
-   unregister_sysctl_table(lnet_table_header);
-
-   lnet_table_header = NULL;
 }
-
-#else
-
-void
-lnet_proc_init(void)
-{
-}
-
-void
-lnet_proc_fini(void)
-{
-}
-
-#endif
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 806f974..a19f579 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -66,9 +66,6 @@ MODULE_AUTHOR("Peter J. Braam ");
 MODULE_DESCRIPTION("Portals v3.1");
 MODULE_LICENSE("GPL");
 
-static void insert_debugfs(void);
-static void remove_debugfs(void);
-
 static struct dentry *lnet_debugfs_root;
 
 static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
@@ -349,90 +346,6 @@ struct cfs_psdev_ops libcfs_psdev_ops = {
libcfs_ioctl
 };
 
-static int init_libcfs_module(void)
-{
-   int rc;
-
-   libcfs_arch_init();
-   libcfs_init_nidstrings(

[PATCH 07/19] staging/lustre/llite: deny non-root user for changelog operations

2015-09-14 Thread green
From: Niu Yawei 

To avoid potential security problems, non-privileged users should
have no permission to run 'lfs changelog' & 'lfs changelog_clear'.

Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/14280
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6415
Reviewed-by: Lai Siyao 
Reviewed-by: Jinshan Xiong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index d407fcc..cc6f0f5 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1734,6 +1734,9 @@ out_quotactl:
}
case OBD_IOC_CHANGELOG_SEND:
case OBD_IOC_CHANGELOG_CLEAR:
+   if (!capable(CFS_CAP_SYS_ADMIN))
+   return -EPERM;
+
rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
sizeof(struct ioc_changelog));
return rc;
-- 
2.1.0

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


[PATCH 14/19] staging/lustre/obdclass: Eliminate hash bucket scans in lu_cache_shrink

2015-09-14 Thread green
From: Ann Koehler 

The lu_cache_shrink slab shrinker is too slow, accounting for > 90% of
the time spent in shrink_slab when allocating huge pages. Most of its
time is spent iterating over the buckets in each site's object hash
table to compute the number of freeable objects. This iteration is
eliminated by adding an lru length count to the lu_site struct. A
percpu counter is used to maintain the lru length, so that the
lu_site does not need to be locked when an object is accessed through
the hash table. A counter is updated whenever an object is added to
or deleted from any of the hash table buckets. The number of freeable
objects is the sum of the counter values across all cpus.

Signed-off-by: Ann Koehler 
Reviewed-on: http://review.whamcloud.com/14066
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6365
Reviewed-by: Mike Pershin 
Reviewed-by: Andreas Dilger 
Reviewed-by: Alex Zhuravlev 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h  |  1 +
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 66 ++
 2 files changed, 42 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index ea13a82..96e271d 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -584,6 +584,7 @@ enum {
LU_SS_CACHE_RACE,
LU_SS_CACHE_DEATH_RACE,
LU_SS_LRU_PURGED,
+   LU_SS_LRU_LEN,  /* # of objects in lsb_lru lists */
LU_SS_LAST_STAT
 };
 
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c 
b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 4f7899f..c892e82 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -59,6 +59,7 @@
 #include 
 
 static void lu_object_free(const struct lu_env *env, struct lu_object *o);
+static __u32 ls_stats_read(struct lprocfs_stats *stats, int idx);
 
 /**
  * Decrease reference counter on object. If last reference is freed, return
@@ -126,6 +127,9 @@ void lu_object_put(const struct lu_env *env, struct 
lu_object *o)
LASSERT(list_empty(&top->loh_lru));
list_add_tail(&top->loh_lru, &bkt->lsb_lru);
bkt->lsb_lru_len++;
+   lprocfs_counter_incr(site->ls_stats, LU_SS_LRU_LEN);
+   CDEBUG(D_INODE, "Add %p to site lru. hash: %p, bkt: %p, 
lru_len: %ld\n",
+  o, site->ls_obj_hash, bkt, bkt->lsb_lru_len);
cfs_hash_bd_unlock(site->ls_obj_hash, &bd, 1);
return;
}
@@ -174,16 +178,18 @@ void lu_object_unhash(const struct lu_env *env, struct 
lu_object *o)
top = o->lo_header;
set_bit(LU_OBJECT_HEARD_BANSHEE, &top->loh_flags);
if (!test_and_set_bit(LU_OBJECT_UNHASHED, &top->loh_flags)) {
-   struct cfs_hash *obj_hash = o->lo_dev->ld_site->ls_obj_hash;
+   struct lu_site *site = o->lo_dev->ld_site;
+   struct cfs_hash *obj_hash = site->ls_obj_hash;
struct cfs_hash_bd bd;
 
cfs_hash_bd_get_and_lock(obj_hash, &top->loh_fid, &bd, 1);
if (!list_empty(&top->loh_lru)) {
struct lu_site_bkt_data *bkt;
 
-   list_del_init(&top->loh_lru);
+   list_del_init(&top->loh_lru);
bkt = cfs_hash_bd_extra_get(obj_hash, &bd);
bkt->lsb_lru_len--;
+   lprocfs_counter_decr(site->ls_stats, LU_SS_LRU_LEN);
}
cfs_hash_bd_del_locked(obj_hash, &bd, &top->loh_hash);
cfs_hash_bd_unlock(obj_hash, &bd, 1);
@@ -355,6 +361,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site 
*s, int nr)
   &bd2, &h->loh_hash);
list_move(&h->loh_lru, &dispose);
bkt->lsb_lru_len--;
+   lprocfs_counter_decr(s->ls_stats, LU_SS_LRU_LEN);
if (did_sth == 0)
did_sth = 1;
 
@@ -568,8 +575,9 @@ static struct lu_object *htable_lookup(struct lu_site *s,
cfs_hash_get(s->ls_obj_hash, hnode);
lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_HIT);
if (!list_empty(&h->loh_lru)) {
-   list_del_init(&h->loh_lru);
+   list_del_init(&h->loh_lru);
bkt->lsb_lru_len--;
+   lprocfs_counter_decr(s->ls_stats, LU_SS_LRU_LEN);
}
return lu_object_top(h);
}
@@ -1029,6 +1037,12 @@ int lu_site_init(struct lu_site *s, struct lu_device 
*top)
 0, "cache_death_race", "cache_death_race");
lprocfs_counter_init(s->ls_stats, LU_SS_LRU_PURGED,
 0, "lru_purged", "lru_pu

[PATCH 06/19] staging/lustre/lmv: fix potential null pointer dereference

2015-09-14 Thread green
From: Oleg Drokin 

In lmv_disconnect_mdc do procfs removal only if we actually know the name.

Reviewed-on: http://review.whamcloud.com/14605
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6517
Reviewed-by: James Simmons 
Reviewed-by: John L. Hammond 
Reviewed-by: Dmitry Eremin 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 0fc0b61..cebbacf 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -593,11 +593,11 @@ static int lmv_disconnect_mdc(struct obd_device *obd, 
struct lmv_tgt_desc *tgt)
mdc_obd->obd_force = obd->obd_force;
mdc_obd->obd_fail = obd->obd_fail;
mdc_obd->obd_no_recov = obd->obd_no_recov;
-   }
 
-   if (lmv->lmv_tgts_kobj)
-   sysfs_remove_link(lmv->lmv_tgts_kobj,
- mdc_obd->obd_name);
+   if (lmv->lmv_tgts_kobj)
+   sysfs_remove_link(lmv->lmv_tgts_kobj,
+ mdc_obd->obd_name);
+   }
 
rc = obd_fid_fini(tgt->ltd_exp->exp_obd);
if (rc)
-- 
2.1.0

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


[PATCH 08/19] staging/lustre/o2iblnd: connection refcount fix for kiblnd_post_rx

2015-09-14 Thread green
From: Liang Zhen 

kiblnd_post_rx() can't refer to rx::rx_conn anymore after
ib_post_recv() because this rx can be polled out by another thread
which may drop this rx and destroy rx::rx_conn.

This patch fixes this issue by taking an extra refcount on connection
before calling ib_post_recv().

Signed-off-by: Liang Zhen 
Reviewed-on: http://review.whamcloud.com/12852
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5678
Reviewed-by: Isaac Huang 
Reviewed-by: Amir Shehata 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 345ed4d..c0f5682 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -178,24 +178,28 @@ kiblnd_post_rx(kib_rx_t *rx, int credit)
 
rx->rx_nob = -1;/* flag posted */
 
+   /* NB: need an extra reference after ib_post_recv because we don't
+* own this rx (and rx::rx_conn) anymore, LU-5678.
+*/
+   kiblnd_conn_addref(conn);
rc = ib_post_recv(conn->ibc_cmid->qp, &rx->rx_wrq, &bad_wrq);
-   if (rc != 0) {
+   if (unlikely(rc != 0)) {
CERROR("Can't post rx for %s: %d, bad_wrq: %p\n",
   libcfs_nid2str(conn->ibc_peer->ibp_nid), rc, bad_wrq);
rx->rx_nob = 0;
}
 
if (conn->ibc_state < IBLND_CONN_ESTABLISHED) /* Initial post */
-   return rc;
+   goto out;
 
-   if (rc != 0) {
+   if (unlikely(rc != 0)) {
kiblnd_close_conn(conn, rc);
kiblnd_drop_rx(rx);  /* No more posts for this rx */
-   return rc;
+   goto out;
}
 
if (credit == IBLND_POSTRX_NO_CREDIT)
-   return 0;
+   goto out;
 
spin_lock(&conn->ibc_lock);
if (credit == IBLND_POSTRX_PEER_CREDIT)
@@ -205,7 +209,9 @@ kiblnd_post_rx(kib_rx_t *rx, int credit)
spin_unlock(&conn->ibc_lock);
 
kiblnd_check_sends(conn);
-   return 0;
+out:
+   kiblnd_conn_decref(conn);
+   return rc;
 }
 
 static kib_tx_t *
-- 
2.1.0

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


[PATCH 13/19] staging/lustre/llite: ASSERTION( atomic_read(&d->ld_ref) == 0 ) failed

2015-09-14 Thread green
From: Andrew Perepechko 

ll_iget_for_nfs() can call unbalanced iput() causing memory
leaks. This patch removes this iput() call.

Also, avoid unhashing disconnected dentries in
d_lustre_invalidate(), which is another source of memory
leaks.

One of the symptoms of the leak is the following crash pattern:
LustreError: 14812:0:(lu_object.c:1251:lu_device_fini())
 ASSERTION( atomic_read(&d->ld_ref) == 0 ) failed: Refcount is 1
LustreError: 14812:0:(lu_object.c:1251:lu_device_fini()) LBUG
Pid: 14812, comm: umount

Call Trace:
 [] libcfs_debug_dumpstack+0x55/0x80 [libcfs]
 [] lbug_with_loc+0x47/0xb0 [libcfs]
 [] lu_device_fini+0xb8/0xc0 [obdclass]
 [] lovsub_device_free+0x52/0x220 [lov]
 [] lu_stack_fini+0x7e/0xc0 [obdclass]
 [] cl_stack_fini+0xe/0x10 [obdclass]
 [] lov_device_fini+0x58/0x120 [lov]
 [] lu_stack_fini+0x49/0xc0 [obdclass]
 [] cl_stack_fini+0xe/0x10 [obdclass]
 [] cl_sb_fini+0x6d/0x190 [lustre]
 [] ll_put_super+0x1bc/0x11e0 [lustre]
 [] ? fsnotify_clear_marks_by_inode+0x32/0xf0
 [] ? destroy_inode+0x2f/0x60
 [] ? dispose_list+0xfc/0x120
 [] ? invalidate_inodes+0xf6/0x190
 [] generic_shutdown_super+0x5b/0xe0
 [] kill_anon_super+0x16/0x60
 [] lustre_kill_super+0x4a/0x60 [obdclass]
 [] deactivate_super+0x57/0x80
 [] mntput_no_expire+0xbf/0x110
 [] sys_umount+0x7b/0x3a0
 [] system_call_fastpath+0x16/0x1b

Signed-off-by: Andrew Perepechko 
Reviewed-on: http://review.whamcloud.com/15480
Xyratex-bug-id: MRP-2414
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6794
Reviewed-by: Lai Siyao 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 10 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c  |  5 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 8a3b03e..37bf331 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -1466,7 +1466,15 @@ static inline void d_lustre_invalidate(struct dentry 
*dentry, int nested)
spin_lock_nested(&dentry->d_lock,
 nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
__d_lustre_invalidate(dentry);
-   if (d_count(dentry) == 0)
+   /*
+* We should be careful about dentries created by d_obtain_alias().
+* These dentries are not put in the dentry tree, instead they are
+* linked to sb->s_anon through dentry->d_hash.
+* shrink_dcache_for_umount() shrinks the tree and sb->s_anon list.
+* If we unhashed such a dentry, unmount would not be able to find
+* it and busy inodes would be reported.
+*/
+   if (d_count(dentry) == 0 && !(dentry->d_flags & DCACHE_DISCONNECTED))
__d_drop(dentry);
spin_unlock(&dentry->d_lock);
 }
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 8d1c253..400acacc 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -168,11 +168,8 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid 
*fid, struct lu_fid *paren
spin_unlock(&lli->lli_lock);
}
 
+   /* N.B. d_obtain_alias() drops inode ref on error */
result = d_obtain_alias(inode);
-   if (IS_ERR(result)) {
-   iput(inode);
-   return result;
-   }
 
return result;
 }
-- 
2.1.0

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


[PATCH 10/19] staging/lustre/libcfs: minor fix in cfs_hash_for_each_relax()

2015-09-14 Thread green
From: Niu Yawei 

cfs_hash_for_each_relax() should break iteration when callback
returns non-zero value.

Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/14927
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6636
Reviewed-by: Bobi Jam 
Reviewed-by: Andreas Dilger 
Reviewed-by: Liang Zhen 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/libcfs/hash.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index 286641b..6f4c7d4 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -1623,8 +1623,12 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, 
cfs_hash_for_each_cb_t func,
if (rc) /* callback wants to break iteration */
break;
}
+   if (rc) /* callback wants to break iteration */
+   break;
}
cfs_hash_bd_unlock(hs, &bd, 0);
+   if (rc) /* callback wants to break iteration */
+   break;
}
cfs_hash_unlock(hs, 0);
 
-- 
2.1.0

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


[PATCH 12/19] staging/lustre/o2iblnd: wrong uses of kib_tx_t::tx_nfrags

2015-09-14 Thread green
From: Isaac Huang 

The kib_tx_t::tx_nfrags field is the # entries in
the kib_tx_t::tx_frags array, rather than # DMA
mapped entries. So kiblnd_send/kiblnd_recv should
use kib_rdma_desc_t::rd_nfrags instead.

Signed-off-by: Isaac Huang 
Reviewed-on: http://review.whamcloud.com/12857
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5956
Reviewed-by: Liang Zhen 
Reviewed-by: James Simmons 
Reviewed-by: Doug Oucharek 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|  3 --
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 37 +++---
 2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
index 07e81cb..eb08400 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
@@ -912,9 +912,6 @@ struct ib_mr *kiblnd_find_dma_mr(kib_hca_dev_t *hdev,
 __u64 addr, __u64 size);
 void kiblnd_map_rx_descs(kib_conn_t *conn);
 void kiblnd_unmap_rx_descs(kib_conn_t *conn);
-int kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx,
- kib_rdma_desc_t *rd, int nfrags);
-void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx);
 void kiblnd_pool_free_node(kib_pool_t *pool, struct list_head *node);
 struct list_head *kiblnd_pool_alloc_node(kib_poolset_t *ps);
 
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index c0f5682..8ab73ee 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -40,6 +40,8 @@
 
 #include "o2iblnd.h"
 
+static void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx);
+
 static void
 kiblnd_tx_done(lnet_ni_t *ni, kib_tx_t *tx)
 {
@@ -596,8 +598,7 @@ kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, 
kib_rdma_desc_t *rd, int nob)
return 0;
 }
 
-void
-kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx)
+static void kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx)
 {
kib_net_t *net = ni->ni_data;
 
@@ -615,9 +616,8 @@ kiblnd_unmap_tx(lnet_ni_t *ni, kib_tx_t *tx)
}
 }
 
-int
-kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx,
- kib_rdma_desc_t *rd, int nfrags)
+static int kiblnd_map_tx(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
+int nfrags)
 {
kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
kib_net_t *net = ni->ni_data;
@@ -1427,6 +1427,7 @@ kiblnd_send(lnet_ni_t *ni, void *private, lnet_msg_t 
*lntmsg)
unsigned int payload_offset = lntmsg->msg_offset;
unsigned int payload_nob = lntmsg->msg_len;
kib_msg_t *ibmsg;
+   kib_rdma_desc_t  *rd;
kib_tx_t *tx;
int nob;
int rc;
@@ -1470,16 +1471,14 @@ kiblnd_send(lnet_ni_t *ni, void *private, lnet_msg_t 
*lntmsg)
}
 
ibmsg = tx->tx_msg;
-
+   rd = &ibmsg->ibm_u.get.ibgm_rd;
if ((lntmsg->msg_md->md_options & LNET_MD_KIOV) == 0)
-   rc = kiblnd_setup_rd_iov(ni, tx,
-&ibmsg->ibm_u.get.ibgm_rd,
+   rc = kiblnd_setup_rd_iov(ni, tx, rd,
 lntmsg->msg_md->md_niov,
 lntmsg->msg_md->md_iov.iov,
 0, lntmsg->msg_md->md_length);
else
-   rc = kiblnd_setup_rd_kiov(ni, tx,
- &ibmsg->ibm_u.get.ibgm_rd,
+   rc = kiblnd_setup_rd_kiov(ni, tx, rd,
  lntmsg->msg_md->md_niov,
  lntmsg->msg_md->md_iov.kiov,
  0, lntmsg->msg_md->md_length);
@@ -1490,7 +1489,7 @@ kiblnd_send(lnet_ni_t *ni, void *private, lnet_msg_t 
*lntmsg)
return -EIO;
}
 
-   nob = offsetof(kib_get_msg_t, ibgm_rd.rd_frags[tx->tx_nfrags]);
+   nob = offsetof(kib_get_msg_t, ibgm_rd.rd_frags[rd->rd_nfrags]);
ibmsg->ibm_u.get.ibgm_cookie = tx->tx_cookie;
ibmsg->ibm_u.get.ibgm_hdr = *hdr;
 
@@ -1655,7 +1654,6 @@ kiblnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t 
*lntmsg, int delayed,
kib_msg_t *rxmsg = rx->rx_msg;
kib_conn_t *conn = rx->rx_conn;
kib_tx_t *tx;
-   kib_msg_t *txmsg;
int nob;
int post_credit = IBLND_POSTRX_PEER_CREDIT;
int rc = 0;
@@ -1692,7 +1690,10 @@ kiblnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t 
*lntmsg, int delayed,
lnet_finalize(ni, lntmsg, 0);
break;
 
-   case IBLND_MSG_PUT_REQ:
+   case IBLND_MSG_PUT_REQ: {
+   kib_msg_t   *txmsg;
+   kib_

[PATCH 17/19] staging/lustre/o2iblnd: leak cmid in kiblnd_dev_need_failover

2015-09-14 Thread green
From: Liang Zhen 

cmid created by kiblnd_dev_need_failover should always be destroyed,
however it is not the case in current implementation and we will leak
cmid when this function detected a device failover.

Signed-off-by: Liang Zhen 
Reviewed-on: http://review.whamcloud.com/14603
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6480
Reviewed-by: Isaac Huang 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index c29d2ce..faa70f0 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2228,13 +2228,10 @@ static int kiblnd_dev_need_failover(kib_dev_t *dev)
return rc;
}
 
-   if (dev->ibd_hdev->ibh_ibdev == cmid->device) {
-   /* don't need device failover */
-   rdma_destroy_id(cmid);
-   return 0;
-   }
+   rc = dev->ibd_hdev->ibh_ibdev != cmid->device; /* true for failover */
+   rdma_destroy_id(cmid);
 
-   return 1;
+   return rc;
 }
 
 int kiblnd_dev_failover(kib_dev_t *dev)
-- 
2.1.0

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


[PATCH 16/19] staging/lustre/osc: use global osc_rq_pool to reduce memory usage

2015-09-14 Thread green
From: Li Xi 

The per-osc request pools consume a lot of memory if there are
hundreds of OSCs on one client. This will be a critical problem
if the client doesn't have sufficient memory for both OSCs and
applications.

This patch replaces per-osc request pools with a global pool
osc_rq_pool. The total memory usage is 5MB by default. And it
can be set by a module parameter of OSC:
"options osc osc_reqpool_mem_max=POOL_SIZE". The unit of POOL_SIZE
is MB. If cl_max_rpcs_in_flight is the same for all OSCs, the
memory usage of the OSC pool can be calculated as:
Min(POOL_SIZE * 1M,
(cl_max_rpcs_in_flight + 2) * OSC number * OST_MAXREQSIZE)

Also, this patch changes the allocation logic of OSC write requests.
The allocation from osc_rq_pool will only be tried after normal
allocation failed.

Signed-off-by: Wu Libin 
Signed-off-by: Wang Shilong 
Signed-off-by: Li Xi 
Reviewed-on: http://review.whamcloud.com/15422
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6770
Reviewed-by: Jinshan Xiong 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_import.h  |  2 -
 drivers/staging/lustre/lustre/include/lustre_net.h |  7 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  4 --
 drivers/staging/lustre/lustre/obdclass/genops.c|  1 -
 drivers/staging/lustre/lustre/osc/lproc_osc.c  | 17 -
 drivers/staging/lustre/lustre/osc/osc_internal.h   |  4 ++
 drivers/staging/lustre/lustre/osc/osc_request.c| 79 ++
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 21 +++---
 8 files changed, 94 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h 
b/drivers/staging/lustre/lustre/include/lustre_import.h
index 5a38f3d..c8b89a3 100644
--- a/drivers/staging/lustre/lustre/include/lustre_import.h
+++ b/drivers/staging/lustre/lustre/include/lustre_import.h
@@ -306,8 +306,6 @@ struct obd_import {
__u32imp_msg_magic;
__u32imp_msghdr_flags;   /* adjusted based on 
server capability */
 
-   struct ptlrpc_request_pool *imp_rq_pool;  /* emergency request 
pool */
-
struct imp_atimp_at; /* adaptive timeout data */
time_t  imp_last_reply_time;/* for health check */
 };
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index 5df493e..313a56c 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -500,7 +500,7 @@ struct ptlrpc_request_pool {
/** Maximum message size that would fit into a request from this pool */
int prp_rq_size;
/** Function to allocate more requests for this pool */
-   void (*prp_populate)(struct ptlrpc_request_pool *, int);
+   int (*prp_populate)(struct ptlrpc_request_pool *, int);
 };
 
 struct lu_context;
@@ -2381,11 +2381,11 @@ void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc,
struct ptlrpc_request *req);
 
 void ptlrpc_free_rq_pool(struct ptlrpc_request_pool *pool);
-void ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq);
+int ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq);
 
 struct ptlrpc_request_pool *
 ptlrpc_init_rq_pool(int, int,
-   void (*populate_pool)(struct ptlrpc_request_pool *, int));
+   int (*populate_pool)(struct ptlrpc_request_pool *, int));
 
 void ptlrpc_at_set_req_timeout(struct ptlrpc_request *req);
 struct ptlrpc_request *ptlrpc_request_alloc(struct obd_import *imp,
@@ -2957,7 +2957,6 @@ void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int 
bytes);
 
 /* ptlrpc/llog_client.c */
 extern struct llog_operations llog_client_ops;
-
 /** @} net */
 
 #endif
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 87bb2ce..ce6fa55 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -626,10 +626,6 @@ static inline void obd_cleanup_client_import(struct 
obd_device *obd)
CDEBUG(D_CONFIG, "%s: client import never connected\n",
   obd->obd_name);
ptlrpc_invalidate_import(imp);
-   if (imp->imp_rq_pool) {
-   ptlrpc_free_rq_pool(imp->imp_rq_pool);
-   imp->imp_rq_pool = NULL;
-   }
client_destroy_import(imp);
obd->u.cli.cl_import = NULL;
}
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c 
b/drivers/staging/lustre/lustre/obdclass/genops.c
index 370d5b4..594955d 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -1663,7 +1663,6 @@ static void obd_zombie_export_add(struct obd_export *exp)
 static void obd_zombie_import_add(st

[PATCH 09/19] staging/lustre/osc: LBUG in osc_lru_reclaim

2015-09-14 Thread green
From: Hiroya Nozaki 

LASSERT touches cl_client_cache->ccc_lru without any protection.
So this patch the LASSERT moves to the section protected by
cl_client_cache->ccc_lru_lock

Signed-off-by: Hiroya Nozaki 
Reviewed-on: http://review.whamcloud.com/14901
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6624
Reviewed-by: Andreas Dilger 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_page.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
b/drivers/staging/lustre/lustre/osc/osc_page.c
index 856d859..2af3232 100644
--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -818,7 +818,6 @@ static int osc_lru_reclaim(struct client_obd *cli)
int rc;
 
LASSERT(cache != NULL);
-   LASSERT(!list_empty(&cache->ccc_lru));
 
rc = osc_lru_shrink(cli, lru_shrink_min);
if (rc != 0) {
@@ -835,6 +834,8 @@ static int osc_lru_reclaim(struct client_obd *cli)
/* Reclaim LRU slots from other client_obd as it can't free enough
 * from its own. This should rarely happen. */
spin_lock(&cache->ccc_lru_lock);
+   LASSERT(!list_empty(&cache->ccc_lru));
+
cache->ccc_lru_shrinkers++;
list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);
 
-- 
2.1.0

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


[PATCH 18/19] staging/lustre/libcfs: remove unused cfs_timer_done

2015-09-14 Thread green
From: James Simmons 

Remove the cfs_timer_done function in the libcfs
kernel module since it is not used anywhere.

Signed-off-by: James Simmons 
Signed-off-by: frank zago 
Reviewed-on: http://review.whamcloud.com/13917
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h | 1 -
 drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c   | 6 --
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
index 978d3e2..62ade08 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
@@ -49,7 +49,6 @@ void add_wait_queue_exclusive_head(wait_queue_head_t *, 
wait_queue_t *);
 
 void cfs_init_timer(struct timer_list *t);
 void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg);
-void cfs_timer_done(struct timer_list *t);
 void cfs_timer_arm(struct timer_list *t, unsigned long deadline);
 void cfs_timer_disarm(struct timer_list *t);
 int  cfs_timer_is_armed(struct timer_list *t);
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
index 838f5f3..12b6af4 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
@@ -84,12 +84,6 @@ void cfs_timer_init(struct timer_list *t, cfs_timer_func_t 
*func, void *arg)
 }
 EXPORT_SYMBOL(cfs_timer_init);
 
-void cfs_timer_done(struct timer_list *t)
-{
-   return;
-}
-EXPORT_SYMBOL(cfs_timer_done);
-
 void cfs_timer_arm(struct timer_list *t, unsigned long deadline)
 {
mod_timer(t, deadline);
-- 
2.1.0

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


[PATCH 15/19] staging/lustre: Remove unused MAY_ constants

2015-09-14 Thread green
From: Ben Evans 

Remove unused MAY_ constants from lustre_idl.h

Signed-off-by: Ben Evans 
Reviewed-on: http://review.whamcloud.com/15398
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6450
Reviewed-by: John L. Hammond 
Reviewed-by: Dmitry Eremin 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre/lustre_idl.h   | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index b0c4433..d20e199 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2370,23 +2370,6 @@ void lustre_swab_mdt_rec_setattr(struct mdt_rec_setattr 
*sa);
  */
 #define MDS_OPEN_RELEASE   02ULL /* Open the file for HSM release 
*/
 
-/* permission for create non-directory file */
-#define MAY_CREATE  (1 << 7)
-/* permission for create directory file */
-#define MAY_LINK   (1 << 8)
-/* permission for delete from the directory */
-#define MAY_UNLINK  (1 << 9)
-/* source's permission for rename */
-#define MAY_RENAME_SRC  (1 << 10)
-/* target's permission for rename */
-#define MAY_RENAME_TAR  (1 << 11)
-/* part (parent's) VTX permission check */
-#define MAY_VTX_PART(1 << 12)
-/* full VTX permission check */
-#define MAY_VTX_FULL(1 << 13)
-/* lfs rgetfacl permission check */
-#define MAY_RGETFACL(1 << 14)
-
 enum mds_op_bias {
MDS_CHECK_SPLIT = 1 << 0,
MDS_CROSS_REF   = 1 << 1,
-- 
2.1.0

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


[PATCH 19/19] staging/lustre/ptlrpc: make ptlrpcd threads cpt-aware

2015-09-14 Thread green
From: Olaf Weber 

On NUMA systems, the placement of worker threads relative to the
memory they use greatly affects performance. The CPT mechanism can be
used to constrain a number of Lustre thread types, and this change
makes it possible to configure the placement of ptlrpcd threads in a
similar manner.

To simplify the code changes, the global structures used to manage
ptlrpcd threads are changed to one per CPT. In particular this means
there will be one ptlrpcd recovery thread per CPT.

To prevent ptlrpcd threads from wandering all over the system, all
ptlrpcd thread are bound to a CPT. Note that some CPT configuration
is always created, but the defaults are not likely to be correct for
a NUMA system. After discussing the options with Liang Zhen we
decided that we would not bind ptlrpcd threads to specific CPUs,
and rather trust the kernel scheduler to migrate ptlrpcd threads.

With all ptlrpcd threads bound to a CPT, but not to specific CPUs,
the load policy mechanism can be radically simplified:

- PDL_POLICY_LOCAL and PDL_POLICY_ROUND are currently identical.
- PDL_POLICY_ROUND, if fully implemented, would cost us the locality
  we are trying to achieve, so most or all calls using this policy
  would have to be changed to PDL_POLICY_LOCAL.
- PDL_POLICY_PREFERRED is not used, and cannot be implemented without
  binding ptlrpcd threads to individual CPUs.
- PDL_POLICY_SAME is rarely used, and cannot be implemented without
  binding ptlrpcd threads to individual CPUs.

The partner mechanism is also updated, because now all ptlrpcd
threads are "bound" threads. The only difference between the various
bind policies, PDB_POLICY_NONE, PDB_POLICY_FULL, PDB_POLICY_PAIR, and
PDB_POLICY_NEIGHBOR, is the number of partner threads. The bind
policy is replaced with a tunable that directly specifies the size of
the groups of ptlrpcd partner threads.

Ensure that the ptlrpc_request_set for a ptlrpcd thread is created on
the same CPT that the thread will work on. When threads are bound to
specific nodes and/or CPUs in a NUMA system, it pays to ensure that
the datastructures used by these threads are also on the same node.

Visible changes:

* ptlrpcd thread names include the CPT number, for example
  "ptlrpcd_02_07". In this case the "07" is relative to the CPT, and
  not a CPU number.

Tunables added:

* ptlrpcd_cpts (string): A CPT string describing the CPU partitions
  that ptlrpcd threads should run on. Used to make ptlrpcd threads
  run on a subset of all CPTs.

* ptlrpcd_per_cpt_max (int): The maximum number of ptlrpcd threads
  to run in a CPT.

* ptlrpcd_partner_group_size (int): The desired number of threads
  in each ptlrpcd partner thread group. Default is 2, corresponding
  to the old PDB_POLICY_PAIR. A negative value makes all ptlrpcd
  threads in a CPT partners of each other.

Tunables obsoleted:

* max_ptlrpcds: The new ptlrcpd_per_cpt_max can be used to obtain the
  same effect.

* ptlrpcd_bind_policy: The new ptlrpcd_partner_group_size can be used
  to obtain the same effect.

Internal interface changes:

* pdb_policy_t and related code have been removed. Groups of partner
  ptlrpcd threads are still created, and all threads in a partner
  group are bound on the same CPT. The ptlrpcd threads bound to a
  CPT are typically divided into several partner groups. The partner
  groups on a CPT all have an equal number of ptlrpcd threads.

* pdl_policy_t and related code have been removed. Since ptlrpcd
  threads are not bound to a specific CPU, all the code that avoids
  scheduling on the current CPU (or attempts to do so) has been
  removed as non-functional. A simplified form of PDL_POLICY_LOCAL
  is kept as the only load policy.

* LIOD_BIND and related code have been removed. All ptlrpcd threads
  are now bound to a CPT, and no additional binding policy is
  implemented.

* ptlrpc_prep_set(): Changed to allocate a ptlrpc_request_set
  on the current CPT.

* ptlrpcd(): If an error is encountered before entering the main loop
  store the error in pc_error before exiting.

* ptlrpcd_start(): Check pc_error to verify that the ptlrpcd thread
  has successfully entered its main loop.

* ptlrpcd_init(): Initialize the struct ptlrpcd_ctl for all threads
  for a CPT before starting any of them. This closes a race during
  startup where a partner thread could reference a non-initialized
  struct ptlrpcd_ctl.

Signed-off-by: Olaf Weber 
Reviewed-on: http://review.whamcloud.com/13972
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6325
Reviewed-by: GrƩgoire Pichon 
Reviewed-by: Stephen Champion 
Reviewed-by: James Simmons 
Reviewed-by: Jinshan Xiong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_net.h |  54 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   8 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   2 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c  |  28 +-
 .../staging/lustre/lustre/osc

Re: [PATCH RESEND 01/16] staging: rtl8188eu: rtw_mlme_ext.c: reorder the report functions

2015-09-14 Thread Larry Finger

On 09/14/2015 05:34 PM, Luca Ceresoli wrote:

Dear Larry, All,

Luca Ceresoli wrote:

Dear Larry,

thanks for your review.

Larry Finger wrote:

On 08/28/2015 03:45 PM, Luca Ceresoli wrote:

Some of the report_*() functions are internal and will be declared
static,
and their declaration removed from rtw_mlme_ext.h, in a later commit.

This would break compilation, since they are are referenced before their
definition.

Reorder these functions so that symbols are defined before they are
referenced, without the need for forward declarations.

Also move near the beginning of the file the collect_bss_info() and
process_80211d(), since they are called from the report_*() functions.

This commit only reorders code, there is no content change.

Signed-off-by: Luca Ceresoli 
Cc: Larry Finger 
Cc: Greg Kroah-Hartman 


Even though you are just moving code, I think you should fix the long
line warnings from scripts/checkpatch, otherwise note that they are not
fixed here, but they will be fixed in a later patch. As for the other
warnings, they should be noted and fixed later.


How much strict is this rule?

Below is the reason for my question.



I understand your point. However, the coding style of rtw_mlme_ext.c is
so far away from the Linux requirements that cleaning it up is a
daunting task.

There are 151 lines over 80 characters, and several (maybe one third)
cannot or should not be fixed by simply adding newlines. Restructuring
the code is needed in some cases, and the complexity of the change
(and of the code review, correspondingly) can well be larger than the
whole impact of my first patchset. In some cases it will require more
understanding of the code that it took to produce this patchset.

Nevertheless I started the cleanup job, but it will take time. When
completed I expect the number of patches in this patchset to at least
double...


And it turns out I was too optimistic. rtw_mlme_ext.c is huge, and it's
a goldmine of coding style errors. The cleanup work is in progress, it
currently counts 50 patches (not including these 16 patches) and there
are still several checkpatch errors to fix, mostly lines over 80
characters.

The problem is most of these lines cannot or should not be fixed by just
adding newlines, as I told earlier. In several cases I first need to
restructure the code, which in turn makes new checkpatch errors visible
in my patches. To fix them I need more patches, which highlight more
errors etc etc... I have no idea how many patches are needed to converge
so I can submit a patchset with a clean
'git diff staging/staging-testing HEAD'.

Thus my question above, clarified: would you accept a patchset that:
  1. fixes checkpatch and other coding style errors, and has minor
 improvements;
  2. does not introduce any coding style error;
  3. _does_ have errors in
 'git diff staging/staging-testing HEAD | ./scripts/checkpatch.pl -';
  4. contains a written promise that the errors in point 3 will be fixed
 by one or more later patchsets?

After these patchsets I'd be able to resubmit this one.


Just run checkpatch.pl on each patch that you submit. It should be clean, or you 
must explain the specific reason for ignoring a warning. Errors are *never* 
acceptable, I think that covers points 1, 2 and 4. Number 3 is only valid under 
the conditions of point 4, and only with warnings, not errors.


Yes, cleaning up this driver would be a major task, which is why I have not done 
any of it. In addition, many of the checkpatch warnings were not present when 
the driver was first submitted. The script's requirements are a moving target. 
My plan is to replace the driver with one that uses mac80211, and is programmed 
more cleanly. You, however, are free to hack on this as much as you want. Just 
do not break it as it is still needed.


Larry

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


Re: [PATCH 2/2] staging: wilc1000: remove RX_BH_TYPE

2015-09-14 Thread Tony Cho

Hi Greg,

I am sorry but please ignore this patch in this time.

It's my mistake to include this patch from my queue into the series of 7 
patches.

Thanks,

Tony.


On 2015ė…„ 09ģ›” 11ģ¼ 16:52, Tony Cho wrote:

This patch removes the preprocessor definition, RX_BH_TYPE and uses the
request_threaded_irq instead of kernel thread to execute the interrupt
handler.

As a result, linux_wlan_enable_irq() and linux_wlan_disable_irq() are also
removed from the linux_wlan.c file.

Signed-off-by: Tony Cho 
---
  drivers/staging/wilc1000/linux_wlan.c | 148 +-
  drivers/staging/wilc1000/linux_wlan_common.h  |   3 -
  drivers/staging/wilc1000/wilc_wfi_netdevice.h |  16 ---
  drivers/staging/wilc1000/wilc_wlan.c  |   3 -
  4 files changed, 2 insertions(+), 168 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 9be0282..7265f93 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -300,89 +300,31 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
  }
  #endif
  
-/*

- * Interrupt initialization and handling functions
- */
-
-void linux_wlan_enable_irq(void)
-{
-
-#if (RX_BH_TYPE != RX_BH_THREADED_IRQ)
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
-   PRINT_D(INT_DBG, "Enabling IRQ ...\n");
-   enable_irq(g_linux_wlan->dev_irq_num);
-#endif
-#endif
-}
-
-void linux_wlan_disable_irq(int wait)
-{
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
-   if (wait) {
-   PRINT_D(INT_DBG, "Disabling IRQ ...\n");
-   disable_irq(g_linux_wlan->dev_irq_num);
-   } else {
-   PRINT_D(INT_DBG, "Disabling IRQ ...\n");
-   disable_irq_nosync(g_linux_wlan->dev_irq_num);
-   }
-#endif
-}
-
  #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
  static irqreturn_t isr_uh_routine(int irq, void *user_data)
  {
-#if (RX_BH_TYPE != RX_BH_THREADED_IRQ)
-   linux_wlan_disable_irq(IRQ_NO_WAIT);
-#endif
PRINT_D(INT_DBG, "Interrupt received UH\n");
  
  	/*While mac is closing cacncel the handling of any interrupts received*/

if (g_linux_wlan->close) {
PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
-   #if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_HANDLED;
-   #else
-   return IRQ_NONE;
-   #endif
-
}
-#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
-   schedule_work(&g_linux_wlan->rx_work_queue);
-   return IRQ_HANDLED;
-#elif (RX_BH_TYPE == RX_BH_KTHREAD)
-   up(&g_linux_wlan->rx_sem);
-   return IRQ_HANDLED;
-#elif (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_WAKE_THREAD;
-#endif
  
  }

  #endif
  
-#if (RX_BH_TYPE == RX_BH_WORK_QUEUE || RX_BH_TYPE == RX_BH_THREADED_IRQ)

-
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
  irqreturn_t isr_bh_routine(int irq, void *userdata)
  {
linux_wlan_t *nic;
  
  	nic = (linux_wlan_t *)userdata;

-#else
-static void isr_bh_routine(struct work_struct *work)
-{
-   perInterface_wlan_t *nic;
-
-   nic = (perInterface_wlan_t *)container_of(work, linux_wlan_t, 
rx_work_queue);
-#endif
  
  	/*While mac is closing cacncel the handling of any interrupts received*/

if (g_linux_wlan->close) {
PRINT_ER("Driver is CLOSING: Can't handle BH interrupt\n");
-   #if (RX_BH_TYPE == RX_BH_THREADED_IRQ)
return IRQ_HANDLED;
-   #else
-   return;
-   #endif
}
  
  	PRINT_D(INT_DBG, "Interrupt received BH\n");

@@ -391,36 +333,8 @@ static void isr_bh_routine(struct work_struct *work)
else
PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
  
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)

return IRQ_HANDLED;
-#endif
-}
-#elif (RX_BH_TYPE == RX_BH_KTHREAD)
-static int isr_bh_routine(void *vp)
-{
-   linux_wlan_t *nic;
-
-   nic = (linux_wlan_t *)vp;
-
-   while (1) {
-   down(&nic->rx_sem);
-   if (g_linux_wlan->close) {
-
-   while (!kthread_should_stop())
-   schedule();
-
-   break;
-   }
-   PRINT_D(INT_DBG, "Interrupt received BH\n");
-   if (g_linux_wlan->oup.wlan_handle_rx_isr != 0)
-   g_linux_wlan->oup.wlan_handle_rx_isr();
-   else
-   PRINT_ER("wlan_handle_rx_isr() hasn't been 
initialized\n");
-   }
-
-   return 0;
  }
-#endif
  
  #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)

  static int init_irq(linux_wlan_t *p_nic)
@@ -446,17 +360,10 @@ static int init_irq(linux_wlan_t *p_nic)
PRINT_ER("could not obtain gpio for WILC_INTR\n");
}
  
-#if (RX_BH_TYPE == RX_BH_THREADED_IRQ)

if ((ret != -1) && (request_threaded_irq(nic->dev_irq_num, 
isr_uh_routine, isr_bh_routine,
  

[PATCH 0/7] remove wilc_errorsupport.h from the wilc driver

2015-09-14 Thread Tony Cho
This patch aims to remove the wilc_errorsupport.h which is unnecessary in the
wilc driver. This patch replaces the error types defined by wilc driver with
kernel generic error types and removes macros which handles the errors.

Leo Kim (7):
  staging: wilc1000: remove definition WILC_IS_ERR
  staging: wilc1000: remove definition WILC_NULLCHECK
  staging: wilc1000: remove definition WILC_ERRORCHECK
  staging: wilc1000: remove definition WILC_ERRORREPORT
  staging: wilc1000: remove definitions unused
  staging: wilc1000: replace wilc error types with kernel generic error
type.
  staging: wilc1000: remove wilc_errorsupport

 drivers/staging/wilc1000/coreconfigurator.c   |   30 +-
 drivers/staging/wilc1000/host_interface.c | 1166 +
 drivers/staging/wilc1000/linux_mon.c  |   14 +-
 drivers/staging/wilc1000/linux_wlan.c |2 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |   65 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |  112 +-
 drivers/staging/wilc1000/wilc_msgqueue.h  |1 -
 drivers/staging/wilc1000/wilc_oswrapper.h |3 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  133 ++-
 9 files changed, 643 insertions(+), 883 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_errorsupport.h

-- 
1.9.1

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


[PATCH 1/7] staging: wilc1000: remove definition WILC_IS_ERR

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch removes the definition WILC_IS_ERR which is not used anymore.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 6012ec4..8eb8150 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -37,10 +37,9 @@
 
 
 
-#define WILC_IS_ERR(__status__) (__status__ < WILC_SUCCESS)
 
 #define WILC_ERRORCHECK(__status__) do { \
-   if (WILC_IS_ERR(__status__)) { \
+   if (__status__ < WILC_SUCCESS) { \
PRINT_ER("PRINT_ER(%d)\n", __status__); \
goto ERRORHANDLER; \
} \
@@ -60,6 +59,6 @@
 
 #define WILC_CATCH(__status__) \
 ERRORHANDLER: \
-   if (WILC_IS_ERR(__status__)) \
+   if (__status__ < WILC_SUCCESS) \
 
 #endif
-- 
1.9.1

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


[PATCH 5/7] staging: wilc1000: remove definitions unused

2015-09-14 Thread Tony Cho
From: Leo Kim 

Remove the definitions which are not used anywhere.
- WILC_ALREADY_EXSIT
- WILC_EMPTY
- WILC_FULL
- WILC_CANCELED
- WILC_INVALID_FILE
- WILC_UNSUPPORTED_VERSION
- WILC_FILE_EOF

Remove the definition which is not used anymore.
- WILC_CATCH

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 99ded3d..054ed76 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -12,9 +12,6 @@
 
 #include "linux_wlan_common.h"
 
-/* Psitive Numbers to indicate sucess with special status */
-#define WILC_ALREADY_EXSIT (+100)/** The requested object already 
exists */
-
 /* Generic success will return 0 */
 #define WILC_SUCCESS   0   /** Generic success */
 
@@ -25,22 +22,8 @@
 #define WILC_INVALID_STATE -103 /** An API request would violate 
the Driver state machine (i.e. to start PID while not camped)*/
 #define WILC_BUFFER_OVERFLOW   -104 /** In copy operations if the 
copied data is larger than the allocated buffer*/
 #define WILC_NULL_PTR  -105 /** null pointer is passed or used 
*/
-#define WILC_EMPTY -107
-#define WILC_FULL  -108
 #define WILC_TIMEOUT   -109
-#define WILC_CANCELED  -110 /** The required operation have 
been canceled by the user*/
-#define WILC_INVALID_FILE  -112 /** The Loaded file is corruped or 
having an invalid format */
 #define WILC_NOT_FOUND -113 /** Cant find the file to load */
 #define WILC_NO_MEM-114
-#define WILC_UNSUPPORTED_VERSION   -115
-#define WILC_FILE_EOF  -116
-
-
-
-
-
-#define WILC_CATCH(__status__) \
-ERRORHANDLER: \
-   if (__status__ < WILC_SUCCESS) \
 
 #endif
-- 
1.9.1

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


[PATCH 4/7] staging: wilc1000: remove definition WILC_ERRORREPORT

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch removes the definition WILC_ERRORREPORT which is not used
anymore, and also replace PRINT_ER with printk error log.

The compiler complains the build warnings in some functions for WILC_CATCH and
ERRORHANDLER as unused definitions. So, this patch also removes WILC_CATCH and
ERRORHANDLER in some of functions.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/coreconfigurator.c   |   6 +-
 drivers/staging/wilc1000/host_interface.c | 919 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |   5 -
 drivers/staging/wilc1000/wilc_msgqueue.c  |  98 ++-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   9 +-
 5 files changed, 425 insertions(+), 612 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index e0a41c5..8389565 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -13,6 +13,7 @@
 /* File Includes */
 /*/
 #include "coreconfigurator.h"
+#include 
 /*/
 /* Constants */
 /*/
@@ -428,8 +429,8 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
 
/* Check whether the received message type is 'N' */
if ('N' != u8MsgType) {
-   PRINT_ER("Received Message format incorrect.\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   printk(KERN_ERR "%s : Received Message format incorrect.\n", 
__func__);
+   return -EFAULT;
}
 
/* Extract message ID */
@@ -525,7 +526,6 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
 
*ppstrNetworkInfo = pstrNetworkInfo;
 
-ERRORHANDLER:
return s32Error;
 }
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 273d547..86d1828 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -670,12 +670,8 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFSetChan *pst
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
-   PRINT_ER("Failed to set channel\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   printk(KERN_ERR "%s : Failed to set channel\n", __func__);
+   return -EINVAL;
}
 
return s32Error;
@@ -714,12 +710,8 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv 
*drvHandler,
 
 
if (s32Error) {
-   PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   printk(KERN_ERR "%s : Failed to set driver handler\n", 
__func__);
+   return -EINVAL;
}
 
return s32Error;
@@ -760,12 +752,8 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetOpe
 
 
if (s32Error) {
-   PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   printk(KERN_ERR "%s : Failed to set driver handler\n", 
__func__);
+   return -EINVAL;
}
 
return s32Error;
@@ -808,17 +796,12 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
host_int_get_ipaddress(drvHandler, firmwareIPAddress, idx);
 
if (s32Error) {
-   PRINT_D(HOSTINF_DBG, "Failed to set IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   printk(KERN_ERR "%s : Failed to set IP address\n", __func__);
+   return -EINVAL;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address set\n");
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
-
return s32Error;
 }
 
@@ -859,19 +842,14 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
host_int_setup_ipaddress(pstrWFIDrv, gs8SetIP[idx], idx);
 
if (s32Error != WILC_SUCCESS) {
-   PRINT_ER("Failed to get IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+   printk(KERN_ERR "%s : Failed to get IP address\n", __func__);
+   return -EINVAL;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = 
%d\n", idx);
   

[PATCH 3/7] staging: wilc1000: remove definition WILC_ERRORCHECK

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch removes the definition WILC_ERRORCHECK which is not used
anymore and replaces PRINT_ER with printk.

There are build warnings from some functions because WILC_CATCH definition is
not used. So, this patch also removes WILC_CATCH from the functions.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/host_interface.c |  3 ++-
 drivers/staging/wilc1000/wilc_errorsupport.h  |  7 ---
 drivers/staging/wilc1000/wilc_msgqueue.c  |  5 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 ---
 4 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 29491f6..273d547 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7250,7 +7250,8 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
 
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   printk(KERN_ERR "%s: %d\n", __func__, s32Error);
 
WILC_CATCH(s32Error)
{
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 42495d9..769cef0 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -38,13 +38,6 @@
 
 
 
-#define WILC_ERRORCHECK(__status__) do { \
-   if (__status__ < WILC_SUCCESS) { \
-   PRINT_ER("PRINT_ER(%d)\n", __status__); \
-   goto ERRORHANDLER; \
-   } \
-} while (0)
-
 #define WILC_ERRORREPORT(__status__, __err__) do { \
PRINT_ER("PRINT_ER(%d)\n", __err__); \
__status__ = __err__; \
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index f3d0d34..2f77e71 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -145,7 +145,10 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
} else {
/* other non-timeout scenarios */
-   WILC_ERRORCHECK(s32RetStatus);
+   if (s32RetStatus) {
+   printk(KERN_ERR "%s: %d\n", __func__, s32RetStatus);
+   return s32RetStatus;
+   }
 
if (pHandle->bExiting) {
WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a182bdb..7083c77 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3308,11 +3308,9 @@ static int stop_ap(struct wiphy *wiphy, struct 
net_device *dev)
 
s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
 
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   printk(KERN_ERR "%s: %d\n", __func__, s32Error);
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3378,12 +3376,10 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_add_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   printk(KERN_ERR "%s: %d\n", __func__, s32Error);
}
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3423,10 +3419,8 @@ static int del_station(struct wiphy *wiphy, struct 
net_device *dev,
 
s32Error = host_int_del_station(priv->hWILCWFIDrv, mac);
 
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   printk(KERN_ERR "%s: %d\n", __func__, s32Error);
}
return s32Error;
 }
@@ -3494,10 +3488,8 @@ static int change_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_edit_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   printk(KERN_ERR "%s: %d\n", __func__, s32Error);
}
return s32Error;
 }
-- 
1.9.1

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


[PATCH 2/7] staging: wilc1000: remove definition WILC_NULLCHECK

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch removes the definition WILC_NULLCHECK which is not used anymore.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/host_interface.c |  8 ++--
 drivers/staging/wilc1000/wilc_errorsupport.h  |  6 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |  9 +++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 ++-
 4 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 59a1a9d..29491f6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1,5 +1,6 @@
 #include "host_interface.h"
 #include "coreconfigurator.h"
+#include 
 
 extern s32 TransportInit(void);
 extern s32 TransportDeInit(void);
@@ -7291,7 +7292,8 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSta
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (rates == NULL)
+   return -ENOMEM;
 
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
@@ -7446,7 +7448,9 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (rates == NULL)
+   return -ENOMEM;
+
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
}
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 8eb8150..42495d9 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -51,12 +51,6 @@
goto ERRORHANDLER; \
 } while (0)
 
-#define  WILC_NULLCHECK(__status__, __ptr__)   do { \
-   if (__ptr__ == NULL) { \
-   WILC_ERRORREPORT(__status__, WILC_NULL_PTR); \
-   } \
-} while (0)
-
 #define WILC_CATCH(__status__) \
 ERRORHANDLER: \
if (__status__ < WILC_SUCCESS) \
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 41244ce..f3d0d34 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -1,6 +1,7 @@
 
 #include "wilc_msgqueue.h"
 #include 
+#include 
 
 /*!
  *  @authorsyounan
@@ -69,11 +70,15 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage);
+   if (pstrMessage == NULL)
+   return -ENOMEM;
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage->pvBuffer);
+   if (pstrMessage->pvBuffer == NULL) {
+   s32RetStatus = -ENOMEM;
+   goto ERRORHANDLER;
+   }
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
 
/* add it to the message queue */
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 068e648..a182bdb 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -15,7 +15,7 @@
 #ifdef WILC_SDIO
 #include "linux_wlan_sdio.h"/* tony : for set_wiphy_dev() */
 #endif
-
+#include 
 
 #define IS_MANAGMEMENT 0x100
 #define IS_MANAGMEMENT_CALLBACK0x080
@@ -382,7 +382,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
if (priv->bCfgScanning == true) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
-   WILC_NULLCHECK(s32Error, wiphy);
+
+   if (wiphy == NULL)
+   return;
+
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC
&&
s32)pstrNetworkInfo->s8rssi) * 100) < 0
@@ -396,7 +399,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
s32Freq = 
ieee80211_channel_to_frequency((s32)pstrNetworkInfo->u8channel, 
IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);
 
-   

[PATCH 7/7] staging: wilc1000: remove wilc_errorsupport

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch removes the file, wilc_errorsupport which is not used anymore.
Remove #include "wilc_errorsupport.h" from the source code.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 15 ---
 drivers/staging/wilc1000/wilc_msgqueue.h |  1 -
 drivers/staging/wilc1000/wilc_oswrapper.h|  3 ---
 3 files changed, 19 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_errorsupport.h

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
deleted file mode 100644
index b0babbd..000
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __WILC_ERRORSUPPORT_H__
-#define __WILC_ERRORSUPPORT_H__
-
-/*!
- *  @file  wilc_errorsupport.h
- *  @brief Error reporting and handling support
- *  @authorsyounan
- *  @sawilc_oswrapper.h top level OS wrapper file
- *  @date  10 Aug 2010
- *  @version   1.0
- */
-
-#include "linux_wlan_common.h"
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index fb26463..a3c0bba 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -11,7 +11,6 @@
  */
 
 #include "wilc_platform.h"
-#include "wilc_errorsupport.h"
 
 /*!
  *  @brief Creates a new Message queue
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h 
b/drivers/staging/wilc1000/wilc_oswrapper.h
index 68f6efe..9b5c23a 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -16,9 +16,6 @@
 /* Os Configuration File */
 #include "wilc_platform.h"
 
-/* Error reporting and handling support */
-#include "wilc_errorsupport.h"
-
 /* Message Queue */
 #include "wilc_msgqueue.h"
 
-- 
1.9.1

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


[PATCH 6/7] staging: wilc1000: replace wilc error types with kernel generic error type.

2015-09-14 Thread Tony Cho
From: Leo Kim 

This patch replaces the wilc error types with kernel generic error type.
- WILC_SUCCESS  0
- WILC_FAIL -EFAULT
- WILC_BUSY -EBUSY
- WILC_INVALID_ARGUMENT -EINVAL
- WILC_INVALID_STATE-EINVAL
- WILC_BUFFER_OVERFLOW  -EOVERFLOW
- WILC_NULL_PTR -EFAULT
- WILC_TIMEOUT  -ETIMEDOUT
- WILC_NOT_FOUND-ENOENT
- WILC_NO_MEM   -ENOMEM

After then removes all wilc error types.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/coreconfigurator.c   |  24 +--
 drivers/staging/wilc1000/host_interface.c | 238 +++---
 drivers/staging/wilc1000/linux_mon.c  |  14 +-
 drivers/staging/wilc1000/linux_wlan.c |   2 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |  14 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |   8 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  76 +++
 7 files changed, 181 insertions(+), 195 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 8389565..ccb5957 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -340,7 +340,7 @@ INLINE u16 get_asoc_id(u8 *data)
 
 s32 CoreConfiguratorInit(void)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");
 
@@ -415,7 +415,7 @@ u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
  */
 s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
tstrNetworkInfo *pstrNetworkInfo = NULL;
u8 u8MsgType = 0;
u8 u8MsgID = 0;
@@ -541,21 +541,21 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
  */
 s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrNetworkInfo != NULL) {
if (pstrNetworkInfo->pu8IEs != NULL) {
kfree(pstrNetworkInfo->pu8IEs);
pstrNetworkInfo->pu8IEs = NULL;
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
kfree(pstrNetworkInfo);
pstrNetworkInfo = NULL;
 
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
return s32Error;
@@ -575,7 +575,7 @@ s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
 s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
   tstrConnectRespInfo **ppstrConnectRespInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
tstrConnectRespInfo *pstrConnectRespInfo = NULL;
u16 u16AssocRespLen = 0;
u8 *pu8IEs = 0;
@@ -632,21 +632,21 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
  */
 s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrConnectRespInfo != NULL) {
if (pstrConnectRespInfo->pu8RespIEs != NULL) {
kfree(pstrConnectRespInfo->pu8RespIEs);
pstrConnectRespInfo->pu8RespIEs = NULL;
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
kfree(pstrConnectRespInfo);
pstrConnectRespInfo = NULL;
 
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
return s32Error;
@@ -657,7 +657,7 @@ s32 ParseSurveyResults(u8 
ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ
   wid_site_survey_reslts_s **ppstrSurveyResults,
   u32 *pu32SurveyResultsCount)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
wid_site_survey_reslts_s *pstrSurveyResults = NULL;
u32 u32SurveyResultsCount = 0;
u32 u32SurveyBytesLength = 0;
@@ -712,7 +712,7 @@ ERRORHANDLER:
 
 s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrSurveyResults != NULL) {
kfree(pstrSurveyResults);
@@ -734,7 +734,7 @@ s32 DeallocateSurveyResults(wid_site_survey_reslts_s 
*pstrSurveyResults)
 
 s32 CoreConfiguratorDeInit(void)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorDeInit()\n");
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 86d1828..a

Re: [PATCH] Staging: fbtft: Replace pr_info with dev_info

2015-09-14 Thread Shraddha Barke



On Tue, 15 Sep 2015, Shraddha Barke wrote:


Replace pr_info with dev_info when appropriate device structure
is present

Signed-off-by: Shraddha Barke 
---
drivers/staging/fbtft/fbtft_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index fa916e8..3f2c69c 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c


This patch is already sent by someone.I understood the concept of dev_* 
and pr_* calls though :)


thanks,

Shraddha



@@ -1222,7 +1222,7 @@ static int spi_device_found(struct device *dev, void 
*data)
{
struct spi_device *spi = container_of(dev, struct spi_device, dev);

-   pr_info(DRVNAME":  %s %s %dkHz %d bits mode=0x%02X\n",
+   dev_info(dev, DRVNAME":  %s %s %dkHz %d bits mode=0x%02X\n",
spi->modalias, dev_name(dev), spi->max_speed_hz/1000,
spi->bits_per_word, spi->mode);

@@ -1241,7 +1241,7 @@ static int p_device_found(struct device *dev, void *data)
*pdev = container_of(dev, struct platform_device, dev);

if (strstr(pdev->name, "fb"))
-   pr_info(DRVNAME":  %s id=%d pdata? %s\n",
+   dev_info(dev, DRVNAME":  %s id=%d pdata? %s\n",
pdev->name, pdev->id,
pdev->dev.platform_data ? "yes" : "no");

--
2.1.4



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


Re: [PATCH 1/4] Staging: rtl8192u: space required before open parentheses

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 08:48:04AM -0800, Mike Dupuis wrote:
> > In your previous patches this From: line was not there. Why now?
> 
> I did not do that by hand. I changed some SSMTP and git configuration
> settings recently-- perhaps that is related. If this is a problem, I will
> correct it.
The From: line is used by people who uses corporate mail servers
and they can not set what the From: in the email header will be. But
since you already had your git config configured so that will be more
preferred.

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


[PATCH 03/18] staging: wilc1000: rename WILC_WFI_priv

2015-09-14 Thread Chaehyun Lim
This patch replaces WILC_WFI_priv with wilc_priv to avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/linux_mon.c  |  2 +-
 drivers/staging/wilc1000/linux_wlan.c | 12 +--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 90 +++
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  2 +-
 4 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index d873877..6bee710 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -63,7 +63,7 @@ void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size)
 
PRINT_INFO(HOSTAPD_DBG, "In monitor interface receive function\n");
 
-   /*   struct WILC_WFI_priv *priv = netdev_priv(dev); */
+   /*   struct wilc_priv *priv = netdev_priv(dev); */
 
/*   priv = wiphy_priv(priv->dev->ieee80211_ptr->wiphy); */
 
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 2f609f0..e95db24 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -200,7 +200,7 @@ static int DebuggingThreadTask(void *vp)
 static int dev_state_ev_handler(struct notifier_block *this, unsigned long 
event, void *ptr)
 {
struct in_ifaddr *dev_iface = (struct in_ifaddr *)ptr;
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
struct net_device *dev;
u8 *pIP_Add_buff;
@@ -831,7 +831,7 @@ static int linux_wlan_init_test_config(struct net_device 
*dev, linux_wlan_t *p_n
unsigned char mac_add[] = {0x00, 0x80, 0xC2, 0x5E, 0xa2, 0xff};
 
/*BugID_5077*/
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
 
PRINT_D(TX_DBG, "Start configuring Firmware\n");
@@ -1629,7 +1629,7 @@ int mac_open(struct net_device *ndev)
unsigned char mac_add[ETH_ALEN] = {0};
int ret = 0;
int i = 0;
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
 
nic = netdev_priv(ndev);
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
@@ -1701,7 +1701,7 @@ static void wilc_set_multicast_list(struct net_device 
*dev)
 {
 
struct netdev_hw_addr *ha;
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
int i = 0;
 
@@ -1834,7 +1834,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 int mac_close(struct net_device *ndev)
 {
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
perInterface_wlan_t *nic;
tstrWILC_WFIDrv *pstrWFIDrv;
 
@@ -1902,7 +1902,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
s8 rssi;
u32 size = 0, length = 0;
perInterface_wlan_t *nic;
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
s32 s32Error = WILC_SUCCESS;
 
/* struct iwreq *wrq = (struct iwreq *) req;// tony moved to case 
SIOCSIWPRIV */
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 5941696..237be2b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -177,13 +177,13 @@ uint32_t get_rssi_avg(tstrNetworkInfo *pstrNetworkInfo)
 
 void refresh_scan(void *pUserVoid, uint8_t all, bool bDirectScan)
 {
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
struct wiphy *wiphy;
struct cfg80211_bss *bss = NULL;
int i;
int rssi = 0;
 
-   priv = (struct WILC_WFI_priv *)pUserVoid;
+   priv = (struct wilc_priv *)pUserVoid;
wiphy = priv->dev->ieee80211_ptr->wiphy;
 
for (i = 0; i < u32LastScannedNtwrksCountShadow; i++) {
@@ -371,14 +371,14 @@ void add_network_to_shadow(tstrNetworkInfo 
*pstrNetworkInfo, void *pUserVoid, vo
  */
 static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo 
*pstrNetworkInfo, void *pUserVoid, void *pJoinParams)
 {
-   struct WILC_WFI_priv *priv;
+   struct wilc_priv *priv;
struct wiphy *wiphy;
s32 s32Freq;
struct ieee80211_channel *channel;
s32 s32Error = WILC_SUCCESS;
struct cfg80211_bss *bss = NULL;
 
-   priv = (struct WILC_WFI_priv *)pUserVoid;
+   priv = (struct wilc_priv *)pUserVoid;
if (priv->bCfgScanning == true) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
@@ -499,7 +499,7 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
  *  @date  01 MAR 2012
  *  @version   1.0
  */
-int WILC_WFI_Set_PMKSA(u8 *bssid, struct WILC_WFI_priv *priv)
+int WILC_WFI_Set_PMKSA(u8 *bssid, struct wilc_priv *priv)
 {
u32 i;
s32 s32Error = WILC_

[PATCH 01/18] staging: wilc1000: remove duplicated include

2015-09-14 Thread Chaehyun Lim
wilc_wfi_cfgoperations.h and linux_wlan_common.h are included as
duplicated in linux_wlan.c.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/linux_wlan.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 63f44f8..2f609f0 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2,9 +2,6 @@
 #include "linux_wlan_common.h"
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
-#include "wilc_wfi_cfgoperations.h"
-
-#include "linux_wlan_common.h"
 
 #include 
 #include 
-- 
2.5.1

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


[PATCH 05/18] staging: wilc1000: use u16 instead of uint16_t

2015-09-14 Thread Chaehyun Lim
This patch replaces uint16_t with u16 that is preferred kernel type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_spi.c  |  2 +-
 drivers/staging/wilc1000/wilc_wlan.c | 12 ++--
 drivers/staging/wilc1000/wilc_wlan.h |  6 +++---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 18 +-
 drivers/staging/wilc1000/wilc_wlan_cfg.h |  8 
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index d600417..c31e17a 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -453,7 +453,7 @@ static int spi_cmd_complete(u8 cmd, uint32_t adr, u8 *b, 
uint32_t sz, u8 clockle
if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)
|| (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
int retry;
-   /* uint16_t crc1, crc2; */
+   /* u16 crc1, crc2; */
u8 crc[2];
/**
 * Data Respnose header
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index c287301..c76134a 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -285,9 +285,9 @@ struct Ack_session_info;
 struct Ack_session_info {
uint32_t Ack_seq_num;
uint32_t Bigger_Ack_num;
-   uint16_t src_port;
-   uint16_t dst_port;
-   uint16_t status;
+   u16 src_port;
+   u16 dst_port;
+   u16 status;
 };
 
 typedef struct {
@@ -1848,7 +1848,7 @@ static int wilc_wlan_cfg_set(int start, uint32_t wid, u8 
*buffer, uint32_t buffe
p->cfg_frame_offset = 0;
 
offset = p->cfg_frame_offset;
-   ret_size = p->cif_func.cfg_wid_set(p->cfg_frame.frame, offset, 
(uint16_t)wid, buffer, buffer_size);
+   ret_size = p->cif_func.cfg_wid_set(p->cfg_frame.frame, offset, 
(u16)wid, buffer, buffer_size);
offset += ret_size;
p->cfg_frame_offset = offset;
 
@@ -1887,7 +1887,7 @@ static int wilc_wlan_cfg_get(int start, uint32_t wid, int 
commit, uint32_t drvHa
p->cfg_frame_offset = 0;
 
offset = p->cfg_frame_offset;
-   ret_size = p->cif_func.cfg_wid_get(p->cfg_frame.frame, offset, 
(uint16_t)wid);
+   ret_size = p->cif_func.cfg_wid_get(p->cfg_frame.frame, offset, 
(u16)wid);
offset += ret_size;
p->cfg_frame_offset = offset;
 
@@ -1917,7 +1917,7 @@ static int wilc_wlan_cfg_get_val(uint32_t wid, u8 
*buffer, uint32_t buffer_size)
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int ret;
 
-   ret = p->cif_func.cfg_wid_get_val((uint16_t)wid, buffer, buffer_size);
+   ret = p->cif_func.cfg_wid_get_val((u16)wid, buffer, buffer_size);
 
return ret;
 }
diff --git a/drivers/staging/wilc1000/wilc_wlan.h 
b/drivers/staging/wilc1000/wilc_wlan.h
index d7fd07b..0f26c13 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -304,9 +304,9 @@ typedef struct {
 } wilc_cfg_rsp_t;
 
 typedef struct {
-   int (*cfg_wid_set)(u8 *, uint32_t, uint16_t, u8 *, int);
-   int (*cfg_wid_get)(u8 *, uint32_t, uint16_t);
-   int (*cfg_wid_get_val)(uint16_t, u8 *, uint32_t);
+   int (*cfg_wid_set)(u8 *, uint32_t, u16, u8 *, int);
+   int (*cfg_wid_get)(u8 *, uint32_t, u16);
+   int (*cfg_wid_get_val)(u16, u8 *, uint32_t);
int (*rx_indicate)(u8 *, int, wilc_cfg_rsp_t *);
int (*cfg_init)(wilc_debug_func);
 } wilc_cfg_func_t;
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 8223b5f..f5bbbe8 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -160,7 +160,7 @@ static wilc_cfg_str_t g_cfg_str[] = {
  *
  /
 
-static int wilc_wlan_cfg_set_byte(u8 *frame, uint32_t offset, uint16_t id, u8 
val8)
+static int wilc_wlan_cfg_set_byte(u8 *frame, uint32_t offset, u16 id, u8 val8)
 {
u8 *buf;
 
@@ -176,7 +176,7 @@ static int wilc_wlan_cfg_set_byte(u8 *frame, uint32_t 
offset, uint16_t id, u8 va
return 4;
 }
 
-static int wilc_wlan_cfg_set_hword(u8 *frame, uint32_t offset, uint16_t id, 
uint16_t val16)
+static int wilc_wlan_cfg_set_hword(u8 *frame, uint32_t offset, u16 id, u16 
val16)
 {
u8 *buf;
 
@@ -194,7 +194,7 @@ static int wilc_wlan_cfg_set_hword(u8 *frame, uint32_t 
offset, uint16_t id, uint
return 5;
 }
 
-static int wilc_wlan_cfg_set_word(u8 *frame, uint32_t offset, uint16_t id, 
uint32_t val32)
+static int wilc_wlan_cfg_set_word(u8 *frame, uint32_t offset, u16 id, uint32_t 
val32)
 {
u8 *buf;
 
@@ -214,7 +214,7 @@ static int wilc_wlan_cfg_set_word(u8 *frame, uint32_t 
offset, uint16_t id, uint3
return 7;
 }
 
-static int wilc_wlan_cfg_set_str(u8 *frame, uint32_t offset, uint16_t id, u8 
*str, uint32_t size)
+static int wilc_wlan_cfg_

[PATCH 04/18] staging: wilc1000: use u8 instead of uint8_t

2015-09-14 Thread Chaehyun Lim
This patch replaces uint8_t with u8 that is a preferred kernel type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c |   2 +-
 drivers/staging/wilc1000/linux_mon.c  |   2 +-
 drivers/staging/wilc1000/linux_wlan.c |  30 ++--
 drivers/staging/wilc1000/linux_wlan_spi.c |   4 +-
 drivers/staging/wilc1000/linux_wlan_spi.h |   4 +-
 drivers/staging/wilc1000/wilc_sdio.c  |  24 +--
 drivers/staging/wilc1000/wilc_spi.c   | 178 +++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  14 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |   2 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  10 +-
 drivers/staging/wilc1000/wilc_wlan.c  |  58 +++
 drivers/staging/wilc1000/wilc_wlan.h  |  32 ++--
 drivers/staging/wilc1000/wilc_wlan_cfg.c  | 118 +++---
 drivers/staging/wilc1000/wilc_wlan_cfg.h  |   2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   |  26 ++--
 15 files changed, 253 insertions(+), 253 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 59a1a9d..3bab93c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7460,7 +7460,7 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
return s32Error;
 }
 #endif /*WILC_AP_EXTERNAL_MLME*/
-uint32_t wilc_get_chipid(uint8_t);
+uint32_t wilc_get_chipid(u8);
 
 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 
u32Timeout)
 {
diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 6bee710..a38d293 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -54,7 +54,7 @@ u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 #define IS_MGMT_STATUS_SUCCES  0x040
 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
 
-void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size)
+void WILC_WFI_monitor_rx(u8 *buff, uint32_t size)
 {
uint32_t header, pkt_offset;
struct sk_buff *skb = NULL;
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index e95db24..f3036eb 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -110,11 +110,11 @@ static struct semaphore close_exit_sync;
 
 static int wlan_deinit_locks(linux_wlan_t *nic);
 static void wlan_deinitialize_threads(linux_wlan_t *nic);
-extern void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
-extern void WILC_WFI_p2p_rx(struct net_device *dev, uint8_t *buff, uint32_t 
size);
+extern void WILC_WFI_monitor_rx(u8 *buff, uint32_t size);
+extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, uint32_t size);
 
 static void linux_wlan_tx_complete(void *priv, int status);
-void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset);
+void frmw_to_linux(u8 *buff, uint32_t size, uint32_t pkt_offset);
 static int  mac_init_fn(struct net_device *ndev);
 int  mac_xmit(struct sk_buff *skb, struct net_device *dev);
 int  mac_open(struct net_device *ndev);
@@ -485,7 +485,7 @@ static void deinit_irq(linux_wlan_t *nic)
 /*
  *  OS functions
  */
-static void linux_wlan_dbg(uint8_t *buff)
+static void linux_wlan_dbg(u8 *buff)
 {
PRINT_D(INIT_DBG, "%d\n", *buff);
 }
@@ -529,9 +529,9 @@ static void linux_wlan_mac_indicate(int flag)
 
 }
 
-struct net_device *GetIfHandler(uint8_t *pMacHeader)
+struct net_device *GetIfHandler(u8 *pMacHeader)
 {
-   uint8_t *Bssid, *Bssid1;
+   u8 *Bssid, *Bssid1;
int i = 0;
 
Bssid  = pMacHeader + 10;
@@ -559,7 +559,7 @@ struct net_device *GetIfHandler(uint8_t *pMacHeader)
return NULL;
 }
 
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, uint8_t *pBSSID)
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
 {
int i = 0;
int ret = -1;
@@ -580,9 +580,9 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, 
uint8_t *pBSSID)
 /*Function to get number of connected interfaces*/
 int linux_wlan_get_num_conn_ifcs(void)
 {
-   uint8_t i = 0;
-   uint8_t null_bssid[6] = {0};
-   uint8_t ret_val = 0;
+   u8 i = 0;
+   u8 null_bssid[6] = {0};
+   u8 ret_val = 0;
 
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
if (memcmp(g_linux_wlan->strInterfaceInfo[i].aBSSID, 
null_bssid, 6))
@@ -1380,13 +1380,13 @@ static void wlan_deinitialize_threads(linux_wlan_t *nic)
 #ifdef COMPLEMENT_BOOT
 
 extern volatile int probe;
-extern uint8_t core_11b_ready(void);
+extern u8 core_11b_ready(void);
 
 #define READY_CHECK_THRESHOLD  30
 extern void wilc_wlan_global_reset(void);
-uint8_t wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi,wilc_wlan_oup_t 
*nwo, linux_wlan_t *nic)
+u8 wilc1000_prepare_11b_core(wilc_wlan_inp_t *nw

[PATCH 02/18] staging: wilc1000: rename WILC_WFI_cfg80211_ops

2015-09-14 Thread Chaehyun Lim
This patch replaces WILC_WFI_cfg80211_ops with wilc_cfg80211_ops to
avoid CamelCase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 068e648..5941696 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3556,7 +3556,7 @@ int del_virtual_intf(struct wiphy *wiphy, struct 
wireless_dev *wdev)  /* ton
 
 
 #endif /*WILC_AP_EXTERNAL_MLME*/
-static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
+static struct cfg80211_ops wilc_cfg80211_ops = {
 
.set_monitor_channel = set_channel,
.scan = scan,
@@ -3669,7 +3669,7 @@ struct wireless_dev *WILC_WFI_CfgAlloc(void)
}
 
/*Creating a new wiphy, linking wireless structure with the wiphy 
structure*/
-   wdev->wiphy = wiphy_new(&WILC_WFI_cfg80211_ops, sizeof(struct 
WILC_WFI_priv));
+   wdev->wiphy = wiphy_new(&wilc_cfg80211_ops, sizeof(struct 
WILC_WFI_priv));
if (!wdev->wiphy) {
PRINT_ER("Cannot allocate wiphy\n");
goto _fail_mem_;
-- 
2.5.1

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


[PATCH 10/18] staging: wilc1000: remove bit shift macro that is custom defined

2015-09-14 Thread Chaehyun Lim
This patch remove bit shift macro that is custom defined, then it is
replaced BIT(x) macro.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index dfc210a..a4321a4 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -19,10 +19,6 @@
 
 #define IP_ALEN  4
 
-#define BIT2((u32)(1 << 2))
-#define BIT1((u32)(1 << 1))
-#define BIT0((u32)(1 << 0))
-
 #define IDLE_MODE  0x00
 #define AP_MODE0x01
 #define STATION_MODE   0x02
@@ -36,9 +32,9 @@
 #define MIN_SCAN_TIME  10
 #define MAX_SCAN_TIME  1200
 #define DEFAULT_SCAN   0
-#define USER_SCAN  BIT0
-#define OBSS_PERIODIC_SCAN BIT1
-#define OBSS_ONETIME_SCAN  BIT2
+#define USER_SCAN  BIT(0)
+#define OBSS_PERIODIC_SCAN BIT(1)
+#define OBSS_ONETIME_SCAN  BIT(2)
 #define GTK_RX_KEY_BUFF_LEN24
 #define ADDKEY 0x1
 #define REMOVEKEY  0x2
-- 
2.5.1

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


[PATCH 07/18] staging: wilc1000: remove commented codes

2015-09-14 Thread Chaehyun Lim
This patch removes commented codes.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 13 ---
 drivers/staging/wilc1000/linux_mon.c  | 59 ---
 drivers/staging/wilc1000/wilc_sdio.c  |  2 --
 drivers/staging/wilc1000/wilc_spi.c   |  4 ---
 4 files changed, 78 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index a107377..dfc210a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -65,14 +65,6 @@
 #define WILC_ADD_STA_LENGTH40 /* Not including the rates field cause it 
has variable length*/
 #define SCAN_EVENT_DONE_ABORTED
 #define NUM_CONCURRENT_IFC 2
-/*/
-/* Data Types*/
-/*/
-/* typedef unsigned char   uint8; */
-/* typedef signed char int8; */
-/* typedef unsigned short  uint16; */
-/* typedef unsigned long   uint32; */
-/* typedef uint32   Bool; */
 
 typedef struct {
u16 cfg_wid;
@@ -192,7 +184,6 @@ typedef enum {
 typedef enum {
WEP,
WPARxGtk,
-   /* WPATxGtk, */
WPAPtk,
PMKSA,
 } tenuKeyType;
@@ -350,8 +341,6 @@ typedef struct {
 
tenuHostIFstate enuHostIFstate;
 
-   /* bool bPendingConnRequest; */
-
#ifndef CONNECT_DIRECT
u32 u32SurveyResultsCount;
wid_site_survey_reslts_s astrSurveyResults[MAX_NUM_SCANNED_NETWORKS];
@@ -414,8 +403,6 @@ typedef struct {
u16 u16FlagsSet;/*dev->ieee80211_ptr->wiphy); */
-
/* Bug 4601 */
if (wilc_wfi_mon == NULL)
return;
@@ -124,30 +118,19 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
return;
}
 
-   /* skb = skb_copy_expand(tx_skb, sizeof(*hdr), 0, GFP_ATOMIC); 
*/
-   /* if (skb == NULL) */
-   /*  return; */
-
memcpy(skb_put(skb, size), buff, size);
hdr = (struct wilc_wfi_radiotap_hdr *) skb_push(skb, 
sizeof(*hdr));
memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
-   /* hdr->hdr.it_pad = 0; */
hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
wilc_wfi_radiotap_hdr));
PRINT_INFO(HOSTAPD_DBG, "Radiotap len %d\n", hdr->hdr.it_len);
hdr->hdr.it_present = cpu_to_le32
(1 << IEEE80211_RADIOTAP_RATE); 
  /* | */
-   /* (1 << IEEE80211_RADIOTAP_CHANNEL)); */
PRINT_INFO(HOSTAPD_DBG, "Presentflags %d\n", 
hdr->hdr.it_present);
hdr->rate = 5; /* txrate->bitrate / 5; */
 
}
 
-/* if(INFO || if(skb->data[9] == 0x00 || skb->data[9] == 0xb0))
- *  {
- *  for(i=0;ilen;i++)
- *  PRINT_INFO(HOSTAPD_DBG,"Mon RxData[%d] = 
%02x\n",i,skb->data[i]);
- *  }*/
 
 
skb->dev = wilc_wfi_mon;
@@ -170,9 +153,6 @@ struct tx_complete_mon_data {
 static void mgmt_tx_complete(void *priv, int status)
 {
 
-   /* struct sk_buff *skb2; */
-   /* struct wilc_wfi_radiotap_cb_hdr *cb_hdr; */
-
struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data 
*)priv;
u8 *buf =  pv_data->buff;
 
@@ -186,35 +166,6 @@ static void mgmt_tx_complete(void *priv, int status)
}
 
 
-/* //(skb->data[9] == 0x00 || skb->data[9] == 0xb0 || 
skb->data[9] == 0x40 ||  skb->data[9] == 0xd0 )
- *  {
- *  skb2 = dev_alloc_skb(pv_data->size+sizeof(struct 
wilc_wfi_radiotap_cb_hdr));
- *
- *  memcpy(skb_put(skb2,pv_data->size),pv_data->buff, 
pv_data->size);
- *
- *  cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *) skb_push(skb2, 
sizeof(*cb_hdr));
- *  memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
- *
- *   cb_hdr->hdr.it_version = 0;//PKTHDR_RADIOTAP_VERSION;
- *
- *  cb_hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
wilc_wfi_radiotap_cb_hdr));
- *
- *   cb_hdr->hdr.it_present = cpu_to_le32(
- *(1 << IEEE80211_RADIOTAP_RATE) |
- *   (1 << IEEE80211_RADIOTAP_TX_FLAGS));
- *
- *  cb_hdr->rate = 5;//txrate->bitrate / 5;
- *  cb_hdr->tx_flags = 0x0004;
- *
- *  skb2->dev = wilc_wfi_mon;
- *  skb_set_mac_header(skb2, 0);
- *  skb2->ip_summed = CHECKSUM_UNNECESSARY;
- *  skb2->pkt_type = PACKET_OTHERHOST;
- *  skb2->protocol = htons(ETH_P_802_2);
- *  memset(skb2->cb, 0, sizeof(skb2->cb));
- *
- *  netif_rx(skb2);
- *  }*/
 
/* incase of fu

[PATCH 08/18] staging: wilc1000: remove useless extern declarations

2015-09-14 Thread Chaehyun Lim
This patch removes useless extern declarations. This function is not
existed in the driver.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 59327aa..960950c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1,8 +1,6 @@
 #include "host_interface.h"
 #include "coreconfigurator.h"
 
-extern s32 TransportInit(void);
-extern s32 TransportDeInit(void);
 extern u8 connecting;
 
 #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
-- 
2.5.1

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


[PATCH 18/18] staging: wilc1000: wilc_wfi_cfgoperations.h: align defines

2015-09-14 Thread Chaehyun Lim
This patch fix alignment of some defines in wilc_wfi_cfgoperations.h

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 44 +++
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 28858da..5fd0757 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -23,34 +23,34 @@
 #ifdef WILC_P2P
 
 /*Public action frame index IDs*/
-#defineFRAME_TYPE_ID   0
-#defineACTION_CAT_ID   24
-#defineACTION_SUBTYPE_ID   25
-#defineP2P_PUB_ACTION_SUBTYPE  30
+#define FRAME_TYPE_ID  0
+#define ACTION_CAT_ID  24
+#define ACTION_SUBTYPE_ID  25
+#define P2P_PUB_ACTION_SUBTYPE 30
 
 /*Public action frame Attribute IDs*/
-#defineACTION_FRAME0xd0
-#defineGO_INTENT_ATTR_ID   0x04
-#defineCHANLIST_ATTR_ID0x0b
-#defineOPERCHAN_ATTR_ID0x11
-#definePUB_ACTION_ATTR_ID  0x04
-#defineP2PELEM_ATTR_ID 0xdd
+#define ACTION_FRAME   0xd0
+#define GO_INTENT_ATTR_ID  0x04
+#define CHANLIST_ATTR_ID   0x0b
+#define OPERCHAN_ATTR_ID   0x11
+#define PUB_ACTION_ATTR_ID 0x04
+#define P2PELEM_ATTR_ID0xdd
 
 /*Public action subtype values*/
-#defineGO_NEG_REQ  0x00
-#defineGO_NEG_RSP  0x01
-#defineGO_NEG_CONF 0x02
-#defineP2P_INV_REQ 0x03
-#defineP2P_INV_RSP 0x04
-#definePUBLIC_ACT_VENDORSPEC   0x09
-#defineGAS_INTIAL_REQ  0x0a
-#defineGAS_INTIAL_RSP  0x0b
+#define GO_NEG_REQ 0x00
+#define GO_NEG_RSP 0x01
+#define GO_NEG_CONF0x02
+#define P2P_INV_REQ0x03
+#define P2P_INV_RSP0x04
+#define PUBLIC_ACT_VENDORSPEC  0x09
+#define GAS_INTIAL_REQ 0x0a
+#define GAS_INTIAL_RSP 0x0b
 
-#defineINVALID_CHANNEL 0
+#define INVALID_CHANNEL0
 #endif
 
 #define nl80211_SCAN_RESULT_EXPIRE (3 * HZ)
-#define SCAN_RESULT_EXPIRE (40 * HZ)
+#define SCAN_RESULT_EXPIRE (40 * HZ)
 
 static const u32 cipher_suites[] = {
WLAN_CIPHER_SUITE_WEP40,
@@ -105,8 +105,8 @@ int WILC_WFI_deinit_mon_interface(void);
 struct net_device *WILC_WFI_init_mon_interface(const char *name, struct 
net_device *real_dev);
 
 #ifdef TCP_ENHANCEMENTS
-#define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
-#define DEFAULT_LINK_SPEED 72
+#define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
+#define DEFAULT_LINK_SPEED 72
 void Enable_TCP_ACK_Filter(bool value);
 #endif
 
-- 
2.5.1

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


[PATCH 16/18] staging: wilc1000: remove FORCE_P2P_CLIENT

2015-09-14 Thread Chaehyun Lim
This patch removes FORCE_P2P_CLIENT that is commented.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 15510f2..28858da 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -47,7 +47,6 @@
 #defineGAS_INTIAL_RSP  0x0b
 
 #defineINVALID_CHANNEL 0
-/* #define FORCE_P2P_CLIENT */
 #endif
 
 #define nl80211_SCAN_RESULT_EXPIRE (3 * HZ)
-- 
2.5.1

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


Re: [PATCH] Staging: lustre: lustre: lclient: lcommon_cl.c: Fixed coding style error

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 02:53:11PM +0530, Sakshi Vaid wrote:
> Fixed the following error.
> WARNING: More than 80 characters in a line.
> 
> Signed-off-by: Sakshi Vaid 
> ---
This has already been done by 159dc4bff27a ("staging: lustre: lclient:
remove extra parentheses around right bit shift operation")
Which tree you are using?

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


[PATCH 09/18] staging: wilc1000: use BIT macro

2015-09-14 Thread Chaehyun Lim
This patch replaces bit shift with BIT(x) macro.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 51f9413..edf5ec0 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -11,14 +11,14 @@
 #include "wilc_wfi_netdevice.h"
 
 /* The following macros describe the bitfield map used by the firmware to 
determine its 11i mode */
-#define NO_ENCRYPT 0
-#define ENCRYPT_ENABLED(1 << 0)
-#define WEP(1 << 1)
-#define WEP_EXTENDED   (1 << 2)
-#define WPA(1 << 3)
-#define WPA2   (1 << 4)
-#define AES(1 << 5)
-#define TKIP   (1 << 6)
+#define NO_ENCRYPT 0
+#define ENCRYPT_ENABLEDBIT(0)
+#define WEPBIT(1)
+#define WEP_EXTENDED   BIT(2)
+#define WPABIT(3)
+#define WPA2   BIT(4)
+#define AESBIT(5)
+#define TKIP   BIT(6)
 
 #ifdef WILC_P2P
 /* #define USE_SUPPLICANT_GO_INTENT */
-- 
2.5.1

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


[PATCH 14/18] staging: wilc1000: remove USE_SUPPLICANT_GO_INTENT

2015-09-14 Thread Chaehyun Lim
This patch removes USE_SUPPLICANT_GO_INTENT macro that is commented.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index edf5ec0..aac9e3f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -21,7 +21,6 @@
 #define TKIP   BIT(6)
 
 #ifdef WILC_P2P
-/* #define USE_SUPPLICANT_GO_INTENT */
 
 /*Public action frame index IDs*/
 #defineFRAME_TYPE_ID   0
-- 
2.5.1

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


[PATCH 17/18] staging: wilc1000: remove if defined codes of FORCE_P2P_CLIENT

2015-09-14 Thread Chaehyun Lim
This patch removes if defined codes of FORCE_P2P_CLIENT.
This macro is deleted because it it commented out.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c3e0892..3ecf5b1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2028,11 +2028,7 @@ void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
 
while (index < len) {
if (buf[index] == GO_INTENT_ATTR_ID) {
-   #ifdef FORCE_P2P_CLIENT
-   buf[index + 3] = (buf[index + 3]  & 0x01) | (0x0f << 1);
-   #else
buf[index + 3] = (buf[index + 3]  & 0x01) | (0x00 << 1);
-   #endif
}
 
if (buf[index] ==  CHANLIST_ATTR_ID)
@@ -2085,11 +2081,7 @@ void WILC_WFI_CfgParseTxAction(u8 *buf, u32 len, bool 
bOperChan, u8 iftype)
 
while (index < len) {
if (buf[index] == GO_INTENT_ATTR_ID) {
-   #ifdef FORCE_P2P_CLIENT
-   buf[index + 3] = (buf[index + 3]  & 0x01) | (0x00 << 1);
-   #else
buf[index + 3] = (buf[index + 3]  & 0x01) | (0x0f << 1);
-   #endif
 
break;
}
-- 
2.5.1

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


[PATCH 12/18] staging: wilc1000: fix alignment of defines

2015-09-14 Thread Chaehyun Lim
This patch fix alignment of defines.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 42 +++
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index f15a878..64bcd80 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -20,11 +20,11 @@
 #define IDLE_MODE  0x00
 #define AP_MODE0x01
 #define STATION_MODE   0x02
-#define GO_MODE0x03
+#define GO_MODE0x03
 #define CLIENT_MODE0x04
 
 
-#define MAX_NUM_STA 9
+#define MAX_NUM_STA9
 #define ACTIVE_SCAN_TIME   10
 #define PASSIVE_SCAN_TIME  1200
 #define MIN_SCAN_TIME  10
@@ -34,31 +34,31 @@
 #define OBSS_PERIODIC_SCAN BIT(1)
 #define OBSS_ONETIME_SCAN  BIT(2)
 #define GTK_RX_KEY_BUFF_LEN24
-#define ADDKEY 0x1
-#define REMOVEKEY  0x2
-#define DEFAULTKEY 0x4
-#define ADDKEY_AP  0x8
-#define MAX_NUM_SCANNED_NETWORKS   100 /* 30   // rachel */
-#define MAX_NUM_SCANNED_NETWORKS_SHADOW130
-#define MAX_NUM_PROBED_SSID10  /*One more than the number of 
scanned ssids*/
+#define ADDKEY 0x1
+#define REMOVEKEY  0x2
+#define DEFAULTKEY 0x4
+#define ADDKEY_AP  0x8
+#define MAX_NUM_SCANNED_NETWORKS   100 /* 30   // 
rachel */
+#define MAX_NUM_SCANNED_NETWORKS_SHADOW130
+#define MAX_NUM_PROBED_SSID10  /*One more than the number 
of scanned ssids*/
 #define CHANNEL_SCAN_TIME  250 /* 250 */
 
 #define TX_MIC_KEY_LEN 8
 #define RX_MIC_KEY_LEN 8
-#define PTK_KEY_LEN16
+#define PTK_KEY_LEN16
 
 #define TX_MIC_KEY_MSG_LEN 26
 #define RX_MIC_KEY_MSG_LEN 48
 #define PTK_KEY_MSG_LEN39
 
 #define PMKSA_KEY_LEN  22
-#define ETH_ALEN  6
-#define PMKID_LEN  16
-#define WILC_MAX_NUM_PMKIDS  16
-#define WILC_SUPP_MCS_SET_SIZE 16
-#define WILC_ADD_STA_LENGTH40 /* Not including the rates field cause it 
has variable length*/
+#define ETH_ALEN   6
+#define PMKID_LEN  16
+#define WILC_MAX_NUM_PMKIDS16
+#define WILC_SUPP_MCS_SET_SIZE 16
+#define WILC_ADD_STA_LENGTH40 /* Not including the rates 
field cause it has variable length*/
 #define SCAN_EVENT_DONE_ABORTED
-#define NUM_CONCURRENT_IFC 2
+#define NUM_CONCURRENT_IFC 2
 
 typedef struct {
u16 cfg_wid;
@@ -304,11 +304,11 @@ typedef struct {
 } tstrHostIfRegisterFrame;
 
 
-#define   ACTION 0xD0
-#define   PROBE_REQ   0x40
-#define   PROBE_RESP  0x50
-#define   ACTION_FRM_IDX   0
-#define   PROBE_REQ_IDX 1
+#define ACTION 0xD0
+#define PROBE_REQ  0x40
+#define PROBE_RESP 0x50
+#define ACTION_FRM_IDX 0
+#define PROBE_REQ_IDX  1
 
 
 enum p2p_listen_state {
-- 
2.5.1

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


[PATCH 11/18] staging: wilc1000: remove unused defines

2015-09-14 Thread Chaehyun Lim
The macros are not used anywhere in this driver, so just delete it.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index a4321a4..f15a878 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -14,8 +14,6 @@
 /*/
 /* Macros  
 */
 /*/
-#define FAIL   0x
-#define SUCCESS0x0001
 
 #define IP_ALEN  4
 
-- 
2.5.1

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


[PATCH 13/18] staging: wilc1000: fix alignment of enum

2015-09-14 Thread Chaehyun Lim
This patch fix alignment of enum.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 76 +++
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 64bcd80..e3e4b06 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -77,13 +77,13 @@ typedef struct _tstrStatistics {
 
 
 typedef enum {
-   HOST_IF_IDLE= 0,
-   HOST_IF_SCANNING= 1,
-   HOST_IF_CONNECTING  = 2,
-   HOST_IF_WAITING_CONN_RESP   = 3,
-   HOST_IF_CONNECTED   = 4,
-   HOST_IF_P2P_LISTEN  = 5,
-   HOST_IF_FORCE_32BIT = 0x
+   HOST_IF_IDLE= 0,
+   HOST_IF_SCANNING= 1,
+   HOST_IF_CONNECTING  = 2,
+   HOST_IF_WAITING_CONN_RESP   = 3,
+   HOST_IF_CONNECTED   = 4,
+   HOST_IF_P2P_LISTEN  = 5,
+   HOST_IF_FORCE_32BIT = 0x
 } tenuHostIFstate;
 
 typedef struct _tstrHostIFpmkid {
@@ -97,19 +97,19 @@ typedef struct _tstrHostIFpmkidAttr {
 } tstrHostIFpmkidAttr;
 
 typedef enum {
-   AUTORATE = 0,
-   MBPS_1   = 1,
-   MBPS_2   = 2,
-   MBPS_5_5 = 5,
-   MBPS_11  = 11,
-   MBPS_6   = 6,
-   MBPS_9   = 9,
-   MBPS_12  = 12,
-   MBPS_18  = 18,
-   MBPS_24  = 24,
-   MBPS_36  = 36,
-   MBPS_48  = 48,
-   MBPS_54  = 54
+   AUTORATE= 0,
+   MBPS_1  = 1,
+   MBPS_2  = 2,
+   MBPS_5_5= 5,
+   MBPS_11 = 11,
+   MBPS_6  = 6,
+   MBPS_9  = 9,
+   MBPS_12 = 12,
+   MBPS_18 = 18,
+   MBPS_24 = 24,
+   MBPS_36 = 36,
+   MBPS_48 = 48,
+   MBPS_54 = 54
 } CURRENT_TX_RATE_T;
 
 typedef struct {
@@ -140,23 +140,23 @@ typedef struct {
 typedef enum {
RETRY_SHORT = 1 << 0,
RETRY_LONG  = 1 << 1,
-   FRAG_THRESHOLD  = 1 << 2,
-   RTS_THRESHOLD   = 1 << 3,
-   BSS_TYPE  = 1 << 4,
-   AUTH_TYPE = 1 << 5,
-   AUTHEN_TIMEOUT = 1 << 6,
-   POWER_MANAGEMENT = 1 << 7,
-   PREAMBLE = 1 << 8,
-   SHORT_SLOT_ALLOWED = 1 << 9,
-   TXOP_PROT_DISABLE = 1 << 10,
-   BEACON_INTERVAL = 1 << 11,
-   DTIM_PERIOD = 1 << 12,
-   SITE_SURVEY = 1 << 13,
-   SITE_SURVEY_SCAN_TIME = 1 << 14,
-   ACTIVE_SCANTIME = 1 << 15,
-   PASSIVE_SCANTIME = 1 << 16,
-   CURRENT_TX_RATE = 1 << 17,
-   HT_ENABLE = 1 << 18,
+   FRAG_THRESHOLD  = 1 << 2,
+   RTS_THRESHOLD   = 1 << 3,
+   BSS_TYPE= 1 << 4,
+   AUTH_TYPE   = 1 << 5,
+   AUTHEN_TIMEOUT  = 1 << 6,
+   POWER_MANAGEMENT= 1 << 7,
+   PREAMBLE= 1 << 8,
+   SHORT_SLOT_ALLOWED  = 1 << 9,
+   TXOP_PROT_DISABLE   = 1 << 10,
+   BEACON_INTERVAL = 1 << 11,
+   DTIM_PERIOD = 1 << 12,
+   SITE_SURVEY = 1 << 13,
+   SITE_SURVEY_SCAN_TIME   = 1 << 14,
+   ACTIVE_SCANTIME = 1 << 15,
+   PASSIVE_SCANTIME= 1 << 16,
+   CURRENT_TX_RATE = 1 << 17,
+   HT_ENABLE   = 1 << 18,
 } tenuCfgParam;
 
 typedef struct {
@@ -172,7 +172,7 @@ typedef enum {SCAN_EVENT_NETWORK_FOUND  = 0,
 typedef enum {
CONN_DISCONN_EVENT_CONN_RESP= 0,
CONN_DISCONN_EVENT_DISCONN_NOTIF= 1,
-   CONN_DISCONN_EVENT_FORCE_32BIT   = 0x
+   CONN_DISCONN_EVENT_FORCE_32BIT  = 0x
 } tenuConnDisconnEvent;
 
 typedef enum {
-- 
2.5.1

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


[PATCH 15/18] staging: wilc1000: remove if defined codes of USE_SUPPLICANT_GO_INTENT

2015-09-14 Thread Chaehyun Lim
This patch removes if defined codes of USE_SUPPLICANT_GO_INTENT.
This macro is deleted because it is commented out.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 66 ---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |  9 
 2 files changed, 75 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 2671cdf..c3e0892 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2023,51 +2023,18 @@ void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
u32 i = 0, j = 0;
 
/*BugID_5460*/
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   u8 intent;
-   u8 tie_breaker;
-   bool is_wilc_go = true;
-   #endif
u8 op_channel_attr_index = 0;
u8 channel_list_attr_index = 0;
 
while (index < len) {
if (buf[index] == GO_INTENT_ATTR_ID) {
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   /*BugID_5460*/
-   /*Case 1: If we are going to be p2p client, no need to 
modify channels attributes*/
-   /*In negotiation frames, go intent attr value 
determines who will be GO*/
-   intent = GET_GO_INTENT(buf[index + 3]);
-   tie_breaker = GET_TIE_BREAKER(buf[index + 3]);
-   if (intent > SUPPLICANT_GO_INTENT
-   || (intent == SUPPLICANT_GO_INTENT && tie_breaker 
== 1)) {
-   PRINT_D(GENERIC_DBG, "WILC will be client 
(intent %d tie breaker %d)\n", intent, tie_breaker);
-   is_wilc_go = false;
-   } else {
-   PRINT_D(GENERIC_DBG, "WILC will be GO (intent 
%d tie breaker %d)\n", intent, tie_breaker);
-   is_wilc_go = true;
-   }
-
-   #else   /* USE_SUPPLICANT_GO_INTENT */
#ifdef FORCE_P2P_CLIENT
buf[index + 3] = (buf[index + 3]  & 0x01) | (0x0f << 1);
#else
buf[index + 3] = (buf[index + 3]  & 0x01) | (0x00 << 1);
#endif
-   #endif  /* USE_SUPPLICANT_GO_INTENT */
}
 
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   /*Case 2: If group bssid attribute is present, no need to 
modify channels attributes*/
-   /*In invitation req and rsp, group bssid attr presence 
determines who will be GO*/
-   if (buf[index] == GROUP_BSSID_ATTR_ID) {
-   PRINT_D(GENERIC_DBG, "Group BSSID: %2x:%2x:%2x\n", 
buf[index + 3]
-   , buf[index + 4]
-   , buf[index + 5]);
-   is_wilc_go = false;
-   }
-   #endif  /* USE_SUPPLICANT_GO_INTENT */
-
if (buf[index] ==  CHANLIST_ATTR_ID)
channel_list_attr_index = index;
else if (buf[index] ==  OPERCHAN_ATTR_ID)
@@ -2075,11 +2042,7 @@ void WILC_WFI_CfgParseRxAction(u8 *buf, u32 len)
index += buf[index + 1] + 3; /* ID,Length byte */
}
 
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   if (u8WLANChannel != INVALID_CHANNEL && is_wilc_go)
-   #else
if (u8WLANChannel != INVALID_CHANNEL)
-   #endif
{
/*Modify channel list attribute*/
if (channel_list_attr_index) {
@@ -2119,29 +2082,8 @@ void WILC_WFI_CfgParseTxAction(u8 *buf, u32 len, bool 
bOperChan, u8 iftype)
 
u8 op_channel_attr_index = 0;
u8 channel_list_attr_index = 0;
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   bool is_wilc_go = false;
-
-   /*BugID_5460*/
-   /*Case 1: If we are already p2p client, no need to modify channels 
attributes*/
-   /*This to handle the case of inviting a p2p peer to join an existing 
group which we are a member in*/
-   if (iftype == CLIENT_MODE)
-   return;
-   #endif
 
while (index < len) {
-   #ifdef USE_SUPPLICANT_GO_INTENT
-   /*Case 2: If group bssid attribute is present, no need to 
modify channels attributes*/
-   /*In invitation req and rsp, group bssid attr presence 
determines who will be GO*/
-   /*Note: If we are already p2p client, group bssid attr may also 
be present (handled in Case 1)*/
-   if (buf[index] == GROUP_BSSID_ATTR_ID) {
-   PRINT_D(GENERIC_DBG, "Group BSSID: %2x:%2x:%2x\n", 
buf[index + 3]
-   , buf[index + 4]
-   , buf[index + 5]);
-   is_wilc_go = true;
-   }
-
-   #else   /* USE_SUPPLICANT_GO_INTENT */
if (buf[index] == GO_INTENT_

[PATCH 06/18] staging: wilc1000: use u32 instead of uint32_t

2015-09-14 Thread Chaehyun Lim
This patch replaces uint32_t with u32 that is a preferred kernel type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c |   4 +-
 drivers/staging/wilc1000/linux_mon.c  |   4 +-
 drivers/staging/wilc1000/linux_wlan.c |  10 +-
 drivers/staging/wilc1000/linux_wlan_spi.c |   6 +-
 drivers/staging/wilc1000/linux_wlan_spi.h |   4 +-
 drivers/staging/wilc1000/wilc_sdio.c  |  64 +-
 drivers/staging/wilc1000/wilc_spi.c   |  66 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   6 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |   2 +-
 drivers/staging/wilc1000/wilc_wlan.c  | 148 +++---
 drivers/staging/wilc1000/wilc_wlan.h  |  30 ++---
 drivers/staging/wilc1000/wilc_wlan_cfg.c  |  30 ++---
 drivers/staging/wilc1000/wilc_wlan_cfg.h  |   6 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   |  52 
 14 files changed, 216 insertions(+), 216 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3bab93c..59327aa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3380,7 +3380,7 @@ static void Handle_GetLinkspeed(tstrWILC_WFIDrv 
*drvHandler)
 s32 Handle_GetStatistics(tstrWILC_WFIDrv *drvHandler, tstrStatistics 
*pstrStatistics)
 {
tstrWID strWIDList[5];
-   uint32_t u32WidsCount = 0, s32Error = 0;
+   u32 u32WidsCount = 0, s32Error = 0;
 
strWIDList[u32WidsCount].u16WIDid = WID_LINKSPEED;
strWIDList[u32WidsCount].enuWIDtype = WID_CHAR;
@@ -7460,7 +7460,7 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
return s32Error;
 }
 #endif /*WILC_AP_EXTERNAL_MLME*/
-uint32_t wilc_get_chipid(u8);
+u32 wilc_get_chipid(u8);
 
 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 
u32Timeout)
 {
diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index a38d293..01e8be1 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -54,9 +54,9 @@ u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 #define IS_MGMT_STATUS_SUCCES  0x040
 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
 
-void WILC_WFI_monitor_rx(u8 *buff, uint32_t size)
+void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 {
-   uint32_t header, pkt_offset;
+   u32 header, pkt_offset;
struct sk_buff *skb = NULL;
struct wilc_wfi_radiotap_hdr *hdr;
struct wilc_wfi_radiotap_cb_hdr *cb_hdr;
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index f3036eb..6eafd0b 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -110,11 +110,11 @@ static struct semaphore close_exit_sync;
 
 static int wlan_deinit_locks(linux_wlan_t *nic);
 static void wlan_deinitialize_threads(linux_wlan_t *nic);
-extern void WILC_WFI_monitor_rx(u8 *buff, uint32_t size);
-extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, uint32_t size);
+extern void WILC_WFI_monitor_rx(u8 *buff, u32 size);
+extern void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
 
 static void linux_wlan_tx_complete(void *priv, int status);
-void frmw_to_linux(u8 *buff, uint32_t size, uint32_t pkt_offset);
+void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset);
 static int  mac_init_fn(struct net_device *ndev);
 int  mac_xmit(struct sk_buff *skb, struct net_device *dev);
 int  mac_open(struct net_device *ndev);
@@ -1963,7 +1963,7 @@ done:
return s32Error;
 }
 
-void frmw_to_linux(u8 *buff, uint32_t size, uint32_t pkt_offset)
+void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset)
 {
 
unsigned int frame_len = 0;
@@ -2042,7 +2042,7 @@ void frmw_to_linux(u8 *buff, uint32_t size, uint32_t 
pkt_offset)
#endif
 }
 
-void WILC_WFI_mgmt_rx(u8 *buff, uint32_t size)
+void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
 {
int i = 0;
perInterface_wlan_t *nic;
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c 
b/drivers/staging/wilc1000/linux_wlan_spi.c
index d0802fd..3e24256 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -38,7 +38,7 @@
  #define MAX_SPEED 600
 #endif /* WILC_ASIC_A0 */
 
-static uint32_t SPEED = MIN_SPEED;
+static u32 SPEED = MIN_SPEED;
 
 struct spi_device *wilc_spi_dev;
 void linux_spi_deinit(void *vp);
@@ -115,7 +115,7 @@ int linux_spi_init(void *vp)
 
 #if defined(TXRX_PHASE_SIZE)
 
-int linux_spi_write(u8 *b, uint32_t len)
+int linux_spi_write(u8 *b, u32 len)
 {
int ret;
 
@@ -194,7 +194,7 @@ int linux_spi_write(u8 *b, uint32_t len)
 }
 
 #else
-int linux_spi_write(u8 *b, uint32_t len)
+int linux_spi_write(u8 *b, u32 len)
 {
 
int ret;
diff --git a/drivers/staging/wilc1000/li

Re: [PATCH] drivers: stating: wilc1000: Add a check for SPI availability

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 10:21:14PM +0530, Chandra S Gorentla wrote:
> NULL pointer deference is observed in the wilc1000.ko module
> with bus type SPI and when SPI is not ready.
> 
> Signed-off-by: Chandra S Gorentla 
> ---
A small spelling mistake in the subject. It should be "staging" and not
"stating"

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


Re: [PATCH 01/13] staging: wilc1000: replace WILC_ERRORREPORT with return

2015-09-14 Thread Sudip Mukherjee
On Mon, Sep 14, 2015 at 10:00:43PM +0300, Mike Rapoport wrote:
> In cases where WILC_ERRORREPORT does not require cleanup actions, but
> causes immediate return from the function it can be replaced with return
> statement.
> 
> Signed-off-by: Mike Rapoport 
> ---
Have you build tested? It introduces lots of build warnings. Your patch
should never introduce build warnings.

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


Re: [PATCH] Staging: fbtft: Replace pr_info with dev_info

2015-09-14 Thread Sudip Mukherjee
On Tue, Sep 15, 2015 at 02:59:01AM +0530, Shraddha Barke wrote:
> Replace pr_info with dev_info when appropriate device structure
> is present
> 
> Signed-off-by: Shraddha Barke 
> ---
This has already been done by 962539a068a5 ("staging: fbtft: use dev_*")

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


  1   2   >