[PATCH] staging:r8188eu: load lib80211 crypto ops from interruptible context

2018-08-11 Thread Ivan Safonov
Preloading lib80211_crypt_* modules from an ioctl handlers
prevents the module loading from a tasklet.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c  |  4 +-
 drivers/staging/rtl8188eu/core/rtw_cmd.c |  8 +-
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c   |  6 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c| 14 ++--
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|  4 +-
 drivers/staging/rtl8188eu/core/rtw_pwrctrl.c |  2 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c|  2 +-
 drivers/staging/rtl8188eu/core/rtw_security.c|  1 -
 drivers/staging/rtl8188eu/core/rtw_xmit.c|  4 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c  |  2 +-
 drivers/staging/rtl8188eu/hal/usb_halinit.c  |  2 +-
 drivers/staging/rtl8188eu/include/rtw_security.h | 54 ++---
 drivers/staging/rtl8188eu/include/sta_info.h |  2 +-
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c   | 98 
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c|  4 +-
 drivers/staging/rtl8188eu/os_dep/os_intfs.c  |  4 +-
 16 files changed, 122 insertions(+), 89 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 676d549ef786..3a78bf115e9f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -642,8 +642,8 @@ static void start_bss_network(struct adapter *padapter, u8 
*pbuf)
/* WEP Key will be set before this function, do not
 * clear CAM.
 */
-   if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) &&
-   (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
+   if ((psecuritypriv->dot11PrivacyAlgrthm.id != _WEP40_) &&
+   (psecuritypriv->dot11PrivacyAlgrthm.id != _WEP104_))
flush_all_cam_entry(padapter);  /* clear CAM */
}
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 59039211dad2..499cfbebe6b9 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -448,9 +448,9 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct 
wlan_network *pnetwork)
 * the connection to avoid some IOT issue.
 * Especially for Realtek 8192u SoftAP.
 */
-   if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
-   (padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
-   (padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
+   if ((padapter->securitypriv.dot11PrivacyAlgrthm.id != _WEP40_) 
&&
+   (padapter->securitypriv.dot11PrivacyAlgrthm.id != _WEP104_) 
&&
+   (padapter->securitypriv.dot11PrivacyAlgrthm.id != _TKIP_)) {
/* rtw_restructure_ht_ie */
rtw_restructure_ht_ie(padapter, 
&pnetwork->network.ies[0], &psecnetwork->ies[0],

pnetwork->network.ie_length, &psecnetwork->ie_length);
@@ -570,7 +570,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 
unicast_key)
ether_addr_copy(psetstakey_para->addr, sta->hwaddr);
 
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
-   psetstakey_para->algorithm = (unsigned 
char)psecuritypriv->dot11PrivacyAlgrthm;
+   psetstakey_para->algorithm = (unsigned 
char)psecuritypriv->dot11PrivacyAlgrthm.id;
else
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, 
false);
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index c040f185074b..e57a15940ea7 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -481,15 +481,15 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, 
struct ndis_802_11_wep *wep)
 
