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

2018-08-08 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().
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.

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 | 50 +++--
 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, 30 insertions(+), 42 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 edc7287..cb02859 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,44 +62,15 @@ 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)
 {
-   int i;
-   struct wilc_debugfs_info_t *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);
+   if (IS_ERR_OR_NULL(wilc_dir)) {
+   pr_err("Error creating debugfs\n");
+   return -EFAULT;
}
+   debugfs_create_file("wilc_debug_level", 0600, wilc_dir, NULL, 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_de

Re: [PATCH v2 01/15] staging:rtl8192u: Remove macro eqMacAddr - Style

2018-08-08 Thread Joe Perches
On Wed, 2018-08-08 at 22:00 +0100, John Whitmore wrote:
> The macro eqMacAddr implements the same functionality as the
> ether_addr_equal function defined in etherdevice.h, as a result the
> macro has been removed from the code, and its use replaced with the
> function call.
[]
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> b/drivers/staging/rtl8192u/r8192U_core.c
[]
> @@ -4460,15 +4460,15 @@ static void TranslateRxSignalStuff819xUsb(struct 
> sk_buff *skb,
>  
>   /* Check if the received packet is acceptable. */
>   bpacket_match_bssid = (type != IEEE80211_FTYPE_CTL) &&
> -
> (eqMacAddr(priv->ieee80211->current_network.bssid,  (fc & 
> IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 
> : hdr->addr3))
> +
> (ether_addr_equal(priv->ieee80211->current_network.bssid,  (fc & 
> IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 
> : hdr->addr3))
>  && (!pstats->bHwError) && (!pstats->bCRC) && 
> (!pstats->bICV);
>   bpacket_toself =  bpacket_match_bssid &
> -   (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr));
> +   (ether_addr_equal(praddr, 
> priv->ieee80211->dev->dev_addr));

Likely this should be

bpacket_match_bssid = bpacket_match_bss &&

as boolean use with a bitwise & is odd.

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


[PATCH v2 08/15] staging:rtl8192u: Rename Dot11d_Reset - Style

2018-08-08 Thread John Whitmore
The function Dot11d_Reset causes a checkpatch issue due to its use of
CamelCase naming, so has been renamed to dot11d_reset.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c| 6 +++---
 drivers/staging/rtl8192u/ieee80211/dot11d.h| 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index aef16794af76..d6baeec91669 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -20,7 +20,7 @@ void dot11d_init(struct ieee80211_device *ieee)
 EXPORT_SYMBOL(dot11d_init);
 
 /* Reset to the state as we are just entering a regulatory domain. */
-void Dot11d_Reset(struct ieee80211_device *ieee)
+void dot11d_reset(struct ieee80211_device *ieee)
 {
u32 i;
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
@@ -38,7 +38,7 @@ void Dot11d_Reset(struct ieee80211_device *ieee)
pDot11dInfo->country_ie_len = 0;
RESET_CIE_WATCHDOG(ieee);
 }
-EXPORT_SYMBOL(Dot11d_Reset);
+EXPORT_SYMBOL(dot11d_reset);
 
 /*
  * Update country IE from Beacon or Probe Resopnse and configure PHY for
@@ -127,7 +127,7 @@ void DOT11D_ScanComplete(struct ieee80211_device *dev)
case DOT11D_STATE_DONE:
if (GET_CIE_WATCHDOG(dev) == 0) {
/* Reset country IE if previous one is gone. */
-   Dot11d_Reset(dev);
+   dot11d_reset(dev);
}
break;
case DOT11D_STATE_NONE:
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 8e65e54a372c..73cf2e6aeb06 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -44,7 +44,7 @@ struct rt_dot11d_info {
 #define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))
 
 void dot11d_init(struct ieee80211_device *dev);
-void Dot11d_Reset(struct ieee80211_device *dev);
+void dot11d_reset(struct ieee80211_device *dev);
 void Dot11d_UpdateCountryIe(struct ieee80211_device *dev,
u8 *pTaddr,
u16 CoutryIeLen,
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 212cc9ccbb96..39ed743a1a56 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2357,7 +2357,7 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)
if (ieee->data_hard_stop)
ieee->data_hard_stop(ieee->dev);
if (IS_DOT11D_ENABLE(ieee))
-   Dot11d_Reset(ieee);
+   dot11d_reset(ieee);
ieee->state = IEEE80211_NOLINK;
ieee->is_set_key = false;
ieee->link_change(ieee->dev);
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index c77f35102fd4..da4b376d6122 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -212,7 +212,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct 
r8192_priv *priv)
 * otherwise, it shall follow global domain settings.
 */
GET_DOT11D_INFO(ieee)->enabled = 0;
-   Dot11d_Reset(ieee);
+   dot11d_reset(ieee);
ieee->bGlobalDomain = true;
break;
 
-- 
2.18.0

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


[PATCH v2 10/15] staging:rtl8192u: Rename dot11d_update_country_ie() parameters - Style

2018-08-08 Thread John Whitmore
The function dot11d_update_country_ie() uses parameter names which
cause a checkpatch issue due to the use of CamelCase naming.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index a45223171a55..ff18ad26ea0d 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -46,9 +46,9 @@ struct rt_dot11d_info {
 void dot11d_init(struct ieee80211_device *dev);
 void dot11d_reset(struct ieee80211_device *dev);
 void dot11d_update_country_ie(struct ieee80211_device *dev,
- u8 *pTaddr,
- u16 CoutryIeLen,
- u8 *pCoutryIe);
+ u8 *addr,
+ u16 coutry_ie_len,
+ u8 *coutry_ie);
 u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel);
 void DOT11D_ScanComplete(struct ieee80211_device *dev);
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
-- 
2.18.0

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


[PATCH v2 04/15] staging:rtl8192u: Rename macro parameter __pIeeeDev - Style

2018-08-08 Thread John Whitmore
Multiple macros, defined in dot11d.h, use the variable __pIeeeDev as a
parameter. This name causes a checkpatch issue due to its use of
CamelCase naming. The parameter name has been changed to ieee_dev to
clear this issue.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 4ef609abc68b..0f0e10fa645d 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -31,17 +31,17 @@ struct rt_dot11d_info {
bool enabled; /* dot11MultiDomainCapabilityEnabled */
 };
 
-#define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info 
*)((__pIeeeDev)->pDot11dInfo))
+#define GET_DOT11D_INFO(ieee_dev) ((struct rt_dot11d_info 
*)((ieee_dev)->pDot11dInfo))
 
-#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
-#define IS_COUNTRY_IE_VALID(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
+#define IS_DOT11D_ENABLE(ieee_dev) (GET_DOT11D_INFO(ieee_dev)->enabled)
+#define IS_COUNTRY_IE_VALID(ieee_dev) 
(GET_DOT11D_INFO(ieee_dev)->country_ie_len > 0)
 
-#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) 
ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
-#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) 
ether_addr_copy(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define IS_EQUAL_CIE_SRC(ieee_dev, __pTa) 
ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa)
+#define UPDATE_CIE_SRC(ieee_dev, __pTa) 
ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa)
 
-#define GET_CIE_WATCHDOG(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
-#define RESET_CIE_WATCHDOG(__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0)
-#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
+#define GET_CIE_WATCHDOG(ieee_dev) 
(GET_DOT11D_INFO(ieee_dev)->country_ie_watchdog)
+#define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)
+#define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))
 
 void
 Dot11d_Init(
-- 
2.18.0

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


[PATCH v2 01/15] staging:rtl8192u: Remove macro eqMacAddr - Style

2018-08-08 Thread John Whitmore
The macro eqMacAddr implements the same functionality as the
ether_addr_equal function defined in etherdevice.h, as a result the
macro has been removed from the code, and its use replaced with the
function call.

Note that to use the ether_addr_equal function the data array
containing the MAC Address has to be u16 aligned. Because of this the
struct rt_dot11d_info has had it's member variables re-ordered.

This is a coding style change which should have no impact on runtime
code execution.

Suggested-by: Joe Perches 
Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 12 +---
 drivers/staging/rtl8192u/r8192U_core.c  |  6 +++---
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 363a6bed18dd..3bfd7efe05a0 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -17,22 +17,20 @@ enum dot11d_state {
 };
 
 struct rt_dot11d_info {
-   bool enabled; /* dot11MultiDomainCapabilityEnabled */
-
u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country 
information element. */
-   u8  country_ie_buf[MAX_IE_LEN];
+
+   /*  country_ie_src_addr u16 aligned for comparison and copy */
u8  country_ie_src_addr[6]; /* Source AP of the country IE. */
+   u8  country_ie_buf[MAX_IE_LEN];
u8  country_ie_watchdog;
 
u8  channel_map[MAX_CHANNEL_NUMBER + 1];  /* !Value 0: Invalid, 1: 
Valid (active scan), 2: Valid (passive scan) */
u8  max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER + 1];
 
enum dot11d_state state;
+   bool enabled; /* dot11MultiDomainCapabilityEnabled */
 };
 
-#define eqMacAddr(a, b)(((a)[0] == (b)[0] &&   \
-   (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
-   (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
 #define cpMacAddr(des, src)  ((des)[0] = (src)[0], \
(des)[1] = (src)[1], (des)[2] = (src)[2], \
(des)[3] = (src)[3], (des)[4] = (src)[4], \
@@ -42,7 +40,7 @@ struct rt_dot11d_info {
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
 
-#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) 
eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) 
ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) 
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
 
 #define GET_CIE_WATCHDOG(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index e218b5c20642..b2be09fcd43b 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4460,15 +4460,15 @@ static void TranslateRxSignalStuff819xUsb(struct 
sk_buff *skb,
 
/* Check if the received packet is acceptable. */
bpacket_match_bssid = (type != IEEE80211_FTYPE_CTL) &&
-  
(eqMacAddr(priv->ieee80211->current_network.bssid,  (fc & IEEE80211_FCTL_TODS) 
? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
+  
(ether_addr_equal(priv->ieee80211->current_network.bssid,  (fc & 
IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : 
hdr->addr3))
   && (!pstats->bHwError) && (!pstats->bCRC) && 
(!pstats->bICV);
bpacket_toself =  bpacket_match_bssid &
- (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr));
+ (ether_addr_equal(praddr, 
priv->ieee80211->dev->dev_addr));
 
if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BEACON)
bPacketBeacon = true;
if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BLOCKACK) {
-   if ((eqMacAddr(praddr, dev->dev_addr)))
+   if ((ether_addr_equal(praddr, dev->dev_addr)))
bToSelfBA = true;
}
 
-- 
2.18.0

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


[PATCH v2 02/15] staging:rtl8192u: Remove macro cpMacAddr - Style

2018-08-08 Thread John Whitmore
The macro cpMacAddr implements the same functionality as the
ether_addr_copy function defined in etherdevice.h, as a result the
macro has been removed from the code, and its use replaced with the
function call.

Note that the header comment of the function ether_addr_copy states
that the two byte arrays passed as parameters to the function must
be u16 aligned. Because of this the structure ieee80211_network has
had its member variables re-ordered so that the members bssid and
MBssid are aligned to a u16 boundary.

This is a coding style change which should have no impact on runtime
code execution.

Suggested-by: Joe Perches 
Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |  6 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 11 ++-
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  2 +-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 3bfd7efe05a0..14879bc0fe6b 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -31,17 +31,13 @@ struct rt_dot11d_info {
bool enabled; /* dot11MultiDomainCapabilityEnabled */
 };
 
-#define cpMacAddr(des, src)  ((des)[0] = (src)[0], \
-   (des)[1] = (src)[1], (des)[2] = (src)[2], \
-   (des)[3] = (src)[3], (des)[4] = (src)[4], \
-   (des)[5] = (src)[5])
 #define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info 