switch (wep->KeyLength) {
case 5:
-   psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
+   psecuritypriv->dot11PrivacyAlgrthm = 
create_crypto_algorithm(_WEP40_);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("MgntActrtw_set_802_11_add_wep:wep->KeyLength = 5\n"));
break;
case 13:
-   psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
+   psecuritypriv->dot11PrivacyAlgrthm = 
create_crypto_algorithm(_WEP104_);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("MgntActrtw_set_802_11_add_wep:wep->KeyLength = 13\n"));
break;
default:
-   psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
+   psecuritypriv->dot11PrivacyAlgrthm = 
create_crypto_algorithm(_NO_PRIVACY_);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("MgntActrtw_set

[PATCH] staging: netlogic: Fixed comments to include SPDX-License-Identifier

2018-08-11 Thread Michael Anckaert
This patch fixes some issues with missing SPDX-License-Identifier
comments. 

Disclaimer: this is my first patch and instructions were taken from the
KernelNewbies project. 

Signed-off-by: Michael Anckaert 
---
 drivers/staging/netlogic/Kconfig| 6 +++---
 drivers/staging/netlogic/platform_net.c | 1 +
 drivers/staging/netlogic/platform_net.h | 1 +
 drivers/staging/netlogic/xlr_net.c  | 1 +
 drivers/staging/netlogic/xlr_net.h  | 1 +
 5 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/netlogic/Kconfig b/drivers/staging/netlogic/Kconfig
index d660de51b541..ab0b756bc08b 100644
--- a/drivers/staging/netlogic/Kconfig
+++ b/drivers/staging/netlogic/Kconfig
@@ -2,6 +2,6 @@ config NETLOGIC_XLR_NET
tristate "Netlogic XLR/XLS network device"
depends on CPU_XLR
select PHYLIB
-   ---help---
-   This driver support Netlogic XLR/XLS on chip gigabit
-   Ethernet.
+   help
+   This driver support Netlogic XLR/XLS on chip gigabit
+   Ethernet.
diff --git a/drivers/staging/netlogic/platform_net.c 
b/drivers/staging/netlogic/platform_net.c
index abf4c71ee66b..3886c99c1f68 100644
--- a/drivers/staging/netlogic/platform_net.c
+++ b/drivers/staging/netlogic/platform_net.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/platform_net.h 
b/drivers/staging/netlogic/platform_net.h
index e1b27f649590..1d994f0d0995 100644
--- a/drivers/staging/netlogic/platform_net.h
+++ b/drivers/staging/netlogic/platform_net.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index e461168313bf..201db10692de 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/xlr_net.h 
b/drivers/staging/netlogic/xlr_net.h
index f76e16cfd15d..de51d64c1f23 100644
--- a/drivers/staging/netlogic/xlr_net.h
+++ b/drivers/staging/netlogic/xlr_net.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
-- 
2.17.1

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


Re: [PATCH] staging: netlogic: Fixed comments to include SPDX-License-Identifier

2018-08-11 Thread Greg KH
On Sat, Aug 11, 2018 at 06:15:05PM +0200, Michael Anckaert wrote:
> This patch fixes some issues with missing SPDX-License-Identifier
> comments. 
> 
> Disclaimer: this is my first patch and instructions were taken from the
> KernelNewbies project. 

This does not belong in a changelog comment.  If you want to put info
like this, put it below the --- line.

> 
> Signed-off-by: Michael Anckaert 
> ---
>  drivers/staging/netlogic/Kconfig| 6 +++---
>  drivers/staging/netlogic/platform_net.c | 1 +
>  drivers/staging/netlogic/platform_net.h | 1 +
>  drivers/staging/netlogic/xlr_net.c  | 1 +
>  drivers/staging/netlogic/xlr_net.h  | 1 +
>  5 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/netlogic/Kconfig 
> b/drivers/staging/netlogic/Kconfig
> index d660de51b541..ab0b756bc08b 100644
> --- a/drivers/staging/netlogic/Kconfig
> +++ b/drivers/staging/netlogic/Kconfig
> @@ -2,6 +2,6 @@ config NETLOGIC_XLR_NET
>   tristate "Netlogic XLR/XLS network device"
>   depends on CPU_XLR
>   select PHYLIB
> - ---help---
> - This driver support Netlogic XLR/XLS on chip gigabit
> - Ethernet.
> + help
> + This driver support Netlogic XLR/XLS on chip gigabit
> + Ethernet.

This change has nothing to do with spdx identifiers :(

Please fix up and resend as 2 different patches.

thanks,

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


[PATCH v2] staging: netlogic: Fixed comments to include SPDX-License-Identifier

2018-08-11 Thread Michael Anckaert
This patch fixes some issues with missing SPDX-License-Identifier comments. 

Signed-off-by: Michael Anckaert 
---

Changes in v2:
 - Removed unrelated change to different patch.

 drivers/staging/netlogic/platform_net.c | 1 +
 drivers/staging/netlogic/platform_net.h | 1 +
 drivers/staging/netlogic/xlr_net.c  | 1 +
 drivers/staging/netlogic/xlr_net.h  | 1 +
 4 files changed, 4 insertions(+)

diff --git a/drivers/staging/netlogic/platform_net.c 
b/drivers/staging/netlogic/platform_net.c
index abf4c71ee66b..3886c99c1f68 100644
--- a/drivers/staging/netlogic/platform_net.c
+++ b/drivers/staging/netlogic/platform_net.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/platform_net.h 
b/drivers/staging/netlogic/platform_net.h
index e1b27f649590..1d994f0d0995 100644
--- a/drivers/staging/netlogic/platform_net.h
+++ b/drivers/staging/netlogic/platform_net.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index e461168313bf..201db10692de 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
diff --git a/drivers/staging/netlogic/xlr_net.h 
b/drivers/staging/netlogic/xlr_net.h
index f76e16cfd15d..de51d64c1f23 100644
--- a/drivers/staging/netlogic/xlr_net.h
+++ b/drivers/staging/netlogic/xlr_net.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2003-2012 Broadcom Corporation
  * All Rights Reserved
-- 
2.17.1

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


[PATCH 3/5] staging: wilc1000: remove the use of 'wilc_debugfs_info_t' struct

2018-08-11 Thread Ajay Singh
Refactor the code to remove the use of 'wilc_debugfs_info_t' struct.
Pass NULL for data in debugfs_create_file() call, as its value is not
used.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_debugfs.c | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index 78c0831..c9bc325 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -62,25 +62,10 @@ ssize_t wilc_debug_level_write(struct file *filp, const 
char __user *buf,
return count;
 }
 
-struct wilc_debugfs_info_t {
-   const char *name;
-   int perm;
-   unsigned int data;
-};
-
-static struct wilc_debugfs_info_t debugfs_info = {
-   "wilc_debug_level",
-   0666,
-   (DEBUG | ERR),
-};
-
 int wilc_debugfs_init(const struct file_operations *fops)
 {
-   struct wilc_debugfs_info_t *info = &debugfs_info;
-
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   debugfs_create_file(info->name, info->perm, wilc_dir, &info->data,
-   fops);
+   debugfs_create_file("wilc_debug_level", 0666, wilc_dir, NULL, fops);
 
return 0;
 }
-- 
2.7.4

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


[PATCH 0/5] staging: wilc1000: compilation error fixes & cleanup changes

2018-08-11 Thread Ajay Singh
This patch series contains the changes to avoid below compilation error.

 "drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined
 reference to `__this_module'"

Split the changes into multiple patches, as discussed in [1].

[1]. https://www.spinics.net/lists/linux-wireless/msg176009.html

Ajay Singh (5):
  staging: wilc1000: avoid arrray of 'wilc_debugfs_info_t' type
  staging: wilc1000: fixes for undefined reference to `__this_module'
error
  staging: wilc1000: remove the use of 'wilc_debugfs_info_t' struct
  staging: wilc1000: change permission to 0600 in debugfs_create_file()
call
  staging: wilc1000: use void return for wilc_debugfs_init()

 drivers/staging/wilc1000/linux_wlan.c   |  1 -
 drivers/staging/wilc1000/wilc_debugfs.c | 48 +
 drivers/staging/wilc1000/wilc_sdio.c|  7 +
 drivers/staging/wilc1000/wilc_spi.c |  7 +
 drivers/staging/wilc1000/wilc_wlan_if.h |  7 -
 5 files changed, 26 insertions(+), 44 deletions(-)

-- 
2.7.4

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


[PATCH 1/5] staging: wilc1000: avoid arrray of 'wilc_debugfs_info_t' type

2018-08-11 Thread Ajay Singh
Refactor code by removing array of 'wilc_debugfs_info_t' type and use
single variable to store 'wilc_debugfs_info_t' struct value.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_debugfs.c | 26 +-
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index edc7287..c5f67c9 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -78,29 +78,21 @@ struct wilc_debugfs_info_t {
const struct file_operations fops;
 };
 
-static struct wilc_debugfs_info_t debugfs_info[] = {
-   {
-   "wilc_debug_level",
-   0666,
-   (DEBUG | ERR),
-   FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL),
-   },
+static struct wilc_debugfs_info_t debugfs_info = {
+   "wilc_debug_level",
+   0666,
+   (DEBUG | ERR),
+   FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL),
 };
 
 int wilc_debugfs_init(void)
 {
-   int i;
-   struct wilc_debugfs_info_t *info;
+   struct wilc_debugfs_info_t *info = &debugfs_info;
 
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
-   info = &debugfs_info[i];
-   debugfs_create_file(info->name,
-   info->perm,
-   wilc_dir,
-   &info->data,
-   &info->fops);
-   }
+   debugfs_create_file(info->name, info->perm, wilc_dir, &info->data,
+   &info->fops);
+
return 0;
 }
 