*)((__pIeeeDev)->pDot11dInfo))
 
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
 
 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) 
ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
-#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) 
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) 
ether_addr_copy(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
 
 #define GET_CIE_WATCHDOG(__pIeeeDev) 
(GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
 #define RESET_CIE_WATCHDOG(__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 3cfeac0d7214..62df6f229989 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -1329,8 +1329,13 @@ typedef enum _erp_t {
 
 struct ieee80211_network {
/* These entries are used to identify a unique network */
-   u8 bssid[ETH_ALEN];
+   u8 bssid[ETH_ALEN];   /* u16 aligned! */
u8 channel;
+
+   // CCXv4 S59, MBSSID.
+   boolbMBssidValid;
+   u8  MBssid[ETH_ALEN];/* u16 aligned! */
+   u8  MBssidMask;
/* Ensure null-terminated for any debug msgs */
u8 ssid[IW_ESSID_MAX_SIZE + 1];
u8 ssid_len;
@@ -1341,10 +1346,6 @@ struct ieee80211_network {
boolbCkipSupported;
boolbCcxRmEnable;
u16 CcxRmState[2];
-   // CCXv4 S59, MBSSID.
-   boolbMBssidValid;
-   u8  MBssidMask;
-   u8  MBssid[6];
// CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20.
boolbWithCcxVerNum;
u8  BssCcxVerNumber;
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 28cae82d795c..2c11d3ef63d7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1944,7 +1944,7 @@ int ieee80211_parse_info_param(struct ieee80211_device 
*ieee,
{
network->bMBssidValid = true;
network->MBssidMask = 0xff << 
(network->MBssidMask);
-   cpMacAddr(network->MBssid, 
network->bssid);
+   
ether_addr_copy(network->MBssid, network->bssid);
network->MBssid[5] &= 
network->MBssidMask;
}
else
-- 
2.18.0

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


[PATCH v2 11/15] staging:rtl8192u: Rename DOT11D_GetMaxTxPwrInDbm - Style

2018-08-08 Thread John Whitmore
The function DOT11D_GetMaxTxPwrInDbm causes a checkpatch issue due to
its use of CamelCase naming. The function has been renamed to
dot11d_get_max_tx_pwr_in_dbm.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index 6855b096d0fc..3a11c0ad3f2b 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -99,13 +99,13 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, 
u8 *pTaddr,
 }
 EXPORT_SYMBOL(dot11d_update_country_ie);
 
-u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
+u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
u8 MaxTxPwrInDbm = 255;
 
if (Channel > MAX_CHANNEL_NUMBER) {
-   netdev_err(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid 
Channel\n");
+   netdev_err(dev->dev, "dot11d_get_max_tx_pwr_in_dbm(): Invalid 
Channel\n");
return MaxTxPwrInDbm;
}
if (pDot11dInfo->channel_map[Channel])
@@ -113,7 +113,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 
Channel)
 
return MaxTxPwrInDbm;
 }
-EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
+EXPORT_SYMBOL(dot11d_get_max_tx_pwr_in_dbm);
 
 void DOT11D_ScanComplete(struct ieee80211_device *dev)
 {
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index ff18ad26ea0d..cbf93cd27f45 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -49,7 +49,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
  u8 *addr,
  u16 coutry_ie_len,
  u8 *coutry_ie);
-u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel);
+u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel);
 void DOT11D_ScanComplete(struct ieee80211_device *dev);
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
-- 
2.18.0

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


[PATCH v2 07/15] staging:rtl8192u: Rename Dot11d_Init - Style

2018-08-08 Thread John Whitmore
The function Dot11d_Init() causes a checkpatch issue due to its use
of CamelCase naming. The function has been renamed to dot11d_init.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index 2fb575a2b6ab..aef16794af76 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -3,7 +3,7 @@
 
 #include "dot11d.h"
 
-void Dot11d_Init(struct ieee80211_device *ieee)
+void dot11d_init(struct ieee80211_device *ieee)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
 
@@ -15,9 +15,9 @@ void Dot11d_Init(struct ieee80211_device *ieee)
memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
RESET_CIE_WATCHDOG(ieee);
 
-   netdev_info(ieee->dev, "Dot11d_Init()\n");
+   netdev_info(ieee->dev, "dot11d_init()\n");
 }
-EXPORT_SYMBOL(Dot11d_Init);
+EXPORT_SYMBOL(dot11d_init);
 
 /* Reset to the state as we are just entering a regulatory domain. */
 void Dot11d_Reset(struct ieee80211_device *ieee)
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 0856d5ea7991..8e65e54a372c 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -43,7 +43,7 @@ struct rt_dot11d_info {
 #define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)
 #define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))
 
-void Dot11d_Init(struct ieee80211_device *dev);
+void dot11d_init(struct ieee80211_device *dev);
 void Dot11d_Reset(struct ieee80211_device *dev);
 void Dot11d_UpdateCountryIe(struct ieee80211_device *dev,
u8 *pTaddr,
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index b2be09fcd43b..c77f35102fd4 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -183,7 +183,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct 
r8192_priv *priv)
case COUNTRY_CODE_ISRAEL:
case COUNTRY_CODE_TELEC:
case COUNTRY_CODE_MIC:
-   Dot11d_Init(ieee);
+   dot11d_init(ieee);
ieee->bGlobalDomain = false;
/* actually 8225 & 8256 rf chips only support B,G,24N mode */
if ((priv->rf_chip == RF_8225) || (priv->rf_chip == RF_8256)) {
-- 
2.18.0

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


[PATCH v2 03/15] staging:rtl8192u: Replace magic number 6 with ETH_ALEN - Style

2018-08-08 Thread John Whitmore
The array size 6 represents the length of an Ethernet address so the
magic number has been replaced with the defined constant representing
that length.

This is a coding style change which should not impact runtime code
execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 14879bc0fe6b..4ef609abc68b 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -20,7 +20,7 @@ struct rt_dot11d_info {
u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country 
information element. */
 
/*  country_ie_src_addr u16 aligned for comparison and copy */
-   u8  country_ie_src_addr[6]; /* Source AP of the country IE. */
+   u8  country_ie_src_addr[ETH_ALEN]; /* Source AP of the country IE. */
u8  country_ie_buf[MAX_IE_LEN];
u8  country_ie_watchdog;
 
-- 
2.18.0

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


[PATCH v2 12/15] staging:rtl8192u: Rename Channel - Style

2018-08-08 Thread John Whitmore
The function dot11d_get_max_tx_pwr_in_dbm() uses a parameter name,
Channel, which causes a checkpatch issue with CamelCase naming. The
parameter has been renamed to channel.

The change is a coding style change which should have no impact on
runtime code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index cbf93cd27f45..d4333ea106fd 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -49,7 +49,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
  u8 *addr,
  u16 coutry_ie_len,
  u8 *coutry_ie);
-u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel);
+u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel);
 void DOT11D_ScanComplete(struct ieee80211_device *dev);
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
-- 
2.18.0

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


[PATCH v2 09/15] staging:rtl8192u: Rename Dot11d_UpdateCountryIe - Style

2018-08-08 Thread John Whitmore
The function Dot11d_UpdateCountryIe causes a checkpatch issue due to
its use of CamelCase naming, the function has been renamed to
dot11d_update_country_ie.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c   | 8 
 drivers/staging/rtl8192u/ieee80211/dot11d.h   | 8 
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index d6baeec91669..6855b096d0fc 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(dot11d_reset);
  * 1. IS_DOT11D_ENABLE() is TRUE.
  * 2. Input IE is an valid one.
  */
-void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
+void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr,
u16 CoutryIeLen, u8 *pCoutryIe)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
@@ -66,14 +66,14 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, 
u8 *pTaddr,
/* It is not in a monotonically increasing order, so
 * stop processing.
 */
-   netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid 
country IE, skip it1\n");
+   netdev_err(dev->dev, "dot11d_update_country_ie(): 
Invalid country IE, skip it1\n");
return;
}
if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + 
pTriple->num_channels)) {
/* It is not a valid set of channel id, so stop
 * processing.
 */
-   netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid 
country IE, skip it2\n");
+   netdev_err(dev->dev, "dot11d_update_country_ie(): 
Invalid country IE, skip it2\n");
return;
}
 
@@ -97,7 +97,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 
*pTaddr,
memcpy(pDot11dInfo->country_ie_buf, pCoutryIe, CoutryIeLen);
pDot11dInfo->state = DOT11D_STATE_LEARNED;
 }
-EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
+EXPORT_SYMBOL(dot11d_update_country_ie);
 
 u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
 {
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 73cf2e6aeb06..a45223171a55 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -45,10 +45,10 @@ struct rt_dot11d_info {
 
 void dot11d_init(struct ieee80211_device *dev);
 void dot11d_reset(struct ieee80211_device *dev);
-void Dot11d_UpdateCountryIe(struct ieee80211_device *dev,
-   u8 *pTaddr,
-   u16 CoutryIeLen,
-   u8 *pCoutryIe);
+void dot11d_update_country_ie(struct ieee80211_device *dev,
+ u8 *pTaddr,
+ u16 CoutryIeLen,
+ u8 *pCoutryIe);
 u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel);
 void DOT11D_ScanComplete(struct ieee80211_device *dev);
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 2c11d3ef63d7..787aefa4656e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1582,7 +1582,7 @@ static inline void ieee80211_extract_country_ie(
 
if (!IS_COUNTRY_IE_VALID(ieee))
{
-   Dot11d_UpdateCountryIe(ieee, addr2, 
info_element->len, info_element->data);
+   dot11d_update_country_ie(ieee, addr2, 
info_element->len, info_element->data);
}
}
 
-- 
2.18.0

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


[PATCH v2 14/15] staging:rtl8192u: Rename IsLegalChannel - Style

2018-08-08 Thread John Whitmore
The function IsLegalChannel causes a checkpatch issue due to its use
of CamelCase naming. The function has been renamed to is_legal_channel.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c   | 8 
 drivers/staging/rtl8192u/ieee80211/dot11d.h   | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 6 +++---
 drivers/staging/rtl8192u/r819xU_phy.c | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index 48911c68b7a4..a116858d151c 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -136,19 +136,19 @@ void dot11d_scan_complete(struct ieee80211_device *dev)
 }
 EXPORT_SYMBOL(dot11d_scan_complete);
 
-int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
+int is_legal_channel(struct ieee80211_device *dev, u8 channel)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 
if (channel > MAX_CHANNEL_NUMBER) {
-   netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
+   netdev_err(dev->dev, "is_legal_channel(): Invalid Channel\n");
return 0;
}
if (pDot11dInfo->channel_map[channel] > 0)
return 1;
return 0;
 }
-EXPORT_SYMBOL(IsLegalChannel);
+EXPORT_SYMBOL(is_legal_channel);
 
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
@@ -164,7 +164,7 @@ int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
}
 
if (channel > MAX_CHANNEL_NUMBER) {
-   netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
+   netdev_err(dev->dev, "is_legal_channel(): Invalid Channel\n");
return default_chn;
}
 
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 00e59e949f82..37c493789608 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -51,7 +51,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
  u8 *coutry_ie);
 u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel);
 void dot11d_scan_complete(struct ieee80211_device *dev);
-int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
+int is_legal_channel(struct ieee80211_device *dev, u8 channel);
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
 
 #endif /* #ifndef __INC_DOT11D_H */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 787aefa4656e..e1897bd4bdc9 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -2439,7 +2439,7 @@ static inline void ieee80211_process_probe_response(
//   then wireless adapter should do active scan from ch1~11 and
//   passive scan from ch12~14
 
-   if (!IsLegalChannel(ieee, network->channel))
+   if (!is_legal_channel(ieee, network->channel))
goto out;
if (ieee->bGlobalDomain)
{
@@ -2448,7 +2448,7 @@ static inline void ieee80211_process_probe_response(
// Case 1: Country code
if(IS_COUNTRY_IE_VALID(ieee) )
{
-   if (!IsLegalChannel(ieee, network->channel)) {
+   if (!is_legal_channel(ieee, network->channel)) {
printk("GetScanInfo(): For Country 
code, filter probe response at channel(%d).\n", network->channel);
goto out;
}
@@ -2469,7 +2469,7 @@ static inline void ieee80211_process_probe_response(
// Case 1: Country code
if(IS_COUNTRY_IE_VALID(ieee) )
{
-   if (!IsLegalChannel(ieee, network->channel)) {
+   if (!is_legal_channel(ieee, network->channel)) {
printk("GetScanInfo(): For Country 
code, filter beacon at channel(%d).\n",network->channel);
goto out;
}
diff --git a/drivers/staging/rtl8192u/r819xU_phy.c 
b/drivers/staging/rtl8192u/r819xU_phy.c
index 7ee10d49894b..0a13a1f8a14d 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -1271,7 +1271,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device 
*dev, u8 channel,
 
RT_TRACE(COMP_CH, "%s() stage: %d, step: %d, channel: %d\n",
 __func__, *stage, *step, channel);
-   if (!IsLegalChannel(priv->ieee80211, channel)) {
+   if (!is_legal_channe

[PATCH v2 05/15] staging:rtl8192u: Rename __pTa - Style

2018-08-08 Thread John Whitmore
The macro parameter __pTa causes a checkpatch issue because of its use
of CamelCase naming. The parameter has this been renamed to addr.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 0f0e10fa645d..0263eca375fe 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -36,8 +36,8 @@ struct rt_dot11d_info {
 #define IS_DOT11D_ENABLE(ieee_dev) (GET_DOT11D_INFO(ieee_dev)->enabled)
 #define IS_COUNTRY_IE_VALID(ieee_dev) 
(GET_DOT11D_INFO(ieee_dev)->country_ie_len > 0)
 
-#define IS_EQUAL_CIE_SRC(ieee_dev, __pTa) 
ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa)
-#define UPDATE_CIE_SRC(ieee_dev, __pTa) 
ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa)
+#define IS_EQUAL_CIE_SRC(ieee_dev, addr) 
ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr)
+#define UPDATE_CIE_SRC(ieee_dev, addr) 
ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr)
 
 #define GET_CIE_WATCHDOG(ieee_dev) 
(GET_DOT11D_INFO(ieee_dev)->country_ie_watchdog)
 #define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)
-- 
2.18.0

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


[PATCH v2 13/15] staging:rtl8192u: Rename DOT11D_ScanComplete - Style

2018-08-08 Thread John Whitmore
The function DOT11D_ScanComplete causes a checkpatch issue due to its
use of CamelCase naming. The function has been renamed to
dot11d_scan_complete.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c| 4 ++--
 drivers/staging/rtl8192u/ieee80211/dot11d.h| 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index 3a11c0ad3f2b..48911c68b7a4 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -115,7 +115,7 @@ u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device 
*dev, u8 Channel)
 }
 EXPORT_SYMBOL(dot11d_get_max_tx_pwr_in_dbm);
 
-void DOT11D_ScanComplete(struct ieee80211_device *dev)
+void dot11d_scan_complete(struct ieee80211_device *dev)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 
@@ -134,7 +134,7 @@ void DOT11D_ScanComplete(struct ieee80211_device *dev)
break;
}
 }
-EXPORT_SYMBOL(DOT11D_ScanComplete);
+EXPORT_SYMBOL(dot11d_scan_complete);
 
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index d4333ea106fd..00e59e949f82 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -50,7 +50,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
  u16 coutry_ie_len,
  u8 *coutry_ie);
 u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel);
-void DOT11D_ScanComplete(struct ieee80211_device *dev);
+void dot11d_scan_complete(struct ieee80211_device *dev);
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 39ed743a1a56..a20c79401dab 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -464,7 +464,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device 
*ieee)
} else {
ieee->sync_scan_hurryup = 0;
if (IS_DOT11D_ENABLE(ieee))
-   DOT11D_ScanComplete(ieee);
+   dot11d_scan_complete(ieee);
mutex_unlock(&ieee->scan_mutex);
}
 }
@@ -504,7 +504,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct 
*work)
return;
 out:
if (IS_DOT11D_ENABLE(ieee))
-   DOT11D_ScanComplete(ieee);
+   dot11d_scan_complete(ieee);
ieee->actscanning = false;
watchdog = 0;
ieee->scanning = 0;
-- 
2.18.0

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


[PATCH v2 15/15] staging:rtl8192u: Rename ToLegalChannel - Style

2018-08-08 Thread John Whitmore
Rename the function ToLegalChannel, which causes a checkpatch issue due
to its use of CamelCase naming. The function has been renamed to
to_legal_channel.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 4 ++--
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c 
b/drivers/staging/rtl8192u/ieee80211/dot11d.c
index a116858d151c..d3b13f0cfc09 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c
@@ -150,7 +150,7 @@ int is_legal_channel(struct ieee80211_device *dev, u8 
channel)
 }
 EXPORT_SYMBOL(is_legal_channel);
 
-int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
+int to_legal_channel(struct ieee80211_device *dev, u8 channel)
 {
struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
u8 default_chn = 0;
@@ -173,4 +173,4 @@ int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
 
return default_chn;
 }
-EXPORT_SYMBOL(ToLegalChannel);
+EXPORT_SYMBOL(to_legal_channel);
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 37c493789608..be59f720ae20 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -52,6 +52,6 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,
 u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 channel);
 void dot11d_scan_complete(struct ieee80211_device *dev);
 int is_legal_channel(struct ieee80211_device *dev, u8 channel);
-int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
+int to_legal_channel(struct ieee80211_device *dev, u8 channel);
 
 #endif /* #ifndef __INC_DOT11D_H */
-- 
2.18.0

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


[PATCH v2 06/15] staging:rtl8192u: Lines should not end with a '(' - Style

2018-08-08 Thread John Whitmore
A number of function prototypes cause a checkpatch issue - "Lines
should not end with a '(' ". This issue has been cleared by moving
function prototype parameters to the same line as the function name.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 47 +
 1 file changed, 10 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 0263eca375fe..0856d5ea7991 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -43,42 +43,15 @@ struct rt_dot11d_info {
 #define RESET_CIE_WATCHDOG(ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)
 #define UPDATE_CIE_WATCHDOG(ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))
 
-void
-Dot11d_Init(
-   struct ieee80211_device *dev
-   );
+void Dot11d_Init(struct ieee80211_device *dev);
+void Dot11d_Reset(struct ieee80211_device *dev);
+void Dot11d_UpdateCountryIe(struct ieee80211_device *dev,
+   u8 *pTaddr,
+   u16 CoutryIeLen,
+   u8 *pCoutryIe);
+u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel);
+void DOT11D_ScanComplete(struct ieee80211_device *dev);
+int IsLegalChannel(struct ieee80211_device *dev, u8 channel);
+int ToLegalChannel(struct ieee80211_device *dev, u8 channel);
 
-void
-Dot11d_Reset(
-   struct ieee80211_device *dev
-   );
-
-void
-Dot11d_UpdateCountryIe(
-   struct ieee80211_device *dev,
-   u8 *pTaddr,
-   u16 CoutryIeLen,
-   u8 *pCoutryIe
-   );
-
-u8
-DOT11D_GetMaxTxPwrInDbm(
-   struct ieee80211_device *dev,
-   u8 Channel
-   );
-
-void
-DOT11D_ScanComplete(
-   struct ieee80211_device *dev
-   );
-
-int IsLegalChannel(
-   struct ieee80211_device *dev,
-   u8 channel
-);
-
-int ToLegalChannel(
-   struct ieee80211_device *dev,
-   u8 channel
-);
 #endif /* #ifndef __INC_DOT11D_H */
-- 
2.18.0

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


[PATCH v2 00/15] staging:rtl8192u: Coding style

2018-08-08 Thread John Whitmore
In this second version of the series I've replaced the macros
eqMacAddr and cpMacAddr with functions suggested by Joe Perches


One issue with this change is that both of the functions now
used, defined in etherdevice.h, rely on the parameters being
u16 aligned. To achieve this I've re-ordered member variables
in two structures. This strikes me as being a bit shaky as
any change to a structure might upset that alignment.

Apart from that my only concern is renaming functions
which are exported symbols. As far as I can see they are
exported using EXPORT_SYMBOL but are not used anywhere.

John Whitmore (15):
  staging:rtl8192u: Remove macro eqMacAddr - Style
  staging:rtl8192u: Remove macro cpMacAddr - Style
  staging:rtl8192u: Replace magic number 6 with ETH_ALEN - Style
  staging:rtl8192u: Rename macro parameter __pIeeeDev - Style
  staging:rtl8192u: Rename __pTa - Style
  staging:rtl8192u: Lines should not end with a '(' - Style
  staging:rtl8192u: Rename Dot11d_Init - Style
  staging:rtl8192u: Rename Dot11d_Reset - Style
  staging:rtl8192u: Rename Dot11d_UpdateCountryIe - Style
  staging:rtl8192u: Rename dot11d_update_country_ie() parameters - Style
  staging:rtl8192u: Rename DOT11D_GetMaxTxPwrInDbm -  Style
  staging:rtl8192u: Rename Channel - Style
  staging:rtl8192u: Rename DOT11D_ScanComplete - Style
  staging:rtl8192u: Rename IsLegalChannel - Style
  staging:rtl8192u: Rename ToLegalChannel - Style

 drivers/staging/rtl8192u/ieee80211/dot11d.c   | 42 +-
 drivers/staging/rtl8192u/ieee80211/dot11d.h   | 77 ++-
 .../staging/rtl8192u/ieee80211/ieee80211.h| 11 +--
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 10 +--
 .../rtl8192u/ieee80211/ieee80211_softmac.c|  6 +-
 drivers/staging/rtl8192u/r8192U_core.c| 10 +--
 drivers/staging/rtl8192u/r819xU_phy.c |  2 +-
 7 files changed, 63 insertions(+), 95 deletions(-)

-- 
2.18.0

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