-- 
2.7.4

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


[PATCH 5/5] staging: wilc1000: use void return for wilc_debugfs_init()

2018-08-11 Thread Ajay Singh
Change the return type from int to void for wilc_debugfs_init(), as its
return value is not used.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_debugfs.c | 4 +---
 drivers/staging/wilc1000/wilc_wlan_if.h | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index 15e797b..1a2c4e7 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -62,12 +62,10 @@ ssize_t wilc_debug_level_write(struct file *filp, const 
char __user *buf,
return count;
 }
 
-int wilc_debugfs_init(const struct file_operations *fops)
+void wilc_debugfs_init(const struct file_operations *fops)
 {
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
debugfs_create_file("wilc_debug_level", 0600, wilc_dir, NULL, fops);
-
-   return 0;
 }
 
 void wilc_debugfs_remove(void)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 47b4020..21f72a8 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -831,7 +831,7 @@ struct wilc;
 int wilc_wlan_init(struct net_device *dev);
 u32 wilc_get_chipid(struct wilc *wilc, bool update);
 
-int wilc_debugfs_init(const struct file_operations *fops);
+void wilc_debugfs_init(const struct file_operations *fops);
 void wilc_debugfs_remove(void);
 ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf,
  size_t count, loff_t *ppos);
-- 
2.7.4

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