Re: [PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

2018-08-08 Thread Dan Carpenter
On Wed, Aug 08, 2018 at 11:22:57AM +0200, Greg KH wrote:
> On Sun, Aug 05, 2018 at 09:41:06PM +0200, Frank Werner-Krippendorf wrote:
> > Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix
> > a coding style issue "Statements should start on a tabstop"
> > detected by checkpatch.pl script.
> > 
> > Signed-off-by: Frank Werner-Krippendorf 
> > ---
> >  drivers/staging/rtl8712/rtl871x_event.h | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
> > b/drivers/staging/rtl8712/rtl871x_event.h
> > index 5171379..2e59e8e 100644
> > --- a/drivers/staging/rtl8712/rtl871x_event.h
> > +++ b/drivers/staging/rtl8712/rtl871x_event.h
> > @@ -90,13 +90,13 @@ struct event_node {
> > unsigned char *node;
> > unsigned char evt_code;
> > unsigned short evt_sz;
> > -   /*volatile*/ int *caller_ff_tail;
> > +   int *caller_ff_tail;
> > int caller_ff_sz;
> >  };
> >  
> >  struct c2hevent_queue {
> > -   /*volatile*/ inthead;
> > -   /*volatile*/ inttail;
> 
> Those "volatile" seem to imply that something is needed for these
> variables.  Please check to ensure that these are ok to remove in that
> there is the proper locking for these types of things.
> 

Good news, people!  I have done the audit and there is no locking bug.
These structs can be deleted because they aren't ever used.

Frank, please can you resend?  There may be more unused stuff in here
which I didn't see.

regards,
dan carpenter

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


Re: [PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

2018-08-08 Thread Dan Carpenter
Oh, yeah.  Greg's comments were very clear.

regards,
dan carpenter

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


Re: [PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

2018-08-08 Thread Dan Carpenter
On Wed, Aug 08, 2018 at 10:59:26AM -0500, Larry Finger wrote:
> On 08/08/2018 04:22 AM, Greg KH wrote:
> > On Sun, Aug 05, 2018 at 09:41:06PM +0200, Frank Werner-Krippendorf wrote:
> > > Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix
> > > a coding style issue "Statements should start on a tabstop"
> > > detected by checkpatch.pl script.
> > > 
> > > Signed-off-by: Frank Werner-Krippendorf 
> > > ---
> > >   drivers/staging/rtl8712/rtl871x_event.h | 10 +-
> > >   1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
> > > b/drivers/staging/rtl8712/rtl871x_event.h
> > > index 5171379..2e59e8e 100644
> > > --- a/drivers/staging/rtl8712/rtl871x_event.h
> > > +++ b/drivers/staging/rtl8712/rtl871x_event.h
> > > @@ -90,13 +90,13 @@ struct event_node {
> > >   unsigned char *node;
> > >   unsigned char evt_code;
> > >   unsigned short evt_sz;
> > > - /*volatile*/ int *caller_ff_tail;
> > > + int *caller_ff_tail;
> > >   int caller_ff_sz;
> > >   };
> > >   struct c2hevent_queue {
> > > - /*volatile*/ inthead;
> > > - /*volatile*/ inttail;
> > 
> > Those "volatile" seem to imply that something is needed for these
> > variables.  Please check to ensure that these are ok to remove in that
> > there is the proper locking for these types of things.
> 
> Those in-line comments are there as a warning that these variables are
> special.

I assumed the comments meant that the locking was buggy...

I'm 100% serious.  Normally that's what volatile means in a driver
context.  Then I interpreted Greg's comments as meaning that warnings
are useful because they show us where the locking bugs are so we
shouldn't fix the warning until after we review the locking.

regards,
dan carpenter

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


[PATCH v2] vmbus: add driver_override support

2018-08-08 Thread Stephen Hemminger
Add support for overriding the default driver for a VMBus device
in the same way that it can be done for PCI devices. This patch
adds the /sys/bus/vmbus/devices/.../driver_override file
and the logic for matching.

This is used by driverctl tool to do driver override.
https://gitlab.com/driverctl/driverctl

Signed-off-by: Stephen Hemminger 
---
v2 - no changes since last version.
 this patch seems to have gotten lost.
 driver development list really needs to start using patchwork!

 Documentation/ABI/testing/sysfs-bus-vmbus |  21 
 drivers/hv/vmbus_drv.c| 115 ++
 include/linux/hyperv.h|   1 +
 3 files changed, 118 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-vmbus

diff --git a/Documentation/ABI/testing/sysfs-bus-vmbus 
b/Documentation/ABI/testing/sysfs-bus-vmbus
new file mode 100644
index ..91e6c065973c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-vmbus
@@ -0,0 +1,21 @@
+What:  /sys/bus/vmbus/devices/.../driver_override
+Date:  August 2019
+Contact:   Stephen Hemminger 
+Description:
+   This file allows the driver for a device to be specified which
+   will override standard static and dynamic ID matching.  When
+   specified, only a driver with a name matching the value written
+   to driver_override will have an opportunity to bind to the
+   device.  The override is specified by writing a string to the
+   driver_override file (echo uio_hv_generic > driver_override) and
+   may be cleared with an empty string (echo > driver_override).
+   This returns the device to standard matching rules binding.
+   Writing to driver_override does not automatically unbind the
+   device from its current driver or make any attempt to
+   automatically load the specified driver.  If no driver with a
+   matching name is currently loaded in the kernel, the device
+   will not bind to any driver.  This also allows devices to
+   opt-out of driver binding using a driver_override name such as
+   "none".  Only a single driver may be specified in the override,
+   there is no support for parsing delimiters.
+
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b1b548a21f91..e6d8fdac6d8b 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -498,6 +498,54 @@ static ssize_t device_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(device);
 
+static ssize_t driver_override_store(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
+{
+   struct hv_device *hv_dev = device_to_hv_device(dev);
+   char *driver_override, *old, *cp;
+
+   /* We need to keep extra room for a newline */
+   if (count >= (PAGE_SIZE - 1))
+   return -EINVAL;
+
+   driver_override = kstrndup(buf, count, GFP_KERNEL);
+   if (!driver_override)
+   return -ENOMEM;
+
+   cp = strchr(driver_override, '\n');
+   if (cp)
+   *cp = '\0';
+
+   device_lock(dev);
+   old = hv_dev->driver_override;
+   if (strlen(driver_override)) {
+   hv_dev->driver_override = driver_override;
+   } else {
+   kfree(driver_override);
+   hv_dev->driver_override = NULL;
+   }
+   device_unlock(dev);
+
+   kfree(old);
+
+   return count;
+}
+
+static ssize_t driver_override_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct hv_device *hv_dev = device_to_hv_device(dev);
+   ssize_t len;
+
+   device_lock(dev);
+   len = snprintf(buf, PAGE_SIZE, "%s\n", hv_dev->driver_override);
+   device_unlock(dev);
+
+   return len;
+}
+static DEVICE_ATTR_RW(driver_override);
+
 /* Set up per device attributes in /sys/bus/vmbus/devices/ */
 static struct attribute *vmbus_dev_attrs[] = {
&dev_attr_id.attr,
@@ -528,6 +576,7 @@ static struct attribute *vmbus_dev_attrs[] = {
&dev_attr_channel_vp_mapping.attr,
&dev_attr_vendor.attr,
&dev_attr_device.attr,
+   &dev_attr_driver_override.attr,
NULL,
 };
 ATTRIBUTE_GROUPS(vmbus_dev);
@@ -563,17 +612,26 @@ static inline bool is_null_guid(const uuid_le *guid)
return true;
 }
 
-/*
- * Return a matching hv_vmbus_device_id pointer.
- * If there is no match, return NULL.
- */
-static const struct hv_vmbus_device_id *hv_vmbus_get_id(struct hv_driver *drv,
-   const uuid_le *guid)
+static const struct hv_vmbus_device_id *
+hv_vmbus_dev_match(const struct hv_vmbus_device_id *id, const uuid_le *guid)
+
+{
+   if (id == NULL)
+   return NULL; /* empty device table */

Re: [PATCH] staging: most: do not show interface dependent attrs by default in sysfs

2018-08-08 Thread Greg KH
On Wed, Aug 08, 2018 at 04:51:26PM +0200, Christian Gromm wrote:
> On 08.08.2018 14:10, Greg KH wrote:
> > On Mon, Aug 06, 2018 at 12:03:10PM +0200, Christian Gromm wrote:
> > > The channel attribute dbr_size is only relevant for the DIM2 interface. So
> > > is the packets_per_xact for USB. Currently, all attrs are shown by default
> > > in sysfs for any channel. To get a clean content of a channel directory,
> > > this patch makes the attributes show up only on the channel they belong 
> > > to.
> > > 
> > > Signed-off-by: Christian Gromm 
> > > ---
> > >   drivers/staging/most/core.c  | 12 +---
> > >   drivers/staging/most/core.h  |  5 +
> > >   drivers/staging/most/dim2/dim2.c |  1 +
> > >   drivers/staging/most/usb/usb.c   |  1 +
> > >   4 files changed, 16 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> > > index f4c4646..19694a1 100644
> > > --- a/drivers/staging/most/core.c
> > > +++ b/drivers/staging/most/core.c
> > > @@ -25,6 +25,7 @@
> > >   #define MAX_CHANNELS64
> > >   #define STRING_SIZE 80
> > > +#define MAX_NUM_ATTRS14
> > >   static struct ida mdev_id;
> > >   static int dummy_num_buffers;
> > > @@ -459,7 +460,7 @@ static DEVICE_ATTR_RW(set_subbuffer_size);
> > >   static DEVICE_ATTR_RW(set_packets_per_xact);
> > >   static DEVICE_ATTR_RW(set_dbr_size);
> > > -static struct attribute *channel_attrs[] = {
> > > +static struct attribute *channel_attrs[MAX_NUM_ATTRS] = {
> > 
> > Oh, this is ripe for abuse :)
> > 
> > >   DEV_ATTR(available_directions),
> > >   DEV_ATTR(available_datatypes),
> > >   DEV_ATTR(number_of_packet_buffers),
> > > @@ -472,8 +473,6 @@ static struct attribute *channel_attrs[] = {
> > >   DEV_ATTR(set_direction),
> > >   DEV_ATTR(set_datatype),
> > >   DEV_ATTR(set_subbuffer_size),
> > > - DEV_ATTR(set_packets_per_xact),
> > > - DEV_ATTR(set_dbr_size),
> > >   NULL,
> > >   };
> > > @@ -1416,6 +1415,13 @@ int most_register_interface(struct most_interface 
> > > *iface)
> > >   iface->dev.init_name = iface->p->name;
> > >   iface->dev.bus = &mc.bus;
> > >   iface->dev.parent = &mc.dev;
> > > + if (iface->extra_attrs == XACT_ATTRS) {
> > > + channel_attrs[12] = DEV_ATTR(set_packets_per_xact);
> > > + channel_attrs[13] = NULL;
> > > + } else if (iface->extra_attrs == DBR_ATTRS) {
> > > + channel_attrs[12] = DEV_ATTR(set_dbr_size);
> > > + channel_attrs[13] = NULL;
> > > + }
> > 
> > No, please use the proper way of doing this.  Your attribute can have a
> > callback when it is being created to test if it should be created or
> > not.  Use that, this is exactly what it is there for.
> > 
> Hmm, I don't see how to hook a custom callback to a device attribute
> as its structure does not provide any pointer to do so.
> 
> I went down the rabbit hole staring at "device_register", but
> I couldn't find any code that checks for such a function before
> adding the attributes to sysfs.
> 
> Can you please point out some driver code that makes use of such
> a callback you are talking about? That would be nice.

Look at the use of the "is_visible" callback the struct attribute_group.
That should help you out here.  The kerneldoc for it should give you
enough information to go off of.

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


Re: [PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

2018-08-08 Thread Larry Finger

On 08/08/2018 04:22 AM, Greg KH wrote:

On Sun, Aug 05, 2018 at 09:41:06PM +0200, Frank Werner-Krippendorf wrote:

Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix
a coding style issue "Statements should start on a tabstop"
detected by checkpatch.pl script.

Signed-off-by: Frank Werner-Krippendorf 
---
  drivers/staging/rtl8712/rtl871x_event.h | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
b/drivers/staging/rtl8712/rtl871x_event.h
index 5171379..2e59e8e 100644
--- a/drivers/staging/rtl8712/rtl871x_event.h
+++ b/drivers/staging/rtl8712/rtl871x_event.h
@@ -90,13 +90,13 @@ struct event_node {
unsigned char *node;
unsigned char evt_code;
unsigned short evt_sz;
-   /*volatile*/ int *caller_ff_tail;
+   int *caller_ff_tail;
int caller_ff_sz;
  };
  
  struct c2hevent_queue {

-   /*volatile*/ inthead;
-   /*volatile*/ inttail;


Those "volatile" seem to imply that something is needed for these
variables.  Please check to ensure that these are ok to remove in that
there is the proper locking for these types of things.


Those in-line comments are there as a warning that these variables are special. 
Just because a tool such as checkpatch says to remove them does not mean that 
you should; however, if you want to get rid of the warnings, change the space(s) 
after the "*/" into a tab. That silences the checkpatch warning without removing 
the implicit warning that these variables are special.


NACK.

Keep in mind that when this driver was submitted, it ran checkpatch cleanly. The 
fact that there are now warnings is due to changes in the tool. Following those 
will be a never-ending task.


Larry

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


[PATCH v3] Staging: One Laptop Per Child: fix SPDX-License-Identifier issue

2018-08-08 Thread Arkadiusz Lis
Add SPDX-License-Identifier to the source files.
Remove redundant, old license.

Signed-off-by: Arkadiusz Lis 
---
Changes in v3:
 - change old license to SPDX 
 - adding change summary, missing in v2

 drivers/staging/olpc_dcon/olpc_dcon.c| 5 +
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   | 5 +
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c | 5 +
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 2744c9f..6b714f7 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
  *
@@ -5,10 +6,6 @@
  * Copyright © 2006-2007  Advanced Micro Devices, Inc.
  * Copyright © 2009   VIA Technology, Inc.
  * Copyright (c) 2010-2011  Andres Salomon 
- *
- * This program is free software.  You can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c 
b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
index 633c58c..ff145d4 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
  *
@@ -5,10 +6,6 @@
  * Copyright © 2006-2007  Advanced Micro Devices, Inc.
  * Copyright © 2009   VIA Technology, Inc.
  * Copyright (c) 2010  Andres Salomon 
- *
- * This program is free software.  You can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c 
b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
index 6458442..838daa2 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2009,2010   One Laptop per Child
- *
- * This program is free software.  You can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-- 
1.9.1

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


Re: [PATCH v2] staging/vc04_services: Fix alignment of function arguments

2018-08-08 Thread greg gallagher




On 2018-08-07 09:34 PM, Greg Gallagher wrote:

Fix warnings generated by checkpatch.pl for alignment should match open
parenthesis.  This is a coding style change only.

Signed-off-by: Greg Gallagher 
---
  .../staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index ec468d5719b1..8af303e25036 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -94,7 +94,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol *kcontrol,
  }
  
  static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+  struct snd_ctl_elem_value *ucontrol)
  {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
@@ -174,7 +174,7 @@ static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
  };
  
  static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_info *uinfo)
+ struct snd_ctl_elem_info *uinfo)
  {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -182,7 +182,7 @@ static int snd_bcm2835_spdif_default_info(struct 
snd_kcontrol *kcontrol,
  }
  
  static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+struct snd_ctl_elem_value *ucontrol)
  {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int i;
@@ -199,7 +199,7 @@ static int snd_bcm2835_spdif_default_get(struct 
snd_kcontrol *kcontrol,
  }
  
  static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+struct snd_ctl_elem_value *ucontrol)
  {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
unsigned int val = 0;
@@ -219,7 +219,7 @@ static int snd_bcm2835_spdif_default_put(struct 
snd_kcontrol *kcontrol,
  }
  
  static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_info *uinfo)
+  struct snd_ctl_elem_info *uinfo)
  {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -227,7 +227,7 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol 
*kcontrol,
  }
  
  static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
  {
/*
 * bcm2835 supports only consumer mode and sets all other format flags
@@ -238,7 +238,7 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
  }
  
  static int snd_bcm2835_spdif_stream_info(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_info *uinfo)
+struct snd_ctl_elem_info *uinfo)
  {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -246,7 +246,7 @@ static int snd_bcm2835_spdif_stream_info(struct 
snd_kcontrol *kcontrol,
  }
  
  static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+   struct snd_ctl_elem_value *ucontrol)
  {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int i;
@@ -263,7 +263,7 @@ static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol 
*kcontrol,
  }
  
  static int snd_bcm2835_spdif_stream_put(struct snd_kcontrol *kcontrol,

-   struct snd_ctl_elem_value *ucontrol)
+   struct snd_ctl_elem_value *ucontrol)
  {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
unsigned int val = 0;
Please ignore this patch, a new patch with the correct subject line and 
v2 description has been submitted.


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


Re: [PATCH] staging: most: do not show interface dependent attrs by default in sysfs

2018-08-08 Thread Christian Gromm

On 08.08.2018 14:10, Greg KH wrote:

On Mon, Aug 06, 2018 at 12:03:10PM +0200, Christian Gromm wrote:

The channel attribute dbr_size is only relevant for the DIM2 interface. So
is the packets_per_xact for USB. Currently, all attrs are shown by default
in sysfs for any channel. To get a clean content of a channel directory,
this patch makes the attributes show up only on the channel they belong to.

Signed-off-by: Christian Gromm 
---
  drivers/staging/most/core.c  | 12 +---
  drivers/staging/most/core.h  |  5 +
  drivers/staging/most/dim2/dim2.c |  1 +
  drivers/staging/most/usb/usb.c   |  1 +
  4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index f4c4646..19694a1 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -25,6 +25,7 @@
  
  #define MAX_CHANNELS	64

  #define STRING_SIZE   80
+#define MAX_NUM_ATTRS  14
  
  static struct ida mdev_id;

  static int dummy_num_buffers;
@@ -459,7 +460,7 @@ static DEVICE_ATTR_RW(set_subbuffer_size);
  static DEVICE_ATTR_RW(set_packets_per_xact);
  static DEVICE_ATTR_RW(set_dbr_size);
  
-static struct attribute *channel_attrs[] = {

+static struct attribute *channel_attrs[MAX_NUM_ATTRS] = {


Oh, this is ripe for abuse :)


DEV_ATTR(available_directions),
DEV_ATTR(available_datatypes),
DEV_ATTR(number_of_packet_buffers),
@@ -472,8 +473,6 @@ static struct attribute *channel_attrs[] = {
DEV_ATTR(set_direction),
DEV_ATTR(set_datatype),
DEV_ATTR(set_subbuffer_size),
-   DEV_ATTR(set_packets_per_xact),
-   DEV_ATTR(set_dbr_size),
NULL,
  };
  
@@ -1416,6 +1415,13 @@ int most_register_interface(struct most_interface *iface)

iface->dev.init_name = iface->p->name;
iface->dev.bus = &mc.bus;
iface->dev.parent = &mc.dev;
+   if (iface->extra_attrs == XACT_ATTRS) {
+   channel_attrs[12] = DEV_ATTR(set_packets_per_xact);
+   channel_attrs[13] = NULL;
+   } else if (iface->extra_attrs == DBR_ATTRS) {
+   channel_attrs[12] = DEV_ATTR(set_dbr_size);
+   channel_attrs[13] = NULL;
+   }


No, please use the proper way of doing this.  Your attribute can have a
callback when it is being created to test if it should be created or
not.  Use that, this is exactly what it is there for.


Hmm, I don't see how to hook a custom callback to a device attribute
as its structure does not provide any pointer to do so.

I went down the rabbit hole staring at "device_register", but
I couldn't find any code that checks for such a function before
adding the attributes to sysfs.

Can you please point out some driver code that makes use of such
a callback you are talking about? That would be nice.

all the best,
Chris
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v10 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-08 Thread Sergio Paracuellos
On Wed, Aug 8, 2018 at 2:08 PM, Greg KH  wrote:
> On Mon, Aug 06, 2018 at 10:21:46AM +1000, NeilBrown wrote:
>> On Fri, Aug 03 2018, Sergio Paracuellos wrote:
>>
>> > This patch series include an attempt to avoid the use of custom
>> > read and writes in driver code and use PCI subsystem common ones.
>> >
>> > In order to do this 'map_bus' callback is implemented and also
>> > data structures for driver are included. The regs base address
>> > ranges and data is being readed from device tree and the driver
>> > gets clean a lot of code.
>> >
>> > This patchet also removes all legacy PCI code using now PCI_DRIVERS_GENERIC
>> > kernel api.
>> >
>> > Changes in v10:
>> > - PATCH 1: Do 'ioremap' directly using 'ranges.cpu_addr' from the
>> >   io resource and add it directly as a resource to the resources list
>> >   like mips pci-legacy code do for this. We cannot do anything else 
>> > since
>> >   using new kernel pci generic apis (call to 
>> > 'devm_of_pci_get_host_bridge_resources')
>> >   we get bad io resource getting 'OF_BAD_ADDR' because of the fact 
>> > that the
>> >   io resource for this platform starts in  0x1e16 which is higher 
>> > than
>> >   IO_SPACE_LIMIT (0x). Because of this io resource is not added to 
>> > the resources
>> >   list and system gets into a not working state.
>> > - Other patches rebased and adapted to this changes.
>>
>> And.. we have a winner !!!
>>
>> Tested-by: NeilBrown 
>>
>> I haven't actually looked at the code - just compiled, booted, saw that
>> the SATA drive appears to work.
>
> Yeah!!!  Sergio, nice job.

Thanks, Greg. Is good to see all of this added to the tree :-). New
cleanups comming soon!

>
> greg k-h

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


Re: [PATCH v2] staging/bcm2835-audio: Fix alignment of function arguments - Style

2018-08-08 Thread Greg Kroah-Hartman
On Wed, Aug 08, 2018 at 08:54:49AM -0400, Greg Gallagner wrote:
> On 08/08/2018 08:26 AM, Greg Kroah-Hartman wrote:
> > On Tue, Aug 07, 2018 at 09:40:47PM -0400, Greg Gallagher wrote:
> >> Fix warnings generated by checkpatch.pl for alignment should match open
> >> parenthesis.  This is a coding style change only.
> >>
> >> Signed-off-by: Greg Gallagher 
> >> ---
> >> Changes in v2:
> >> - Clean up all the alignment warnings in the file
> >> ---
> >>  .../staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 18 
> >> +-
> >>  1 file changed, 9 insertions(+), 9 deletions(-)
> > You sent 2 patches that did the same thing, with different subjects :(
> >
> > Please fix up and send only the "correct" one.
> >
> > greg k-h
> Sorry, the first one was a mistake and I should have sent something saying
> to ignore it.  I will double check the second one is correct.  Is there
> a best
> practice when I'd like a patch ignored?

Just respond to the email and say "please ignore this patch" or
something like that.

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


Re: [PATCH 04/17] staging:rtl8192u: Rename eqMacAddr macro - Style

2018-08-08 Thread Joe Perches
On Tue, 2018-08-07 at 22:12 +0100, John Whitmore wrote:
> The eqMacAddr(a, b) macro causes a checkpatch issue, due to CamelCase
> naming, so has been renamed to eq_mac_addr(a, b).
> 
> This is a coding style change which should not impact on runtime code
> execution.
[]
> diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
> b/drivers/staging/rtl8192u/ieee80211/dot11d.h
[]
> @@ -30,7 +30,7 @@ struct rt_dot11d_info {
>   enum dot11d_state state;
>  };
>  
> -#define eqMacAddr(a, b)  (((a)[0] == (b)[0] &&   \
> +#define eq_mac_addr(a, b)(((a)[0] == (b)[0] &&   \
>   (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
>   (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)

I'd check to see if the etherdevice.h ether_addr_equal
would be used instead of this macro.

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


Re: [PATCH v2] staging/bcm2835-audio: Fix alignment of function arguments - Style

2018-08-08 Thread Greg Gallagner
On 08/08/2018 08:26 AM, Greg Kroah-Hartman wrote:
> On Tue, Aug 07, 2018 at 09:40:47PM -0400, Greg Gallagher wrote:
>> Fix warnings generated by checkpatch.pl for alignment should match open
>> parenthesis.  This is a coding style change only.
>>
>> Signed-off-by: Greg Gallagher 
>> ---
>> Changes in v2:
>> - Clean up all the alignment warnings in the file
>> ---
>>  .../staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 18 
>> +-
>>  1 file changed, 9 insertions(+), 9 deletions(-)
> You sent 2 patches that did the same thing, with different subjects :(
>
> Please fix up and send only the "correct" one.
>
> greg k-h
Sorry, the first one was a mistake and I should have sent something saying
to ignore it.  I will double check the second one is correct.  Is there
a best
practice when I'd like a patch ignored?

thanks

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


Re: [PATCH v2] staging/bcm2835-audio: Fix alignment of function arguments - Style

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:40:47PM -0400, Greg Gallagher wrote:
> Fix warnings generated by checkpatch.pl for alignment should match open
> parenthesis.  This is a coding style change only.
> 
> Signed-off-by: Greg Gallagher 
> ---
> Changes in v2:
> - Clean up all the alignment warnings in the file
> ---
>  .../staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 18 
> +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

You sent 2 patches that did the same thing, with different subjects :(

Please fix up and send only the "correct" one.

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


Re: [PATCH v2 15/15] staging: fbtft: Replaces custom debug macro with dev_dbg().

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:30:10PM -0300, Leonardo Brás wrote:
> Changes custom macro to dev_dbg to avoid parameter multiple usage and use of 
> typeof().

linewrap please.

And while this is a good start, please replace the places this custom
macro is called with dev_dbg(), and then delete this macro.  Don't
extend its life with a change like this :(

thanks,

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


Re: [PATCH v2 04/15] staging: fbtft: Fixes some lines long lines (>80) - Style

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:28:42PM -0300, Leonardo Brás wrote:
> Trying to keep the code in the 80-char line limit.
> 
> Signed-off-by: Leonardo Brás 
> 
> diff --git a/drivers/staging/fbtft/fb_ssd1306.c 
> b/drivers/staging/fbtft/fb_ssd1306.c
> index 9276be499303..f5e0ec1c01dc 100644
> --- a/drivers/staging/fbtft/fb_ssd1306.c
> +++ b/drivers/staging/fbtft/fb_ssd1306.c
> @@ -184,7 +184,8 @@ static int write_vmem(struct fbtft_par *par, size_t 
> offset, size_t len)
>   for (y = 0; y < yres / 8; y++) {
>   *buf = 0x00;
>   for (i = 0; i < 8; i++)
> - *buf |= (vmem16[(y * 8 + i) * xres + x] ? 1 : 
> 0) << i;
> + *buf |= (vmem16[(y * 8 + i) * xres + x] ?
> +  1 : 0) << i;
>   buf++;
>   }
>   }
> diff --git a/drivers/staging/fbtft/fb_ssd1331.c 
> b/drivers/staging/fbtft/fb_ssd1331.c
> index 383e197cf56a..e2b3ba82d01f 100644
> --- a/drivers/staging/fbtft/fb_ssd1331.c
> +++ b/drivers/staging/fbtft/fb_ssd1331.c
> @@ -74,7 +74,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, 
> ...)
>   for (i = 0; i < len; i++)
>   buf[i] = (u8)va_arg(args, unsigned int);
>   va_end(args);
> - fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, 
> u8, buf, len, "%s: ", __func__);
> + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device,
> +   u8, buf, len, "%s: ", __func__);
>   }
> 
>   va_start(args, len);
> diff --git a/drivers/staging/fbtft/fb_st7735r.c 
> b/drivers/staging/fbtft/fb_st7735r.c
> index 9670a8989b91..c8e94f388ce5 100644
> --- a/drivers/staging/fbtft/fb_st7735r.c
> +++ b/drivers/staging/fbtft/fb_st7735r.c
> @@ -130,8 +130,10 @@ static int set_var(struct fbtft_par *par)
> 
>  /*
>   * Gamma string format:
> - * VRF0P VOS0P PK0P PK1P PK2P PK3P PK4P PK5P PK6P PK7P PK8P PK9P SELV0P 
> SELV1P SELV62P SELV63P
> - * VRF0N VOS0N PK0N PK1N PK2N PK3N PK4N PK5N PK6N PK7N PK8N PK9N SELV0N 
> SELV1N SELV62N SELV63N
> + * VRF0P VOS0P PK0P PK1P PK2P PK3P PK4P
> + *  PK5P PK6P PK7P PK8P PK9P SELV0P SELV1P SELV62P SELV63P
> + * VRF0N VOS0N PK0N PK1N PK2N PK3N PK4N
> + *  PK5N PK6N PK7N PK8N PK9N SELV0N SELV1N SELV62N SELV63N

Some lines should stay long, please use common sense.  checkpatch is a
guide, not a hard/fast rule.

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


Re: [PATCH v2 11/15] staging: fbtft: Includes description to mutex and spinlock - Style

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:29:31PM -0300, Leonardo Brás wrote:
>  Includes description to mutex and spinlocks, as recommended by checkpatch.pl.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  drivers/staging/fbtft/fbtft.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> index 6ee9ff320567..f771271d497a 100644
> --- a/drivers/staging/fbtft/fbtft.h
> +++ b/drivers/staging/fbtft/fbtft.h
> @@ -203,7 +203,7 @@ struct fbtft_par {
>   u8 *buf;
>   u8 startbyte;
>   struct fbtft_ops fbtftops;
> - spinlock_t dirty_lock;
> + spinlock_t dirty_lock; /*Protects dirty_lines_{start,end}*/

Why no spaces in your comment?

thanks,

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


Re: [PATCH v2 10/15] staging: fbtft: Fixes some defines styles - Style

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:29:25PM -0300, Leonardo Brás wrote:
> Fixing some styles as recommended by checkpatch.pl.
> 
> Signed-off-by: Leonardo Brás 
> ---
>  drivers/staging/fbtft/fbtft-bus.c  | 10 ++
>  drivers/staging/fbtft/fbtft-core.c |  6 --
>  drivers/staging/fbtft/fbtft.h  |  4 ++--
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-bus.c 
> b/drivers/staging/fbtft/fbtft-bus.c
> index 8ce1ff9b6c2a..20d94712cc84 100644
> --- a/drivers/staging/fbtft/fbtft-bus.c
> +++ b/drivers/staging/fbtft/fbtft-bus.c
> @@ -60,11 +60,13 @@ void func(struct fbtft_par *par, int len, ...)
> \
>  out:   \
>   va_end(args); \
>  }
>  \
> -EXPORT_SYMBOL(func);
> +EXPORT_SYMBOL(func)

why did you change this line?

>  
> -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
> -define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
> -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
> +#define no_modf /*No modifier*/

Ick ick ick, no.

> +
> +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, no_modf);
> +define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16);
> +define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, no_modf);



>  
>  void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
>  {
> diff --git a/drivers/staging/fbtft/fbtft-core.c 
> b/drivers/staging/fbtft/fbtft-core.c
> index 64f69d1a3029..8b79353c722a 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -275,6 +275,7 @@ void fbtft_unregister_backlight(struct fbtft_par *par)
>   par->info->bl_dev = NULL;
>   }
>  }
> +EXPORT_SYMBOL(fbtft_unregister_backlight);

You are doing a lot of different things all in one patch, please break
this up into one patch per logical thing.

thanks,

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


Re: [PATCH v2 01/15] staging: fbtft: Changes udelay(n) to usleep_range(n, n + x). - Style

2018-08-08 Thread Greg Kroah-Hartman
On Tue, Aug 07, 2018 at 09:28:00PM -0300, Leonardo Brás wrote:
> Changes some udelay(n) for n >= 10 to usleep_range(n, n+x) as recommended by 
> checkpatch.pl.

Please properly wrap your changelog lines at 72 columns or close to
that.

> 
> Signed-off-by: Leonardo Brás 
> ---
>  drivers/staging/fbtft/fb_agm1264k-fl.c |  2 +-
>  drivers/staging/fbtft/fb_ra8875.c  |  4 ++--
>  drivers/staging/fbtft/fb_tinylcd.c |  2 +-
>  drivers/staging/fbtft/fb_upd161704.c   | 19 +--
>  drivers/staging/fbtft/fb_watterott.c   |  4 ++--
>  5 files changed, 15 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c 
> b/drivers/staging/fbtft/fb_agm1264k-fl.c
> index f6f30f5bf15a..7a24bde7ca8d 100644
> --- a/drivers/staging/fbtft/fb_agm1264k-fl.c
> +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
> @@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)
>   dev_dbg(par->info->device, "%s()\n", __func__);
>  
>   gpio_set_value(par->gpio.reset, 0);
> - udelay(20);
> + usleep_range(20, 25);
>   gpio_set_value(par->gpio.reset, 1);
>   mdelay(120);
>  }
> diff --git a/drivers/staging/fbtft/fb_ra8875.c 
> b/drivers/staging/fbtft/fb_ra8875.c
> index 5d3b76ca74d8..e2a62677b65b 100644
> --- a/drivers/staging/fbtft/fb_ra8875.c
> +++ b/drivers/staging/fbtft/fb_ra8875.c
> @@ -217,7 +217,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int 
> len, ...)
>   }
>   len--;
>  
> - udelay(100);
> + usleep_range(100, 101);