[PATCH 4/5] staging: wilc1000: change permission to 0600 in debugfs_create_file() call

2018-08-11 Thread Ajay Singh
Cleanup patch to use more restrictive access permission for debugfs
file.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index c9bc325..15e797b 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -65,7 +65,7 @@ ssize_t wilc_debug_level_write(struct file *filp, const char 
__user *buf,
 int wilc_debugfs_init(const struct file_operations *fops)
 {
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   debugfs_create_file("wilc_debug_level", 0666, wilc_dir, NULL, fops);
+   debugfs_create_file("wilc_debug_level", 0600, wilc_dir, NULL, fops);
 
return 0;
 }
-- 
2.7.4

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


[PATCH 2/5] staging: wilc1000: fixes for undefined reference to `__this_module' error

2018-08-11 Thread Ajay Singh
wilc_debug.o object file is included for both SDIO and SPI module. When
anyone(either SDIO or SPI) module is compiled as loaded module and another
as buildin module then below compilation error occurs.

"drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined
reference to `__this_module'"

Moved the declaration of file_operation variable in SDIO/SPI files and
pass this as parameter to wilc_debugfs_init(). Remove 'fops' element
from 'wilc_debugfs_info_t' struct, as its not required.

Fixes: 9abc44ba4e2f ("staging: wilc1000: fix TODO to compile spi and sdio 
components in single module")
Reported-by: kbuild test robot 
Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/linux_wlan.c   |  1 -
 drivers/staging/wilc1000/wilc_debugfs.c | 23 ++-
 drivers/staging/wilc1000/wilc_sdio.c|  7 +++
 drivers/staging/wilc1000/wilc_spi.c |  7 +++
 drivers/staging/wilc1000/wilc_wlan_if.h |  7 ++-
 5 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 01cf4bd..37885ad 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1062,7 +1062,6 @@ int wilc_netdev_init(struct wilc **wilc, struct device 
*dev, int io_type,
if (!wl)
return -ENOMEM;
 
-   wilc_debugfs_init();
*wilc = wl;
wl->io_type = io_type;
wl->hif_func = ops;
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index c5f67c9..78c0831 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -20,8 +20,8 @@ static struct dentry *wilc_dir;
 #define DBG_LEVEL_ALL  (DEBUG | INFO | WRN | ERR)
 static atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
 
-static ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf,
-size_t count, loff_t *ppos)
+ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf,
+ size_t count, loff_t *ppos)
 {
char buf[128];
int res = 0;
@@ -36,9 +36,8 @@ static ssize_t wilc_debug_level_read(struct file *file, char 
__user *userbuf,
return simple_read_from_buffer(userbuf, count, ppos, buf, res);
 }
 
-static ssize_t wilc_debug_level_write(struct file *filp,
- const char __user *buf, size_t count,
- loff_t *ppos)
+ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,
+  size_t count, loff_t *ppos)
 {
int flag = 0;
int ret;
@@ -63,35 +62,25 @@ static ssize_t wilc_debug_level_write(struct file *filp,
return count;
 }
 
-#define FOPS(_open, _read, _write, _poll) { \
-   .owner  = THIS_MODULE, \
-   .open   = (_open), \
-   .read   = (_read), \
-   .write  = (_write), \
-   .poll   = (_poll), \
-}
-
 struct wilc_debugfs_info_t {
const char *name;
int perm;
unsigned int data;
-   const struct file_operations fops;
 };
 
 static struct wilc_debugfs_info_t debugfs_info = {
"wilc_debug_level",
0666,
(DEBUG | ERR),
-   FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL),
 };
 
-int wilc_debugfs_init(void)
+int wilc_debugfs_init(const struct file_operations *fops)
 {
struct wilc_debugfs_info_t *info = &debugfs_info;
 
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
debugfs_create_file(info->name, info->perm, wilc_dir, &info->data,
-   &info->fops);
+   fops);
 