No, that's just shutting checkpatch up and not doing the correct thing
here.  This is not ok, you need to provide a valid range that will
actually help.  What you did here is not going to do fix anything.

sorry,

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


Re: [PATCH] staging: most: do not show interface dependent attrs by default in sysfs

2018-08-08 Thread Greg KH
On Mon, Aug 06, 2018 at 12:03:10PM +0200, Christian Gromm wrote:
> The channel attribute dbr_size is only relevant for the DIM2 interface. So
> is the packets_per_xact for USB. Currently, all attrs are shown by default
> in sysfs for any channel. To get a clean content of a channel directory,
> this patch makes the attributes show up only on the channel they belong to.
> 
> Signed-off-by: Christian Gromm 
> ---
>  drivers/staging/most/core.c  | 12 +---
>  drivers/staging/most/core.h  |  5 +
>  drivers/staging/most/dim2/dim2.c |  1 +
>  drivers/staging/most/usb/usb.c   |  1 +
>  4 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> index f4c4646..19694a1 100644
> --- a/drivers/staging/most/core.c
> +++ b/drivers/staging/most/core.c
> @@ -25,6 +25,7 @@
>  
>  #define MAX_CHANNELS 64
>  #define STRING_SIZE  80
> +#define MAX_NUM_ATTRS14
>  
>  static struct ida mdev_id;
>  static int dummy_num_buffers;
> @@ -459,7 +460,7 @@ static DEVICE_ATTR_RW(set_subbuffer_size);
>  static DEVICE_ATTR_RW(set_packets_per_xact);
>  static DEVICE_ATTR_RW(set_dbr_size);
>  
> -static struct attribute *channel_attrs[] = {
> +static struct attribute *channel_attrs[MAX_NUM_ATTRS] = {

Oh, this is ripe for abuse :)

>   DEV_ATTR(available_directions),
>   DEV_ATTR(available_datatypes),
>   DEV_ATTR(number_of_packet_buffers),
> @@ -472,8 +473,6 @@ static struct attribute *channel_attrs[] = {
>   DEV_ATTR(set_direction),
>   DEV_ATTR(set_datatype),
>   DEV_ATTR(set_subbuffer_size),
> - DEV_ATTR(set_packets_per_xact),
> - DEV_ATTR(set_dbr_size),
>   NULL,
>  };
>  
> @@ -1416,6 +1415,13 @@ int most_register_interface(struct most_interface 
> *iface)
>   iface->dev.init_name = iface->p->name;
>   iface->dev.bus = &mc.bus;
>   iface->dev.parent = &mc.dev;
> + if (iface->extra_attrs == XACT_ATTRS) {
> + channel_attrs[12] = DEV_ATTR(set_packets_per_xact);
> + channel_attrs[13] = NULL;
> + } else if (iface->extra_attrs == DBR_ATTRS) {
> + channel_attrs[12] = DEV_ATTR(set_dbr_size);
> + channel_attrs[13] = NULL;
> + }

No, please use the proper way of doing this.  Your attribute can have a
callback when it is being created to test if it should be created or
not.  Use that, this is exactly what it is there for.

thanks,

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


Re: [PATCH v10 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-08 Thread Greg KH
On Mon, Aug 06, 2018 at 10:21:46AM +1000, NeilBrown wrote:
> On Fri, Aug 03 2018, Sergio Paracuellos wrote:
> 
> > This patch series include an attempt to avoid the use of custom
> > read and writes in driver code and use PCI subsystem common ones.
> >
> > In order to do this 'map_bus' callback is implemented and also
> > data structures for driver are included. The regs base address
> > ranges and data is being readed from device tree and the driver
> > gets clean a lot of code.
> >
> > This patchet also removes all legacy PCI code using now PCI_DRIVERS_GENERIC
> > kernel api.
> >
> > Changes in v10:
> > - PATCH 1: Do 'ioremap' directly using 'ranges.cpu_addr' from the
> >   io resource and add it directly as a resource to the resources list
> >   like mips pci-legacy code do for this. We cannot do anything else 
> > since
> >   using new kernel pci generic apis (call to 
> > 'devm_of_pci_get_host_bridge_resources')
> >   we get bad io resource getting 'OF_BAD_ADDR' because of the fact that 
> > the 
> >   io resource for this platform starts in  0x1e16 which is higher 
> > than 
> >   IO_SPACE_LIMIT (0x). Because of this io resource is not added to 
> > the resources
> >   list and system gets into a not working state.
> > - Other patches rebased and adapted to this changes.
> 
> And.. we have a winner !!!
> 
> Tested-by: NeilBrown 
> 
> I haven't actually looked at the code - just compiled, booted, saw that
> the SATA drive appears to work.

Yeah!!!  Sergio, nice job.

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


Re: [PATCH v6 1/8] media: v4l: Add definitions for MPEG2 slice format and metadata

2018-08-08 Thread Paul Kocialkowski
Hi,

On Sat, 2018-08-04 at 15:30 +0200, Hans Verkuil wrote:
> On 07/25/2018 12:02 PM, Paul Kocialkowski wrote:

[...]

> > diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst 
> > b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> > index abec03937bb3..4e73f62b5163 100644
> > --- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> > +++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> > @@ -60,6 +60,11 @@ Compressed Formats
> >- ``V4L2_PIX_FMT_MPEG2``
> >- 'MPG2'
> >- MPEG2 video elementary stream.
> > +* .. _V4L2-PIX-FMT-MPEG2-SLICE:
> > +
> > +  - ``V4L2_PIX_FMT_MPEG2_SLICE``
> > +  - 'MG2S'
> > +  - MPEG2 parsed slice data, as extracted from the MPEG2 bitstream.
> 
> This does not mention that this requires the use of the Request API and which 
> controls
> are compulsory in the request.

Right, so I will add a more extensive description regarding the intended
use case for this format, covering what controls are required.

> >  * .. _V4L2-PIX-FMT-MPEG4:
> >  
> >- ``V4L2_PIX_FMT_MPEG4``
> > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
> > b/drivers/media/v4l2-core/v4l2-ctrls.c
> > index 3610dce3a4f8..22483d894259 100644
> > --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> > @@ -844,6 +844,8 @@ const char *v4l2_ctrl_get_name(u32 id)
> > case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: return 
> > "Vertical MV Search Range";
> > case V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER: return "Repeat 
> > Sequence Header";
> > case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME:   return "Force 
> > Key Frame";
> > +   case V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS:return "MPEG2 
> > Slice Header";
> > +   case V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION:return "MPEG2 
> > Quantization Matrices";
> 
> Use MPEG-2 instead of MPEG2 in these two descriptions.

Will do!

Cheers,

Paul

> Regards,
> 
>   Hans
> 
> >  
> > /* VPX controls */
> > case V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS:return "VPX 
> > Number of Partitions";
> > @@ -1292,6 +1294,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
> > v4l2_ctrl_type *type,
> > case V4L2_CID_RDS_TX_ALT_FREQS:
> > *type = V4L2_CTRL_TYPE_U32;
> > break;
> > +   case V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS:
> > +   *type = V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS;
> > +   break;
> > +   case V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION:
> > +   *type = V4L2_CTRL_TYPE_MPEG2_QUANTIZATION;
> > +   break;
> > default:
> > *type = V4L2_CTRL_TYPE_INTEGER;
> > break;
> > @@ -1550,6 +1558,7 @@ static void std_log(const struct v4l2_ctrl *ctrl)
> >  static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
> > union v4l2_ctrl_ptr ptr)
> >  {
> > +   struct v4l2_ctrl_mpeg2_slice_params *p_mpeg2_slice_params;
> > size_t len;
> > u64 offset;
> > s64 val;
> > @@ -1612,6 +1621,45 @@ static int std_validate(const struct v4l2_ctrl 
> > *ctrl, u32 idx,
> > return -ERANGE;
> > return 0;
> >  
> > +   case V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS:
> > +   p_mpeg2_slice_params = ptr.p;
> > +
> > +   switch (p_mpeg2_slice_params->intra_dc_precision) {
> > +   case 0: /* 8 bits */
> > +   case 1: /* 9 bits */
> > +   case 11: /* 11 bits */
> > +   break;
> > +   default:
> > +   return -EINVAL;
> > +   }
> > +
> > +   switch (p_mpeg2_slice_params->picture_structure) {
> > +   case 1: /* interlaced top field */
> > +   case 2: /* interlaced bottom field */
> > +   case 3: /* progressive */
> > +   break;
> > +   default:
> > +   return -EINVAL;
> > +   }
> > +
> > +   switch (p_mpeg2_slice_params->slice_type) {
> > +   case V4L2_MPEG2_SLICE_TYPE_I:
> > +   case V4L2_MPEG2_SLICE_TYPE_P:
> > +   case V4L2_MPEG2_SLICE_TYPE_B:
> > +   break;
> > +   default:
> > +   return -EINVAL;
> > +   }
> > +
> > +   if (p_mpeg2_slice_params->backward_ref_index > VIDEO_MAX_FRAME 
> > ||
> > +   p_mpeg2_slice_params->forward_ref_index > VIDEO_MAX_FRAME)
> > +   return -EINVAL;
> > +
> > +   return 0;
> > +
> > +   case V4L2_CTRL_TYPE_MPEG2_QUANTIZATION:
> > +   return 0;
> > +
> > default:
> > return -EINVAL;
> > }
> > @@ -2186,6 +2234,12 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct 
> > v4l2_ctrl_handler *hdl,
> > case V4L2_CTRL_TYPE_U32:
> > elem_size = sizeof(u32);
> > break;
> > +   case V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS:
> > +   elem_size = sizeof(struct v4l2_ctrl_mpeg2_slice_params);
> > +   break;
> > +   case V4L2_

Re: [PATCH v6 1/8] media: v4l: Add definitions for MPEG2 slice format and metadata

2018-08-08 Thread Paul Kocialkowski
Hi Hans,

On Sat, 2018-08-04 at 13:35 +0200, Hans Verkuil wrote:
> Hi Paul,
> 
> Some comments below. It looks pretty good, it's mostly small things that I
> commented upon.

And thanks for the review!

> On 07/25/2018 12:02 PM, Paul Kocialkowski wrote:
> > Stateless video decoding engines require both the MPEG slices and
> > associated metadata from the video stream in order to decode frames.
> > 
> > This introduces definitions for a new pixel format, describing buffers
> > with MPEG2 slice data, as well as a control structure for passing the
> > frame metadata to drivers.
> > 
> > This is based on work from both Florent Revest and Hugues Fruchet.
> > 
> > Signed-off-by: Paul Kocialkowski 
> > ---
> >  .../media/uapi/v4l/extended-controls.rst  | 122 ++
> >  .../media/uapi/v4l/pixfmt-compressed.rst  |   5 +
> >  drivers/media/v4l2-core/v4l2-ctrls.c  |  54 
> >  drivers/media/v4l2-core/v4l2-ioctl.c  |   1 +
> >  include/media/v4l2-ctrls.h|  18 ++-
> >  include/uapi/linux/v4l2-controls.h|  43 ++
> >  include/uapi/linux/videodev2.h|   5 +
> >  7 files changed, 241 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst 
> > b/Documentation/media/uapi/v4l/extended-controls.rst
> > index 9f7312bf3365..4a29d89fd9ac 100644
> > --- a/Documentation/media/uapi/v4l/extended-controls.rst
> > +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> > @@ -1497,6 +1497,128 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
> >  
> >  
> >  
> > +.. _v4l2-mpeg-mpeg2:
> > +
> > +``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
> > +Specifies the slice parameters (also known as slice header) for the
> > +associated MPEG-2 slice data. This includes all the necessary
> > +parameters for configuring a hardware decoder pipeline for MPEG-2.
> 
> This seems to be mostly a representation of the MPEG-2 "Picture coding
> extension" (6.2.3.1 in ISO/IEC 13818-2: 1995).
> ISO/IEC 13818-2
> Is that correct? I think some references to the standard should be added
> were appropriate.

The structure does contain fields from the picture coding extension, but
also takes some bits from other parts of the bitstream. I have added
references to the specs and split out the different parts of the
structure for the next revision. I also took the occasion to add/rename
some fields to stick closer to the bitstream fields.

> > +
> > +.. tabularcolumns:: |p{2.0cm}|p{4.0cm}|p{11.0cm}|
> > +
> > +.. c:type:: v4l2_ctrl_mpeg2_slice_params
> > +
> > +.. cssclass:: longtable
> > +
> > +.. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
> > +:header-rows:  0
> > +:stub-columns: 0
> > +:widths:   1 1 2
> > +
> > +* - __u32
> > +  - ``slice_len``
> > +  - Length (in bits) of the current slice data.
> > +* - __u32
> > +  - ``slice_pos``
> > +  - Position (in bits) of the current slice data, relative to the
> > +frame start.
> > +* - __u16
> > +  - ``width``
> > +  - Width of the corresponding output frame for the current slice.
> > +* - __u16
> > +  - ``height``
> > +  - Height of the corresponding output frame for the current slice.
> > +* - __u8
> > +  - ``slice_type``
> > +  - Picture coding type for the frame covered by the current slice
> > +(V4L2_MPEG2_SLICE_TYPE_I, V4L2_MPEG2_SLICE_TYPE_P or
> > +V4L2_MPEG2_SLICE_PCT_B).
> > +* - __u8
> > +  - ``f_code[2][2]``
> > +  - Motion vector codes.
> > +* - __u8
> > +  - ``intra_dc_precision``
> > +  - Precision of Discrete Cosine transform (0: 8 bits precision,
> > +1: 9 bits precision, 2: 10 bits precision, 11: 11 bits precision).
> > +* - __u8
> > +  - ``picture_structure``
> > +  - Picture structure (1: interlaced top field,
> > +2: interlaced bottom field, 3: progressive frame).
> > +* - __u8
> > +  - ``top_field_first``
> > +  - If set to 1 and interlaced stream, top field is output first.
> > +* - __u8
> > +  - ``frame_pred_frame_dct``
> > +  - If set to 1, only frame-DCT and frame prediction are used.
> > +* - __u8
> > +  - ``concealment_motion_vectors``
> > +  -  If set to 1, motion vectors are coded for intra macroblocks.
> > +* - __u8
> > +  - ``q_scale_type``
> > +  - This flag affects the inverse quantisation process.
> 
> quantization
> 
> The american spelling appears to be the standard in our documentation, so
> let's stick to that.

I see, that makes sense.

> > +* - __u8
> > +  - ``intra_vlc_format``
> > +  - This flag affects the decoding of transform coefficient data.
> > +* - __u8
> > +  - ``alternate_scan``
> > +  - This flag affects the decoding of transform coefficient data.
> > +* - __u8
> > +  - ``backward_ref_index``
> > +  - Index for the V4L2 buffer to use as backward reference, used w

[PATCH] staging: rtl8188eu: remove unused mp_custom_oid.h

2018-08-08 Thread Michael Straube
The header mp_custom_oid.h is not used, so remove it.
'git grep mp_custom_oid.h drivers/staging/rtl8188eu/'
returns nothing.

Signed-off-by: Michael Straube 
---
 .../staging/rtl8188eu/include/mp_custom_oid.h | 339 --
 1 file changed, 339 deletions(-)
 delete mode 100644 drivers/staging/rtl8188eu/include/mp_custom_oid.h

diff --git a/drivers/staging/rtl8188eu/include/mp_custom_oid.h 
b/drivers/staging/rtl8188eu/include/mp_custom_oid.h
deleted file mode 100644
index 8dd8451cbad0..
--- a/drivers/staging/rtl8188eu/include/mp_custom_oid.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/**
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- 
**/
-#ifndef__CUSTOM_OID_H
-#define __CUSTOM_OID_H
-
-/*  by Owen */
-/*  0xFF818000 - 0xFF81802FRTL8180 Mass Production Kit */
-/*  0xFF818500 - 0xFF81850FRTL8185 Setup Utility */
-/*  0xFF818580 - 0xFF81858FRTL8185 Phy Status Utility */
-
-/*  */
-
-/*  by Owen for Production Kit */
-/*  For Production Kit with Agilent Equipments */
-/*  in order to make our custom oids hopefully somewhat unique */
-/*  we will use 0xFF (indicating implementation specific OID) */
-/* 81(first byte of non zero Realtek unique identifier) */
-/* 80 (second byte of non zero Realtek unique identifier) */
-/* XX (the custom OID number - providing 255 possible custom oids) */
-
-#define OID_RT_PRO_RESET_DUT   0xFF818000
-#define OID_RT_PRO_SET_DATA_RATE   0xFF818001
-#define OID_RT_PRO_START_TEST  0xFF818002
-#define OID_RT_PRO_STOP_TEST   0xFF818003
-#define OID_RT_PRO_SET_PREAMBLE0xFF818004
-#define OID_RT_PRO_SET_SCRAMBLER   0xFF818005
-#define OID_RT_PRO_SET_FILTER_BB   0xFF818006
-#define OID_RT_PRO_SET_MANUAL_DIVERSITY_BB 0xFF818007
-#define OID_RT_PRO_SET_CHANNEL_DIRECT_CALL 0xFF818008
-#define OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL  0xFF818009
-#define OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL   0xFF81800A
-
-#define OID_RT_PRO_SET_TX_ANTENNA_BB   0xFF81800D
-#define OID_RT_PRO_SET_ANTENNA_BB  0xFF81800E
-#define OID_RT_PRO_SET_CR_SCRAMBLER0xFF81800F
-#define OID_RT_PRO_SET_CR_NEW_FILTER   0xFF818010
-#define OID_RT_PRO_SET_TX_POWER_CONTROL0xFF818011
-#define OID_RT_PRO_SET_CR_TX_CONFIG0xFF818012
-#define OID_RT_PRO_GET_TX_POWER_CONTROL0xFF818013
-#define OID_RT_PRO_GET_CR_SIGNAL_QUALITY   0xFF818014
-#define OID_RT_PRO_SET_CR_SETPOINT 0xFF818015
-#define OID_RT_PRO_SET_INTEGRATOR  0xFF818016
-#define OID_RT_PRO_SET_SIGNAL_QUALITY  0xFF818017
-#define OID_RT_PRO_GET_INTEGRATOR  0xFF818018
-#define OID_RT_PRO_GET_SIGNAL_QUALITY  0xFF818019
-#define OID_RT_PRO_QUERY_EEPROM_TYPE   0xFF81801A
-#define OID_RT_PRO_WRITE_MAC_ADDRESS   0xFF81801B
-#define OID_RT_PRO_READ_MAC_ADDRESS0xFF81801C
-#define OID_RT_PRO_WRITE_CIS_DATA  0xFF81801D
-#define OID_RT_PRO_READ_CIS_DATA   0xFF81801E
-#define OID_RT_PRO_WRITE_POWER_CONTROL 0xFF81801F
-#define OID_RT_PRO_READ_POWER_CONTROL  0xFF818020
-#define OID_RT_PRO_WRITE_EEPROM0xFF818021
-#define OID_RT_PRO_READ_EEPROM 0xFF818022
-#define OID_RT_PRO_RESET_TX_PACKET_SENT0xFF818023
-#define OID_RT_PRO_QUERY_TX_PACKET_SENT0xFF818024
-#define OID_RT_PRO_RESET_RX_PACKET_RECEIVED0xFF818025
-#define OID_RT_PRO_QUERY_RX_PACKET_RECEIVED0xFF818026
-#define OID_RT_PRO_QUERY_RX_PACKET_CRC32_ERROR 0xFF818027
-#define OID_RT_PRO_QUERY_CURRENT_ADDRESS   0xFF818028
-#define OID_RT_PRO_QUERY_PERMANENT_ADDRESS 0xFF818029
-#define OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS   0xFF81802A
-#define OID_RT_PRO_RECEIVE_PACKET  0xFF81802C
-/*  added by Owen on 04/08/03 for Cameo's request */
-#define OID_RT_PRO_WRITE_EEPROM_BYTE   0xFF81802D
-#define OID_RT_PRO_READ_EEPROM_BYTE0xFF81802E
-#define OID_RT_PRO_SET_MODULATION  0xFF81802F
-/*  */
-
-/* Sean */
-#define OID_RT_DRIVER_OPTION   0xFF818080
-#define OID_RT_RF_OFF  0xFF818081
-#define OID_RT_AUTH_STATUS 0xFF818082
-
-/*  */
-#define OID_RT_PRO_SET_CONTINUOUS_TX 

Re: [PATCH 05/17] staging:rtl8192u: Rename cpMacAddr Macro - Style

2018-08-08 Thread Joe Perches
On Tue, 2018-08-07 at 22:12 +0100, John Whitmore wrote:
> Rename the Macro cpMacAddr(des, src), as it causes a checkpatch issue
> due its use of CamelCase naming, to cp_mac_addr(des, src).
[]
> diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
> b/drivers/staging/rtl8192u/ieee80211/dot11d.h
[]
> @@ -33,7 +33,7 @@ struct rt_dot11d_info {
>  #define eq_mac_addr(a, b)(((a)[0] == (b)[0] &&   \
>   (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
>   (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
> -#define cpMacAddr(des, src)((des)[0] = (src)[0], \
> +#define cp_mac_addr(des, src)  ((des)[0] = (src)[0], \
>   (des)[1] = (src)[1], (des)[2] = (src)[2], \
>   (des)[3] = (src)[3], (des)[4] = (src)[4], \
>   (des)[5] = (src)[5])

And this could be ether_addr_copy

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


[PATCH] ddk750_mode.c: Wraps line to 80 charecters

2018-08-08 Thread Abishek V Ashok
Splits definition of function programModeRegisters into two lines such
that each line is less than 80 characters.

Signed-off-by: Abishek V Ashok 
---
 drivers/staging/sm750fb/ddk750_mode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_mode.c 
b/drivers/staging/sm750fb/ddk750_mode.c
index 7e22d093b..57cf9e6a5 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -13,8 +13,8 @@
  * HW only supports 7 predefined pixel clocks, and clock select is
  * in bit 29:27 of Display Control register.
  */
-static unsigned long displayControlAdjust_SM750LE(struct mode_parameter 
*pModeParam,
- unsigned long dispControl)
+static unsigned long displayControlAdjust_SM750LE(
+   struct mode_parameter *pModeParam, unsigned long dispControl)
 {
unsigned long x, y;
 
-- 
2.18.0

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


Re: [PATCH v6 4/8] media: platform: Add Cedrus VPU decoder driver

2018-08-08 Thread Paul Kocialkowski
Hi,

On Mon, 2018-08-06 at 16:21 +0200, Paul Kocialkowski wrote:
> Hi,
> 
> On Fri, 2018-08-03 at 17:49 -0300, Ezequiel Garcia wrote:
> > On Wed, 2018-07-25 at 12:02 +0200, Paul Kocialkowski wrote:
> > > This introduces the Cedrus VPU driver that supports the VPU found in
> > > Allwinner SoCs, also known as Video Engine. It is implemented through
> > > a v4l2 m2m decoder device and a media device (used for media requests).
> > > So far, it only supports MPEG2 decoding.
> > > 
> > > Since this VPU is stateless, synchronization with media requests is
> > > required in order to ensure consistency between frame headers that
> > > contain metadata about the frame to process and the raw slice data that
> > > is used to generate the frame.
> > > 
> > > This driver was made possible thanks to the long-standing effort
> > > carried out by the linux-sunxi community in the interest of reverse
> > > engineering, documenting and implementing support for Allwinner VPU.
> > > 
> > > Signed-off-by: Paul Kocialkowski 
> > 
> > [..]
> > > +static int cedrus_probe(struct platform_device *pdev)
> > > +{
> > > + struct cedrus_dev *dev;
> > > + struct video_device *vfd;
> > > + int ret;
> > > +
> > > + dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> > > + if (!dev)
> > > + return -ENOMEM;
> > > +
> > > + dev->dev = &pdev->dev;
> > > + dev->pdev = pdev;
> > > +
> > > + ret = cedrus_hw_probe(dev);
> > > + if (ret) {
> > > + dev_err(&pdev->dev, "Failed to probe hardware\n");
> > > + return ret;
> > > + }
> > > +
> > > + dev->dec_ops[CEDRUS_CODEC_MPEG2] = &cedrus_dec_ops_mpeg2;
> > > +
> > > + mutex_init(&dev->dev_mutex);
> > > + spin_lock_init(&dev->irq_lock);
> > > +
> > 
> > A minor thing.
> > 
> > I believe this spinlock is not needed. All the data structures
> > it's accessing are already protected, and some operations
> > (stop_streaming) are guaranteed to not run at the same
> > time as a job.
> 
> I think we were afraid of this kind of scenario happening, but
> everything seems to indicate that these data structures are already
> properly protected by the core, as you're suggesting.
> 
> Removing the lock does not cause any noticeable issue at first try, but
> I'd like to test decoding for a few hours in a row to reduce the
> probability of missing a corner case that our lock was preventing.

After testing for several hours in a row, I got some cases of CPU stall
which did not happen with the driver lock. So it seems safer to keep the
lock around for now and maybe revisit this later, when there is time to
investigate why it is needed.

Cheers,

Paul

> If that goes well, I guess we can remove it from our driver.
> 
> Cheers,
> 
> Paul
> 
-- 
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com


signature.asc
Description: This is a digitally signed message part
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"

2018-08-08 Thread Greg KH
On Sun, Aug 05, 2018 at 09:41:06PM +0200, Frank Werner-Krippendorf wrote:
> Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix
> a coding style issue "Statements should start on a tabstop"
> detected by checkpatch.pl script.
> 
> Signed-off-by: Frank Werner-Krippendorf 
> ---
>  drivers/staging/rtl8712/rtl871x_event.h | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
> b/drivers/staging/rtl8712/rtl871x_event.h
> index 5171379..2e59e8e 100644
> --- a/drivers/staging/rtl8712/rtl871x_event.h
> +++ b/drivers/staging/rtl8712/rtl871x_event.h
> @@ -90,13 +90,13 @@ struct event_node {
>   unsigned char *node;
>   unsigned char evt_code;
>   unsigned short evt_sz;
> - /*volatile*/ int *caller_ff_tail;
> + int *caller_ff_tail;
>   int caller_ff_sz;
>  };
>  
>  struct c2hevent_queue {
> - /*volatile*/ inthead;
> - /*volatile*/ inttail;

Those "volatile" seem to imply that something is needed for these
variables.  Please check to ensure that these are ok to remove in that
there is the proper locking for these types of things.

thanks,

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


Re: [PATCH 00/15] staging: gasket: unwrap pci core and more

2018-08-08 Thread Greg Kroah-Hartman
On Sun, Aug 05, 2018 at 01:07:34PM -0700, Todd Poynor wrote:
> From: Todd Poynor 
> 
> Stop wrapping PCI core calls like probe, enable, remove, etc. in the
> gasket framework, move these calls to the device driver instead.  Have
> gasket drivers call into framework on init, enable, disable,
> etc. sequences, rather than the other way around.  Remove the
> gasket-to-device callbacks associated with these sequences.
> 
> Plus a few other fixes and cleanups.
> 
> Todd Poynor (15):
>   staging: gasket: sysfs: clean up state if ENOMEM removing mapping
>   staging: gasket: core: move core PCI calls to device drivers
>   staging: gasket: apex: move PCI core calls to apex driver
>   staging: gasket: core: convert remaining info logs to debug
>   staging: gasket: core: remove device enable and disable callbacks
>   staging: gasket: apex: remove device enable and disable callbacks
>   staging: gasket: core: let device driver enable/disable gasket device
>   staging: gasket: apex: enable/disable gasket device from apex
>   staging: gasket: core: delete device add and remove callbacks
>   staging: gasket: apex: fold device add/remove logic inline
>   staging: gasket: core: remove sysfs setup and cleanup callbacks
>   staging: gasket: apex: move sysfs setup code to probe function
>   staging: gasket: core: protect against races during unregister
>   staging: gasket: apex: place in low power reset until opened
>   staging: gasket: core: remove incorrect extraneous comment
> 
>  drivers/staging/gasket/apex_driver.c  | 145 +-
>  drivers/staging/gasket/gasket_core.c  | 140 ++---
>  drivers/staging/gasket/gasket_core.h  |  82 +++
>  drivers/staging/gasket/gasket_sysfs.c |  13 ++-
>  4 files changed, 148 insertions(+), 232 deletions(-)

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


Re: [PATCH 04/15] staging: gasket: core: convert remaining info logs to debug

2018-08-08 Thread Greg Kroah-Hartman
On Sun, Aug 05, 2018 at 01:07:38PM -0700, Todd Poynor wrote:
> From: Todd Poynor 
> 
> Remaining info-level logs in gasket core converted to debug-level; the
> information is not needed during normal system operation.
> 
> Signed-off-by: Todd Poynor 
> ---
>  drivers/staging/gasket/gasket_core.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/gasket/gasket_core.c 
> b/drivers/staging/gasket/gasket_core.c
> index 01cafe1ff6605..2741256eacfe8 100644
> --- a/drivers/staging/gasket/gasket_core.c
> +++ b/drivers/staging/gasket/gasket_core.c
> @@ -1819,7 +1819,7 @@ void gasket_unregister_device(const struct 
> gasket_driver_desc *driver_desc)
>   g_descs[desc_idx].driver_desc = NULL;
>   mutex_unlock(&g_mutex);
>  
> - pr_info("removed %s driver\n", driver_desc->name);
> + pr_debug("removed %s driver\n", driver_desc->name);
>  }
>  EXPORT_SYMBOL(gasket_unregister_device);
>  
> @@ -1827,7 +1827,7 @@ static int __init gasket_init(void)
>  {
>   int i;
>  
> - pr_info("Performing one-time init of the Gasket framework.\n");
> + pr_debug("%s\n", __func__);

Lines like this should just be deleted, that is what ftrace is for :)

>   /* Check for duplicates and find a free slot. */
>   mutex_lock(&g_mutex);
>   for (i = 0; i < GASKET_FRAMEWORK_DESC_MAX; i++) {
> @@ -1843,8 +1843,7 @@ static int __init gasket_init(void)
>  
>  static void __exit gasket_exit(void)
>  {
> - /* No deinit/dealloc needed at present. */
> - pr_info("Removing Gasket framework module.\n");
> + pr_debug("%s\n", __func__);

No need to have an exit function at all, right?

I'll take this for now, as this is the last day for me to take patches
for 4.19-rc1, but keep this in mind for the future.

thanks,

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


Re: [PATCH 04/17] staging:rtl8192u: Rename eqMacAddr macro - Style

2018-08-08 Thread John Whitmore
On Wed, Aug 08, 2018 at 01:12:53AM -0700, Joe Perches wrote:
> On Tue, 2018-08-07 at 22:12 +0100, John Whitmore wrote:
> > The eqMacAddr(a, b) macro causes a checkpatch issue, due to CamelCase
> > naming, so has been renamed to eq_mac_addr(a, b).
> > 
> > This is a coding style change which should not impact on runtime code
> > execution.
> []
> > diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h 
> > b/drivers/staging/rtl8192u/ieee80211/dot11d.h
> []
> > @@ -30,7 +30,7 @@ struct rt_dot11d_info {
> > enum dot11d_state state;
> >  };
> >  
> > -#define eqMacAddr(a, b)(((a)[0] == (b)[0] &&   \
> > +#define eq_mac_addr(a, b)  (((a)[0] == (b)[0] &&   \
> > (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
> > (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
> 
> I'd check to see if the etherdevice.h ether_addr_equal
> would be used instead of this macro.
> 

Deadly thanks a million for that input! That Macro gives a checkpatch
warning about the obvious side effects, which I have yet to tackle. I'm
cherry picking the easy stuff ;) getting to know my way around.

I'll check that other macro later today and hopefully reissue a better
v2 of the series. (same for your second email on the other macro)

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