return 0;
 }
diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
b/drivers/staging/wilc1000/wilc_sdio.c
index b2080d8..c1573f5 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -103,6 +103,12 @@ static int wilc_sdio_cmd53(struct wilc *wilc, struct 
sdio_cmd53 *cmd)
return ret;
 }
 
+static const struct file_operations sdio_debug_fops = {
+   .owner  = THIS_MODULE,
+   .read   = wilc_debug_level_read,
+   .write  = wilc_debug_level_write,
+};
+
 static int linux_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
 {
@@ -126,6 +132,7 @@ static int linux_sdio_probe(struct sdio_func *func,
dev_err(&func->dev, "Couldn't initialize netdev\n");
return ret;
}
+   wilc_debugfs_init(&sdio_debug_fops);
sdio_set_drvdata(func, wilc);
wilc->dev = &func->dev;
wilc->gpio_irq = gpio;
diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 5517477..0376649 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -102,6 +102,12 @@ static u8 crc7(u8 crc, const u8

Re: [PATCH v2] staging: wilc1000: fix undefined reference to `__this_module' compilation error

2018-08-11 Thread Ajay Singh
Hi Greg,

On Thu, 9 Aug 2018 14:21:33 +0200
Greg KH  wrote:

> On Thu, Aug 09, 2018 at 04:59:39PM +0530, Ajay Singh wrote:
> > wilc_debug.o object file is included for both SDIO and SPI module.
> > When anyone(either SDIO or SPI) module is compiled as loaded module
> > and another as buildin module then below compilation error occurs.
> > 
> > "drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined
> > reference to `__this_module'"
> > 
> > Moved the declaration of file_operation variable in SDIO/SPI files
> > and pass this as parameter to wilc_debugfs_init().
> > Refactor wilc_debugfs_init() as its not required to maintain
> > 'wilc_debugfs_info_t' in debugfs_info[] array. Also modified file
> > permission from 0666 to 0600 & use 'data' field as 'NULL' in
> > debugfs_create_file() call.  
> 
> That is a lot of different things all in one patch.  Please never do
> that.
> 

Please ignore this patch. I have split these changes and resubmitted a
new patch series to address this issue.

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


Re: [PATCH 2/5] staging: wilc1000: fixes for undefined reference to `__this_module' error

2018-08-11 Thread Greg KH
On Sun, Aug 12, 2018 at 10:17:42AM +0530, Ajay Singh wrote:
> wilc_debug.o object file is included for both SDIO and SPI module. When
> anyone(either SDIO or SPI) module is compiled as loaded module and another
> as buildin module then below compilation error occurs.
> 
> "drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined
> reference to `__this_module'"
> 
> Moved the declaration of file_operation variable in SDIO/SPI files and
> pass this as parameter to wilc_debugfs_init(). Remove 'fops' element
> from 'wilc_debugfs_info_t' struct, as its not required.
> 
> Fixes: 9abc44ba4e2f ("staging: wilc1000: fix TODO to compile spi and sdio 
> components in single module")
> Reported-by: kbuild test robot 
> Signed-off-by: Ajay Singh 
> ---

Can this be the first patch in the series so it can go to Linus for 4.19
and the rest can be postponed for later?

thanks,

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


[PATCH] staging: gasket: remove null ptr check before kfree

2018-08-11 Thread Sumit Kumar
Remove null ptr check before kfree because kfree is null ptr safe.
Issue found by checkpatch.

Signed-off-by: Sumit Kumar 
---
 drivers/staging/gasket/gasket_page_table.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/gasket/gasket_page_table.c 
b/drivers/staging/gasket/gasket_page_table.c
index d4c5f8a..bd921dc 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -1328,10 +1328,8 @@ int gasket_alloc_coherent_memory(struct gasket_dev 
*gasket_dev, u64 size,
  num_pages * PAGE_SIZE, mem, handle);
}
 
-   if (gasket_dev->page_table[index]->coherent_pages) {
-   kfree(gasket_dev->page_table[index]->coherent_pages);
-   gasket_dev->page_table[index]->coherent_pages = NULL;
-   }
+   kfree(gasket_dev->page_table[index]->coherent_pages);
+   gasket_dev->page_table[index]->coherent_pages = NULL;
gasket_dev->page_table[index]->num_coherent_pages = 0;
return -ENOMEM;
 }
-- 
2.7.4

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