[PATCH 1/2] staging: erofs: fix compile error without built-in decompression support

2018-07-28 Thread Gao Xiang
This patch fixes incorrect code snippets due to spilt code
into small patches by mistake.

Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050747.html
Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050750.html
Reported-by: kbuild test robot 
Signed-off-by: Gao Xiang 
---
 I test several Kconfig option combinations and all these
combinations are successfully compiled.

Hi Chao,
 Could you please review this two patches first before merging
into staging-next tree?

Thanks,
Gao Xiang

 drivers/staging/erofs/internal.h  | 4 ++--
 drivers/staging/erofs/super.c | 2 +-
 drivers/staging/erofs/unzip_vle.c | 7 ---
 drivers/staging/erofs/utils.c | 7 ---
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h
index 669f93ae6920..367b39fe46e5 100644
--- a/drivers/staging/erofs/internal.h
+++ b/drivers/staging/erofs/internal.h
@@ -260,9 +260,9 @@ static inline void erofs_workstation_cleanup_all(struct 
super_block *sb)
 #ifdef EROFS_FS_HAS_MANAGED_CACHE
 #define EROFS_UNALLOCATED_CACHED_PAGE  ((void *)0x5F0EF00D)
 
-extern int try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
+extern int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
struct erofs_workgroup *egrp);
-extern int try_to_free_cached_page(struct address_space *mapping,
+extern int erofs_try_to_free_cached_page(struct address_space *mapping,
struct page *page);
 #endif
 
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 97da5c8a8ef3..1aec509c805f 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -269,7 +269,7 @@ static int managed_cache_releasepage(struct page *page, 
gfp_t gfp_mask)
BUG_ON(mapping->a_ops != _cache_aops);
 
if (PagePrivate(page))
-   ret = try_to_free_cached_page(mapping, page);
+   ret = erofs_try_to_free_cached_page(mapping, page);
 
return ret;
 }
diff --git a/drivers/staging/erofs/unzip_vle.c 
b/drivers/staging/erofs/unzip_vle.c
index 7671fe8194ce..0e410a228cd4 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -131,8 +131,8 @@ static bool grab_managed_cache_pages(struct address_space 
*mapping,
 }
 
 /* called by erofs_shrinker to get rid of all compressed_pages */
-int try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
-struct erofs_workgroup *egrp)
+int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
+  struct erofs_workgroup *egrp)
 {
struct z_erofs_vle_workgroup *const grp =
container_of(egrp, struct z_erofs_vle_workgroup, obj);
@@ -166,7 +166,8 @@ int try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
return 0;
 }
 
-int try_to_free_cached_page(struct address_space *mapping, struct page *page)
+int erofs_try_to_free_cached_page(struct address_space *mapping,
+ struct page *page)
 {
struct erofs_sb_info *const sbi = EROFS_SB(mapping->host->i_sb);
const unsigned int clusterpages = erofs_clusterpages(sbi);
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index ee70bb9e1636..595cf90af9bb 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -160,7 +160,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info 
*sbi,
}
 
 #ifdef EROFS_FS_HAS_MANAGED_CACHE
-   if (try_to_free_all_cached_pages(sbi, grp))
+   if (erofs_try_to_free_all_cached_pages(sbi, grp))
goto skip;
 
erofs_workgroup_unfreeze(grp, 1);
@@ -247,7 +247,9 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink,
spin_unlock(_sb_list_lock);
sbi->shrinker_run_no = run_no;
 
-   /* add scan handlers here */
+#ifdef CONFIG_EROFS_FS_ZIP
+   freed += erofs_shrink_workstation(sbi, nr, false);
+#endif
 
spin_lock(_sb_list_lock);
/* Get the next list element before we move this one */
@@ -260,7 +262,6 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink,
list_move_tail(>list, _sb_list);
mutex_unlock(>umount_mutex);
 
-   freed += erofs_shrink_workstation(sbi, nr, false);
if (freed >= nr)
break;
}
-- 
2.17.1

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


[PATCH 2/2] staging: erofs: fix conditional uninitialized `pcn' in z_erofs_map_blocks_iter

2018-07-28 Thread Gao Xiang
This patch adds error handling code for
z_erofs_map_blocks_iter to fix the compiler blame.

Signed-off-by: Gao Xiang 
---

let's solve the compiler warning first, more error handling code
for other functions will be added in the future patch.

 drivers/staging/erofs/unzip_vle.c | 25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/erofs/unzip_vle.c 
b/drivers/staging/erofs/unzip_vle.c
index 0e410a228cd4..bd2d7a8d5085 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -1532,13 +1532,14 @@ int z_erofs_map_blocks_iter(struct inode *inode,
unsigned long long ofs, end;
struct z_erofs_vle_decompressed_index *di;
erofs_blk_t e_blkaddr, pcn;
-   unsigned lcn, logical_cluster_ofs;
+   unsigned lcn, logical_cluster_ofs, cluster_type;
u32 ofs_rem;
struct page *mpage = *mpage_ret;
void *kaddr;
bool initial;
const unsigned int clusterbits = EROFS_SB(inode->i_sb)->clusterbits;
const unsigned int clustersize = 1 << clusterbits;
+   int err = 0;
 
/* if both m_(l,p)len are 0, regularize l_lblk, l_lofs, etc... */
initial = !map->m_llen;
@@ -1592,7 +1593,9 @@ int z_erofs_map_blocks_iter(struct inode *inode,
 
end = (u64)(lcn + 1) * clustersize;
 
-   switch (vle_cluster_type(di)) {
+   cluster_type = vle_cluster_type(di);
+
+   switch (cluster_type) {
case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:
if (ofs_rem >= logical_cluster_ofs)
map->m_flags ^= EROFS_MAP_ZIPPED;
@@ -1608,13 +1611,24 @@ int z_erofs_map_blocks_iter(struct inode *inode,
break;
}
 
-   BUG_ON(!lcn);   /* logical cluster number >= 1 */
+   /* logical cluster number should be >= 1 */
+   if (unlikely(!lcn)) {
+   errln("invalid logical cluster 0 at nid %llu",
+   EROFS_V(inode)->nid);
+   err = -EIO;
+   goto unmap_out;
+   }
end = (lcn-- * clustersize) | logical_cluster_ofs;
case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD:
/* get the correspoinding first chunk */
ofs = vle_get_logical_extent_head(inode, mpage_ret,
, lcn, , >m_flags);
mpage = *mpage_ret;
+   default:
+   errln("unknown cluster type %u at offset %llu of nid %llu",
+   cluster_type, ofs, EROFS_V(inode)->nid);
+   err = -EIO;
+   goto unmap_out;
}
 
map->m_la = ofs;
@@ -1630,6 +1644,9 @@ int z_erofs_map_blocks_iter(struct inode *inode,
debugln("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o",
__func__, map->m_la, map->m_pa,
map->m_llen, map->m_plen, map->m_flags);
-   return 0;
+
+   /* aggressively BUG_ON iff CONFIG_EROFS_FS_DEBUG is on */
+   DBG_BUGON(err < 0);
+   return err;
 }
 
-- 
2.17.1

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


[staging:staging-next 560/569] drivers/staging//erofs/utils.c:189:12: error: implicit declaration of function 'erofs_shrink_workstation'

2018-07-28 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   6d4abf1c0e265d8e99c155b91c1cf44e37793e53
commit: e7e9a307be9d75ecc3bf20b362af88140dfb4304 [560/569] staging: erofs: 
introduce workstation for decompression
config: x86_64-randconfig-s0-07291008 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
git checkout e7e9a307be9d75ecc3bf20b362af88140dfb4304
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/staging//erofs/utils.c: In function 'erofs_shrink_scan':
>> drivers/staging//erofs/utils.c:189:12: error: implicit declaration of 
>> function 'erofs_shrink_workstation' [-Werror=implicit-function-declaration]
  freed += erofs_shrink_workstation(sbi, nr, false);
   ^~~~
   cc1: some warnings being treated as errors

vim +/erofs_shrink_workstation +189 drivers/staging//erofs/utils.c

   140  
   141  unsigned long erofs_shrink_scan(struct shrinker *shrink,
   142  struct shrink_control *sc)
   143  {
   144  struct erofs_sb_info *sbi;
   145  struct list_head *p;
   146  
   147  unsigned long nr = sc->nr_to_scan;
   148  unsigned int run_no;
   149  unsigned long freed = 0;
   150  
   151  spin_lock(_sb_list_lock);
   152  do
   153  run_no = ++shrinker_run_no;
   154  while (run_no == 0);
   155  
   156  /* Iterate over all mounted superblocks and try to shrink them 
*/
   157  p = erofs_sb_list.next;
   158  while (p != _sb_list) {
   159  sbi = list_entry(p, struct erofs_sb_info, list);
   160  
   161  /*
   162   * We move the ones we do to the end of the list, so we 
stop
   163   * when we see one we have already done.
   164   */
   165  if (sbi->shrinker_run_no == run_no)
   166  break;
   167  
   168  if (!mutex_trylock(>umount_mutex)) {
   169  p = p->next;
   170  continue;
   171  }
   172  
   173  spin_unlock(_sb_list_lock);
   174  sbi->shrinker_run_no = run_no;
   175  
   176  /* add scan handlers here */
   177  
   178  spin_lock(_sb_list_lock);
   179  /* Get the next list element before we move this one */
   180  p = p->next;
   181  
   182  /*
   183   * Move this one to the end of the list to provide some
   184   * fairness.
   185   */
   186  list_move_tail(>list, _sb_list);
   187  mutex_unlock(>umount_mutex);
   188  
 > 189  freed += erofs_shrink_workstation(sbi, nr, false);
   190  if (freed >= nr)
   191  break;
   192  }
   193  spin_unlock(_sb_list_lock);
   194  return freed;
   195  }
   196  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-next 560/569] drivers/staging//erofs/utils.c:189:12: error: implicit declaration of function 'erofs_shrink_workstation'; did you mean 'erofs_shrink_scan'?

2018-07-28 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   6d4abf1c0e265d8e99c155b91c1cf44e37793e53
commit: e7e9a307be9d75ecc3bf20b362af88140dfb4304 [560/569] staging: erofs: 
introduce workstation for decompression
config: x86_64-randconfig-ws0-07290820 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
git checkout e7e9a307be9d75ecc3bf20b362af88140dfb4304
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/staging//erofs/utils.c: In function 'erofs_shrink_scan':
>> drivers/staging//erofs/utils.c:189:12: error: implicit declaration of 
>> function 'erofs_shrink_workstation'; did you mean 'erofs_shrink_scan'? 
>> [-Werror=implicit-function-declaration]
  freed += erofs_shrink_workstation(sbi, nr, false);
   ^~~~
   erofs_shrink_scan
   cc1: some warnings being treated as errors

vim +189 drivers/staging//erofs/utils.c

   140  
   141  unsigned long erofs_shrink_scan(struct shrinker *shrink,
   142  struct shrink_control *sc)
   143  {
   144  struct erofs_sb_info *sbi;
   145  struct list_head *p;
   146  
   147  unsigned long nr = sc->nr_to_scan;
   148  unsigned int run_no;
   149  unsigned long freed = 0;
   150  
   151  spin_lock(_sb_list_lock);
   152  do
   153  run_no = ++shrinker_run_no;
   154  while (run_no == 0);
   155  
   156  /* Iterate over all mounted superblocks and try to shrink them 
*/
   157  p = erofs_sb_list.next;
   158  while (p != _sb_list) {
   159  sbi = list_entry(p, struct erofs_sb_info, list);
   160  
   161  /*
   162   * We move the ones we do to the end of the list, so we 
stop
   163   * when we see one we have already done.
   164   */
   165  if (sbi->shrinker_run_no == run_no)
   166  break;
   167  
   168  if (!mutex_trylock(>umount_mutex)) {
   169  p = p->next;
   170  continue;
   171  }
   172  
   173  spin_unlock(_sb_list_lock);
   174  sbi->shrinker_run_no = run_no;
   175  
   176  /* add scan handlers here */
   177  
   178  spin_lock(_sb_list_lock);
   179  /* Get the next list element before we move this one */
   180  p = p->next;
   181  
   182  /*
   183   * Move this one to the end of the list to provide some
   184   * fairness.
   185   */
   186  list_move_tail(>list, _sb_list);
   187  mutex_unlock(>umount_mutex);
   188  
 > 189  freed += erofs_shrink_workstation(sbi, nr, false);
   190  if (freed >= nr)
   191  break;
   192  }
   193  spin_unlock(_sb_list_lock);
   194  return freed;
   195  }
   196  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 04/08] staging:rtl8192u: Remove unused union AC_PARAM - Style

2018-07-28 Thread John Whitmore
The union ACM_PARAM is never actually used in code so removed. This
is a coding style change which should have no impact on runtime code
execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 901b85139d3b..43edb830ad5d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -36,21 +36,6 @@ typedef  union _ECW {
} f;// Field
 } ECW, *PECW;
 
-//
-// AC Parameters Record Format.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
-//
-typedefunion _AC_PARAM {
-   u32 longData;
-   u8  charData[4];
-
-   struct {
-   union aci_aifsn AciAifsn;
-   ECW Ecw;
-   u16 TXOPLimit;
-   } f;// Field
-} AC_PARAM, *PAC_PARAM;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
-- 
2.18.0

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


[PATCH v2 05/08] staging:rtl8192u: Remove unused union ECW -Style

2018-07-28 Thread John Whitmore
The union ECW is never used in code so has simply been removed.
This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 43edb830ad5d..65d7c9f4d840 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -24,18 +24,6 @@ union aci_aifsn {
} f;// Field
 };
 
-//
-// ECWmin/ECWmax field.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.13.
-//
-typedefunion _ECW {
-   u8  charData;
-   struct {
-   u8  ECWmin:4;
-   u8  ECWmax:4;
-   } f;// Field
-} ECW, *PECW;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
-- 
2.18.0

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


[PATCH v2 00/08] staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

2018-07-28 Thread John Whitmore
These are a few coding style changes to the file
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
I had more patches in the list but had to dump some of the later
patches as I made a mistake. Thought I'd send these 8.

John Whitmore (8):
  staging:rtl8192u: Add spaces around operators - Style
  staging:rtl8192u: Rename ACI_AIFSN - Style
  staging:rtl8192u: Rename member variables - Style
  staging:rtl8192u: Remove unused  union AC_PARAM - Style
  staging:rtl8192u: Remove unused union ECW -Style
  staging:rtl8192u: Rename enum DIRECTION_VALUE - Style
  staging:rtl8192u: Rename union QOS_TSINFO - Style
  staging:rtl8192u: Remove unused constants - Style

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


[PATCH v2 03/08] staging:rtl8192u: Rename member variables - Style

2018-07-28 Thread John Whitmore
Rename the member variables of union aci_aifsn, which should be named
in lowercase. The only member variable, of this union, which is
actually used is 'acm'.

This are coding style changes which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 5856bf87c5dc..901b85139d3b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -14,13 +14,13 @@
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
 union aci_aifsn {
-   u8  charData;
+   u8  char_data;
 
struct {
-   u8  AIFSN:4;
-   u8  ACM:1;
-   u8  ACI:2;
-   u8  Reserved:1;
+   u8  aifsn:4;
+   u8  acm:1;
+   u8  aci:2;
+   u8  reserved:1;
} f;// Field
 };
 
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 04c08ca8a0bb..7dc912dd53af 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2338,7 +2338,7 @@ static void dm_check_edca_turbo(
 
read_nic_byte(dev, AcmHwCtrl, );
 
-   if (pAciAifsn->f.ACM) { /*  ACM bit is 1. */
+   if (pAciAifsn->f.acm) { /*  acm bit is 1. */
AcmCtrl |= AcmHw_BeqEn;
} else {/* ACM bit is 0. */
AcmCtrl &= (~AcmHw_BeqEn);
-- 
2.18.0

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


[PATCH v2 07/08] staging:rtl8192u: Rename union QOS_TSINFO - Style

2018-07-28 Thread John Whitmore
The union QOS_TSINFO, as a type, should have a lowercase name. The
union has therefore been renamed to qos_tsinfo. Additionally the
'typedef' directive has been removed to clear the checkpatch issue
with defining new types.

These are coding style changes which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 428a8c4cebf1..17b676b0ed8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -42,7 +42,7 @@ enum direction_value {
 // 1. WMM spec 2.2.11: WME TSPEC Element, p.18.
 // 2. 8185 QoS code: QOS_TSINFO [def. in QoS_mp.h]
 //
-typedef union _QOS_TSINFO {
+union qos_tsinfo {
u8  charData[3];
struct {
u8  ucTrafficType:1;//WMM 
is reserved
@@ -56,7 +56,7 @@ typedef union _QOS_TSINFO {
u8  ucSchedule:1;   //WMM is 
reserved
u8  ucReserved:7;
} field;
-} QOS_TSINFO, *PQOS_TSINFO;
+};
 
 //
 // WMM TSPEC Body.
@@ -66,7 +66,7 @@ typedef union _TSPEC_BODY {
u8  charData[55];
 
struct {
-   QOS_TSINFO  TSInfo; //u8TSInfo[3];
+   union qos_tsinfoTSInfo; //u8TSInfo[3];
u16 NominalMSDUsize;
u16 MaxMSDUsize;
u32 MinServiceItv;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 79c96da41d8b..4d92b97a1521 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -355,7 +355,7 @@ bool GetTs(
// For HCCA or WMMSA, TS cannot be addmit without 
negotiation.
//
TSPEC_BODY  TSpec;
-   PQOS_TSINFO pTSInfo = 
+   union qos_tsinfo*pTSInfo = 
struct list_head*pUnusedList =
(TxRxSelect == 
TX_DIR)?

(>Tx_TS_Unused_List):
-- 
2.18.0

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


[PATCH v2 02/08] staging:rtl8192u: Rename ACI_AIFSN - Style

2018-07-28 Thread John Whitmore
Rename the union ACI_AIFSN to aci_aifsn and remove the typedef directive.

The removal of the typedef clears the checkpatch issue with defining
new types. The renaming is to adhere to the coding style where types
are name in lower case.

These changes are coding style changes which should have no impact on
runtime execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 92afa9dc9663..5856bf87c5dc 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -13,7 +13,7 @@
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
-typedefunion _ACI_AIFSN {
+union aci_aifsn {
u8  charData;
 
struct {
@@ -22,7 +22,7 @@ typedef   union _ACI_AIFSN {
u8  ACI:2;
u8  Reserved:1;
} f;// Field
-} ACI_AIFSN, *PACI_AIFSN;
+};
 
 //
 // ECWmin/ECWmax field.
@@ -45,7 +45,7 @@ typedef   union _AC_PARAM {
u8  charData[4];
 
struct {
-   ACI_AIFSN   AciAifsn;
+   union aci_aifsn AciAifsn;
ECW Ecw;
u16 TXOPLimit;
} f;// Field
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index c4e4e3ba394b..04c08ca8a0bb 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2333,7 +2333,7 @@ static void dm_check_edca_turbo(
{
/*  TODO:  Modified this part and try to set 
acm control in only 1 IO processing!! */
 
-   PACI_AIFSN  pAciAifsn = 
(PACI_AIFSN)&(qos_parameters->aifs[0]);
+   union aci_aifsn *pAciAifsn = (union aci_aifsn 
*)&(qos_parameters->aifs[0]);
u8  AcmCtrl;
 
read_nic_byte(dev, AcmHwCtrl, );
-- 
2.18.0

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


[PATCH v2 08/08] staging:rtl8192u: Remove unused constants - Style

2018-07-28 Thread John Whitmore
Remove defined constants from code, since they are never actually
used in code. This is a simple coding style change which should have
no impact on runtime code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 17b676b0ed8b..810d81addcf6 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -2,13 +2,6 @@
 #ifndef __INC_QOS_TYPE_H
 #define __INC_QOS_TYPE_H
 
-#defineMAX_WMMELE_LENGTH   64
-
-#define AC_PARAM_SIZE  4
-#define WMM_PARAM_ELE_BODY_LEN 18
-
-#define WMM_PARAM_ELEMENT_SIZE (8 + (4 * AC_PARAM_SIZE))
-
 //
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
-- 
2.18.0

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


[PATCH v2 01/08] staging:rtl8192u: Add spaces around operators - Style

2018-07-28 Thread John Whitmore
Add the required spaces around '+' and '*' operators. This is a
coding style change to clear the checkpatch issue. There should be
no impact on runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 8ee9370520f3..92afa9dc9663 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -7,7 +7,7 @@
 #define AC_PARAM_SIZE  4
 #define WMM_PARAM_ELE_BODY_LEN 18
 
-#define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE))
+#define WMM_PARAM_ELEMENT_SIZE (8 + (4 * AC_PARAM_SIZE))
 
 //
 // ACI/AIFSN Field.
-- 
2.18.0

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


[PATCH v2 06/08] staging:rtl8192u: Rename enum DIRECTION_VALUE - Style

2018-07-28 Thread John Whitmore
The enumerated type DIRECTION_VALUE should be named in lowercase to
comply with coding standard so is renamed to direction_value. In
addition the 'typedef' directive has been removed to clear the
checkpatch issue with defining new types.

These changes are coding style changes which should have no impact on
runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 65d7c9f4d840..428a8c4cebf1 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -28,12 +28,12 @@ union aci_aifsn {
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
 //
-typedefenum _DIRECTION_VALUE {
+enum direction_value {
DIR_UP  = 0,// 0x00 // UpLink
DIR_DOWN= 1,// 0x01 // DownLink
DIR_DIRECT  = 2,// 0x10 // DirectLink
DIR_BI_DIR  = 3,// 0x11 // Bi-Direction
-} DIRECTION_VALUE, *PDIRECTION_VALUE;
+};
 
 
 //
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 4b2da7f31166..79c96da41d8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -366,7 +366,7 @@ bool GetTs(

(>Tx_TS_Admit_List):

(>Rx_TS_Admit_List);
 
-   DIRECTION_VALUE Dir =   (ieee->iw_mode 
== IW_MODE_MASTER)?
+   enum direction_valueDir =   (ieee->iw_mode 
== IW_MODE_MASTER)?

((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP):

((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN);
IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n");
-- 
2.18.0

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


Re: [PATCH 00/08] staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

2018-07-28 Thread John Whitmore
On Sun, Jul 29, 2018 at 12:02:52AM +0100, John Whitmore wrote:
> These are a few coding style changes to the file
> drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
> I had more patches in the list but had to dump some of the later
> patches as I made a mistake. Thought I'd send these 8.
> 
> John Whitmore (8):
>   staging:rtl8192u: Add spaces around operators - Style
>   staging:rtl8192u: Rename ACI_AIFSN - Style
>   staging:rtl8192u: Rename member variables - Style
>   staging:rtl8192u: Remove unused  union AC_PARAM - Style
>   staging:rtl8192u: Remove unused union ECW -Style
>   staging:rtl8192u: Rename enum DIRECTION_VALUE - Style
>   staging:rtl8192u: Rename union QOS_TSINFO - Style
>   staging:rtl8192u: Remove unused constants - Style
> 

Sorry I forgot to edit the subject of each of the patch emails to
truncate the patch series to just the 8 that were good. I'll edit and
resend.

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


[PATCH 06/12] staging:rtl8192u: Rename enum DIRECTION_VALUE - Style

2018-07-28 Thread John Whitmore
The enumerated type DIRECTION_VALUE should be named in lowercase to
comply with coding standard so is renamed to direction_value. In
addition the 'typedef' directive has been removed to clear the
checkpatch issue with defining new types.

These changes are coding style changes which should have no impact on
runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 65d7c9f4d840..428a8c4cebf1 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -28,12 +28,12 @@ union aci_aifsn {
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
 //
-typedefenum _DIRECTION_VALUE {
+enum direction_value {
DIR_UP  = 0,// 0x00 // UpLink
DIR_DOWN= 1,// 0x01 // DownLink
DIR_DIRECT  = 2,// 0x10 // DirectLink
DIR_BI_DIR  = 3,// 0x11 // Bi-Direction
-} DIRECTION_VALUE, *PDIRECTION_VALUE;
+};
 
 
 //
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 4b2da7f31166..79c96da41d8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -366,7 +366,7 @@ bool GetTs(

(>Tx_TS_Admit_List):

(>Rx_TS_Admit_List);
 
-   DIRECTION_VALUE Dir =   (ieee->iw_mode 
== IW_MODE_MASTER)?
+   enum direction_valueDir =   (ieee->iw_mode 
== IW_MODE_MASTER)?

((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP):

((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN);
IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n");
-- 
2.18.0

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


[PATCH 05/12] staging:rtl8192u: Remove unused union ECW -Style

2018-07-28 Thread John Whitmore
The union ECW is never used in code so has simply been removed.
This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 43edb830ad5d..65d7c9f4d840 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -24,18 +24,6 @@ union aci_aifsn {
} f;// Field
 };
 
-//
-// ECWmin/ECWmax field.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.13.
-//
-typedefunion _ECW {
-   u8  charData;
-   struct {
-   u8  ECWmin:4;
-   u8  ECWmax:4;
-   } f;// Field
-} ECW, *PECW;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
-- 
2.18.0

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


[PATCH 08/12] staging:rtl8192u: Remove unused constants - Style

2018-07-28 Thread John Whitmore
Remove defined constants from code, since they are never actually
used in code. This is a simple coding style change which should have
no impact on runtime code execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 17b676b0ed8b..810d81addcf6 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -2,13 +2,6 @@
 #ifndef __INC_QOS_TYPE_H
 #define __INC_QOS_TYPE_H
 
-#defineMAX_WMMELE_LENGTH   64
-
-#define AC_PARAM_SIZE  4
-#define WMM_PARAM_ELE_BODY_LEN 18
-
-#define WMM_PARAM_ELEMENT_SIZE (8 + (4 * AC_PARAM_SIZE))
-
 //
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
-- 
2.18.0

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


[PATCH 00/08] staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

2018-07-28 Thread John Whitmore
These are a few coding style changes to the file
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
I had more patches in the list but had to dump some of the later
patches as I made a mistake. Thought I'd send these 8.

John Whitmore (8):
  staging:rtl8192u: Add spaces around operators - Style
  staging:rtl8192u: Rename ACI_AIFSN - Style
  staging:rtl8192u: Rename member variables - Style
  staging:rtl8192u: Remove unused  union AC_PARAM - Style
  staging:rtl8192u: Remove unused union ECW -Style
  staging:rtl8192u: Rename enum DIRECTION_VALUE - Style
  staging:rtl8192u: Rename union QOS_TSINFO - Style
  staging:rtl8192u: Remove unused constants - Style

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


[PATCH 01/12] staging:rtl8192u: Add spaces around operators - Style

2018-07-28 Thread John Whitmore
Add the required spaces around '+' and '*' operators. This is a
coding style change to clear the checkpatch issue. There should be
no impact on runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 8ee9370520f3..92afa9dc9663 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -7,7 +7,7 @@
 #define AC_PARAM_SIZE  4
 #define WMM_PARAM_ELE_BODY_LEN 18
 
-#define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE))
+#define WMM_PARAM_ELEMENT_SIZE (8 + (4 * AC_PARAM_SIZE))
 
 //
 // ACI/AIFSN Field.
-- 
2.18.0

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


[PATCH 07/12] staging:rtl8192u: Rename union QOS_TSINFO - Style

2018-07-28 Thread John Whitmore
The union QOS_TSINFO, as a type, should have a lowercase name. The
union has therefore been renamed to qos_tsinfo. Additionally the
'typedef' directive has been removed to clear the checkpatch issue
with defining new types.

These are coding style changes which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 428a8c4cebf1..17b676b0ed8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -42,7 +42,7 @@ enum direction_value {
 // 1. WMM spec 2.2.11: WME TSPEC Element, p.18.
 // 2. 8185 QoS code: QOS_TSINFO [def. in QoS_mp.h]
 //
-typedef union _QOS_TSINFO {
+union qos_tsinfo {
u8  charData[3];
struct {
u8  ucTrafficType:1;//WMM 
is reserved
@@ -56,7 +56,7 @@ typedef union _QOS_TSINFO {
u8  ucSchedule:1;   //WMM is 
reserved
u8  ucReserved:7;
} field;
-} QOS_TSINFO, *PQOS_TSINFO;
+};
 
 //
 // WMM TSPEC Body.
@@ -66,7 +66,7 @@ typedef union _TSPEC_BODY {
u8  charData[55];
 
struct {
-   QOS_TSINFO  TSInfo; //u8TSInfo[3];
+   union qos_tsinfoTSInfo; //u8TSInfo[3];
u16 NominalMSDUsize;
u16 MaxMSDUsize;
u32 MinServiceItv;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 79c96da41d8b..4d92b97a1521 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -355,7 +355,7 @@ bool GetTs(
// For HCCA or WMMSA, TS cannot be addmit without 
negotiation.
//
TSPEC_BODY  TSpec;
-   PQOS_TSINFO pTSInfo = 
+   union qos_tsinfo*pTSInfo = 
struct list_head*pUnusedList =
(TxRxSelect == 
TX_DIR)?

(>Tx_TS_Unused_List):
-- 
2.18.0

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


[PATCH 04/12] staging:rtl8192u: Remove unused union AC_PARAM - Style

2018-07-28 Thread John Whitmore
The union ACM_PARAM is never actually used in code so removed. This
is a coding style change which should have no impact on runtime code
execution.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 901b85139d3b..43edb830ad5d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -36,21 +36,6 @@ typedef  union _ECW {
} f;// Field
 } ECW, *PECW;
 
-//
-// AC Parameters Record Format.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
-//
-typedefunion _AC_PARAM {
-   u32 longData;
-   u8  charData[4];
-
-   struct {
-   union aci_aifsn AciAifsn;
-   ECW Ecw;
-   u16 TXOPLimit;
-   } f;// Field
-} AC_PARAM, *PAC_PARAM;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
-- 
2.18.0

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


[PATCH 02/12] staging:rtl8192u: Rename ACI_AIFSN - Style

2018-07-28 Thread John Whitmore
Rename the union ACI_AIFSN to aci_aifsn and remove the typedef directive.

The removal of the typedef clears the checkpatch issue with defining
new types. The renaming is to adhere to the coding style where types
are name in lower case.

These changes are coding style changes which should have no impact on
runtime execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 92afa9dc9663..5856bf87c5dc 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -13,7 +13,7 @@
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
-typedefunion _ACI_AIFSN {
+union aci_aifsn {
u8  charData;
 
struct {
@@ -22,7 +22,7 @@ typedef   union _ACI_AIFSN {
u8  ACI:2;
u8  Reserved:1;
} f;// Field
-} ACI_AIFSN, *PACI_AIFSN;
+};
 
 //
 // ECWmin/ECWmax field.
@@ -45,7 +45,7 @@ typedef   union _AC_PARAM {
u8  charData[4];
 
struct {
-   ACI_AIFSN   AciAifsn;
+   union aci_aifsn AciAifsn;
ECW Ecw;
u16 TXOPLimit;
} f;// Field
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index c4e4e3ba394b..04c08ca8a0bb 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2333,7 +2333,7 @@ static void dm_check_edca_turbo(
{
/*  TODO:  Modified this part and try to set 
acm control in only 1 IO processing!! */
 
-   PACI_AIFSN  pAciAifsn = 
(PACI_AIFSN)&(qos_parameters->aifs[0]);
+   union aci_aifsn *pAciAifsn = (union aci_aifsn 
*)&(qos_parameters->aifs[0]);
u8  AcmCtrl;
 
read_nic_byte(dev, AcmHwCtrl, );
-- 
2.18.0

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


[PATCH 03/12] staging:rtl8192u: Rename member variables - Style

2018-07-28 Thread John Whitmore
Rename the member variables of union aci_aifsn, which should be named
in lowercase. The only member variable, of this union, which is
actually used is 'acm'.

This are coding style changes which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 5856bf87c5dc..901b85139d3b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -14,13 +14,13 @@
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
 union aci_aifsn {
-   u8  charData;
+   u8  char_data;
 
struct {
-   u8  AIFSN:4;
-   u8  ACM:1;
-   u8  ACI:2;
-   u8  Reserved:1;
+   u8  aifsn:4;
+   u8  acm:1;
+   u8  aci:2;
+   u8  reserved:1;
} f;// Field
 };
 
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 04c08ca8a0bb..7dc912dd53af 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2338,7 +2338,7 @@ static void dm_check_edca_turbo(
 
read_nic_byte(dev, AcmHwCtrl, );
 
-   if (pAciAifsn->f.ACM) { /*  ACM bit is 1. */
+   if (pAciAifsn->f.acm) { /*  acm bit is 1. */
AcmCtrl |= AcmHw_BeqEn;
} else {/* ACM bit is 0. */
AcmCtrl &= (~AcmHw_BeqEn);
-- 
2.18.0

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


[PATCH] staging: gasket: use NULL instead of 0 for null pointer

2018-07-28 Thread Dmitriy Cherkasov
Fixes sparse warning: Using plain integer as NULL pointer

Signed-off-by: Dmitriy Cherkasov 
---
 drivers/staging/gasket/gasket_page_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gasket/gasket_page_table.c 
b/drivers/staging/gasket/gasket_page_table.c
index 9f81161..8fbfd58 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -1689,7 +1689,7 @@ int gasket_alloc_coherent_memory(struct gasket_dev 
*gasket_dev, u64 size,
 
if (gasket_dev->page_table[index]->coherent_pages) {
kfree(gasket_dev->page_table[index]->coherent_pages);
-   gasket_dev->page_table[index]->coherent_pages = 0;
+   gasket_dev->page_table[index]->coherent_pages = NULL;
}
gasket_dev->page_table[index]->num_coherent_pages = 0;
return -ENOMEM;
-- 
1.9.1

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


[PATCH 4/4] Drivers: hv: vmbus: add numa_node to sysfs

2018-07-28 Thread kys
From: Stephen Hemminger 

Being able to find the numa_node for a device is useful for userspace
drivers (DPDK) and also for diagnosing performance issues.  This makes
vmbus similar to pci.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 Documentation/ABI/stable/sysfs-bus-vmbus |  7 +++
 drivers/hv/vmbus_drv.c   | 17 +
 2 files changed, 24 insertions(+)

diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus 
b/Documentation/ABI/stable/sysfs-bus-vmbus
index 3eaffbb2d468..3fed8fdb873d 100644
--- a/Documentation/ABI/stable/sysfs-bus-vmbus
+++ b/Documentation/ABI/stable/sysfs-bus-vmbus
@@ -42,6 +42,13 @@ Contact: K. Y. Srinivasan 
 Description:   The 16 bit vendor ID of the device
 Users: tools/hv/lsvmbus and user level RDMA libraries
 
+What:  /sys/bus/vmbus/devices//numa_node
+Date:  Jul 2018
+KernelVersion: 4.19
+Contact:   Stephen Hemminger 
+Description:   This NUMA node to which the VMBUS device is
+   attached, or -1 if the node is unknown.
+
 What:  /sys/bus/vmbus/devices//channels/
 Date:  September. 2017
 KernelVersion: 4.14
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index db145e1a7049..b1b548a21f91 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -210,6 +210,20 @@ static ssize_t modalias_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(modalias);
 
+#ifdef CONFIG_NUMA
+static ssize_t numa_node_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+   struct hv_device *hv_dev = device_to_hv_device(dev);
+
+   if (!hv_dev->channel)
+   return -ENODEV;
+
+   return sprintf(buf, "%d\n", hv_dev->channel->numa_node);
+}
+static DEVICE_ATTR_RO(numa_node);
+#endif
+
 static ssize_t server_monitor_pending_show(struct device *dev,
   struct device_attribute *dev_attr,
   char *buf)
@@ -492,6 +506,9 @@ static struct attribute *vmbus_dev_attrs[] = {
_attr_class_id.attr,
_attr_device_id.attr,
_attr_modalias.attr,
+#ifdef CONFIG_NUMA
+   _attr_numa_node.attr,
+#endif
_attr_server_monitor_pending.attr,
_attr_client_monitor_pending.attr,
_attr_server_monitor_latency.attr,
-- 
2.17.1

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


[PATCH 2/4] Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr

2018-07-28 Thread kys
From: Sunil Muthuswamy 

The check to free the Hyper-V control table header was reversed. This
fixes it.

Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over 
Hyper-V during panic")

Signed-off-by: Sunil Muthuswamy 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/vmbus_drv.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index a7f33c1f42c5..5e946b1be54c 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1176,11 +1176,8 @@ static int vmbus_bus_init(void)
 
bus_unregister(_bus);
free_page((unsigned long)hv_panic_page);
-   if (!hv_ctl_table_hdr) {
-   unregister_sysctl_table(hv_ctl_table_hdr);
-   hv_ctl_table_hdr = NULL;
-   }
-
+   unregister_sysctl_table(hv_ctl_table_hdr);
+   hv_ctl_table_hdr = NULL;
return ret;
 }
 
@@ -1891,11 +1888,8 @@ static void __exit vmbus_exit(void)
}
 
free_page((unsigned long)hv_panic_page);
-   if (!hv_ctl_table_hdr) {
-   unregister_sysctl_table(hv_ctl_table_hdr);
-   hv_ctl_table_hdr = NULL;
-   }
-
+   unregister_sysctl_table(hv_ctl_table_hdr);
+   hv_ctl_table_hdr = NULL;
bus_unregister(_bus);
 
cpuhp_remove_state(hyperv_cpuhp_online);
-- 
2.17.1

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


[PATCH 3/4] Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c

2018-07-28 Thread kys
From: Sunil Muthuswamy 

Get rid of ISA specific code from vmus_drv.c which is common code.

Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over 
Hyper-V during panic")

Signed-off-by: Sunil Muthuswamy 
Signed-off-by: K. Y. Srinivasan 
---
 arch/x86/include/asm/mshyperv.h | 3 +++
 drivers/hv/vmbus_drv.c  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 156a2e5a97a9..b731c4bf70ed 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -96,6 +96,9 @@ static inline void vmbus_signal_eom(struct hv_message *msg, 
u32 old_msg_type)
 #define hv_set_synint_state(int_num, val) \
wrmsrl(HV_X64_MSR_SINT0 + int_num, val)
 
+#define hv_get_crash_ctl(val) \
+   rdmsrl(HV_X64_MSR_CRASH_CTL, val)
+
 void hyperv_callback_vector(void);
 void hyperv_reenlightenment_vector(void);
 #ifdef CONFIG_TRACING
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 5e946b1be54c..db145e1a7049 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1146,7 +1146,7 @@ static int vmbus_bus_init(void)
 * Register for panic kmsg callback only if the right
 * capability is supported by the hypervisor.
 */
-   rdmsrl(HV_X64_MSR_CRASH_CTL, hyperv_crash_ctl);
+   hv_get_crash_ctl(hyperv_crash_ctl);
if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
hv_panic_page = (void *)get_zeroed_page(GFP_KERNEL);
if (hv_panic_page) {
-- 
2.17.1

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


[PATCH 1/4] Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer

2018-07-28 Thread kys
From: Sunil Muthuswamy 

The code to support panic control message was checking the return was
checking the return value from kmsg_dump_get_buffer as error value, which
is not what the routine returns. This fixes it.

Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over 
Hyper-V during panic")

Signed-off-by: Sunil Muthuswamy 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/vmbus_drv.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 05e37283d7c3..a7f33c1f42c5 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1047,13 +1047,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,
 * Write dump contents to the page. No need to synchronize; panic should
 * be single-threaded.
 */
-   if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page,
- PAGE_SIZE, _written)) {
-   pr_err("Hyper-V: Unable to get kmsg data for panic\n");
-   return;
-   }
-
-   hyperv_report_panic_msg(panic_pa, bytes_written);
+   kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE,
+_written);
+   if (bytes_written)
+   hyperv_report_panic_msg(panic_pa, bytes_written);
 }
 
 static struct kmsg_dumper hv_kmsg_dumper = {
-- 
2.17.1

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


[PATCH 0/4] Drivers: hv: vmbus: Miscellaneous fixes/enhancements

2018-07-28 Thread kys
From: "K. Y. Srinivasan" 

Miscellaneous fixes/enhancements

Stephen Hemminger (1):
  Drivers: hv: vmbus: add numa_node to sysfs

Sunil Muthuswamy (3):
  Drivers: hv: vmus: Fix the check for return value from kmsg get dump
buffer
  Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr
  Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c

 Documentation/ABI/stable/sysfs-bus-vmbus |  7 
 arch/x86/include/asm/mshyperv.h  |  3 ++
 drivers/hv/vmbus_drv.c   | 44 ++--
 3 files changed, 36 insertions(+), 18 deletions(-)

-- 
2.17.1

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


RE: [PATCH] Drivers: HV: panic kmsg dump, move MSR access to arch specific

2018-07-28 Thread KY Srinivasan



> -Original Message-
> From: Sunil Muthuswamy
> Sent: Thursday, July 26, 2018 5:28 PM
> To: KY Srinivasan ; Michael Kelley (EOSG)
> 
> Cc: Stephen Hemminger ; Haiyang Zhang
> ; de...@linuxdriverproject.org
> Subject: RE: [PATCH] Drivers: HV: panic kmsg dump, move MSR access to arch
> specific
> 
> I just sent three individual patches to address the below.

Do not top post. This mail is not necessary. Also, please send multiple patches
as a set.

K. Y 
> 
> Thanks,
> Sunil
> 
> > -Original Message-
> > From: KY Srinivasan
> > Sent: Thursday, July 26, 2018 11:53 AM
> > To: Sunil Muthuswamy ; Michael Kelley (EOSG)
> > 
> > Cc: Stephen Hemminger ; Haiyang Zhang
> > ; de...@linuxdriverproject.org
> > Subject: RE: [PATCH] Drivers: HV: panic kmsg dump, move MSR access to
> arch
> > specific
> >
> >
> >
> > > -Original Message-
> > > From: Sunil Muthuswamy
> > > Sent: Monday, July 23, 2018 11:31 AM
> > > To: Michael Kelley (EOSG) ; Sunil
> > > Muthuswamy 
> > > Cc: KY Srinivasan ; Stephen Hemminger
> > > ; Haiyang Zhang
> ;
> > > de...@linuxdriverproject.org
> > > Subject: [PATCH] Drivers: HV: panic kmsg dump, move MSR access to arch
> > > specific
> > >
> > > Moves the MSR access from arch independent code to arch
> > > dependent code. Also includes minor bug fixes.
> >
> > Please breakup this patch into 3 patches:
> >
> > 1) Making the code ISA independent - moving the MSR accesses out of the
> > common code.
> > 2) Fixing the issue with checking the return value from
> > kmsg_dump_get_buffer()
> > 3) Fix the issue with freeing up hv_ctl_table_hdr
> >
> > Thank you,
> >
> > K. Y
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] staging: gasket: core: hold reference on device while in use

2018-07-28 Thread Todd Poynor
From: Todd Poynor 

Hold a reference on the struct device while a pointer to that
device is in use by gasket.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: Todd Poynor 
---
 drivers/staging/gasket/gasket_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index 859a6df9e12df..2b484d067c38a 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -448,7 +448,7 @@ static int gasket_alloc_dev(
gasket_dev->internal_desc = internal_desc;
gasket_dev->dev_idx = dev_idx;
snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", kobj_name);
-   gasket_dev->dev = parent;
+   gasket_dev->dev = get_device(parent);
/* gasket_bar_data is uninitialized. */
gasket_dev->num_page_tables = driver_desc->num_page_tables;
/* max_page_table_size and *page table are uninit'ed */
@@ -487,7 +487,7 @@ static void gasket_free_dev(struct gasket_dev *gasket_dev)
mutex_lock(_desc->mutex);
internal_desc->devs[gasket_dev->dev_idx] = NULL;
mutex_unlock(_desc->mutex);
-
+   put_device(gasket_dev->dev);
kfree(gasket_dev);
 }
 
-- 
2.18.0.345.g5c9ce644c3-goog

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


[PATCH 0/1 v2] staging: gasket: fixes and cleanups

2018-07-28 Thread Todd Poynor
From: Todd Poynor 

The fun continues with gasket+apex: remove dead code and unnecessary
stuff, fixup apex PCI class for devices that advertise class 0
(undefined), and make sure the struct device doesn't go away on us.
Most of these from review comments of previous patch series.

Changed patches in v2:
  staging: gasket: core: hold reference on device kobj while in use
Renamed: staging: gasket: core: hold reference on device while in use
Use device get/put functions.

Removed patches in v2 already merged from v1:
  staging: gasket: sysfs: remove check for refcount already zero
  staging: gasket: apex: fixup undefined PCI class
  staging: gasket: sysfs: remove unnecessary NULL check on device ptr
  staging: gasket: page table: remove code for "no dma_ops"

Todd Poynor (1):
  staging: gasket: core: hold reference on device while in use

 drivers/staging/gasket/gasket_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.18.0.345.g5c9ce644c3-goog

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


[PATCH] Staging: fbtft: fbtft-sysfs: fixed a 80 char line coding style issue Staging: fbtft: flexfb: fixed a 80 char line coding style issue

2018-07-28 Thread sepehrdad . dev
From: sepehrdad sh 

Fixed multiple coding style issue

Signed-off-by: Sepehrdad Sh 
---
 drivers/staging/fbtft/fbtft-sysfs.c |  6 --
 drivers/staging/fbtft/flexfb.c  | 22 +++---
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-sysfs.c 
b/drivers/staging/fbtft/fbtft-sysfs.c
index 712096659aa0..3989b49ce310 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -68,7 +68,8 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves,
ret = get_next_ulong(_p, , " ", 16);
if (ret)
goto out;
-   curves[curve_counter * par->gamma.num_values + 
value_counter] = val;
+   curves[curve_counter * par->gamma.num_values
+   + value_counter] = val;
value_counter++;
}
if (value_counter != par->gamma.num_values) {
@@ -126,7 +127,8 @@ static ssize_t store_gamma_curve(struct device *device,
 
mutex_lock(>gamma.lock);
memcpy(par->gamma.curves, tmp_curves,
-  par->gamma.num_curves * par->gamma.num_values * 
sizeof(tmp_curves[0]));
+  par->gamma.num_curves * par->gamma.num_values
+  * sizeof(tmp_curves[0]));
mutex_unlock(>gamma.lock);
 
return count;
diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index f676c9b853f1..5ca42a716e00 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -667,11 +667,14 @@ static int flexfb_probe_common(struct spi_device *sdev,
case 8:
par->fbtftops.write_vmem = fbtft_write_vmem16_bus8;
if (!par->startbyte)
-   par->fbtftops.verify_gpios = 
flexfb_verify_gpios_dc;
+   par->fbtftops.verify_gpios = (
+   flexfb_verify_gpios_dc);
break;
case 9:
if (regwidth == 16) {
-   dev_err(dev, "argument 'regwidth': %d is not 
supported with buswidth=%d and SPI.\n", regwidth, buswidth);
+   dev_err(dev,
+   "argument 'regwidth': %d is not 
supported with buswidth=%d and SPI.\n",
+   regwidth, buswidth);
return -EINVAL;
}
par->fbtftops.write_register = fbtft_write_reg8_bus9;
@@ -684,8 +687,8 @@ static int flexfb_probe_common(struct spi_device *sdev,
"9-bit SPI not available, emulating 
using 8-bit.\n");
/* allocate buffer with room for dc bits */
par->extra = devm_kzalloc(par->info->device,
-   par->txbuf.len + 
(par->txbuf.len / 8) + 8,
-   GFP_KERNEL);
+   par->txbuf.len + (par->txbuf.len / 8) + 8,
+   GFP_KERNEL);
if (!par->extra) {
ret = -ENOMEM;
goto out_release;
@@ -694,7 +697,9 @@ static int flexfb_probe_common(struct spi_device *sdev,
}
break;
default:
-   dev_err(dev, "argument 'buswidth': %d is not supported 
with SPI.\n", buswidth);
+   dev_err(dev,
+   "argument 'buswidth': %d is not supported with 
SPI.\n",
+   buswidth);
return -EINVAL;
}
} else {
@@ -707,13 +712,16 @@ static int flexfb_probe_common(struct spi_device *sdev,
case 16:
par->fbtftops.write_register = fbtft_write_reg16_bus16;
if (latched)
-   par->fbtftops.write = 
fbtft_write_gpio16_wr_latched;
+   par->fbtftops.write = (
+   fbtft_write_gpio16_wr_latched);
else
par->fbtftops.write = fbtft_write_gpio16_wr;
par->fbtftops.write_vmem = fbtft_write_vmem16_bus16;
break;
default:
-   dev_err(dev, "argument 'buswidth': %d is not supported 
with parallel.\n", buswidth);
+   dev_err(dev,
+   "argument 'buswidth': %d is not supported with 
parallel.\n",
+   buswidth);
return -EINVAL;
}
}
-- 
2.18.0


Re: [PATCH v2 2/3] Staging: octeon-usb: Change coding style of CVMX_WAIT_FOR_FIELD32 marco.

2018-07-28 Thread Georgios Tsotsos
I will change it into function, as i checked so far i will need to
change USB_SET_FIELD32 for the same reason.

On Fri, 27 Jul 2018 at 18:15, Greg Kroah-Hartman
 wrote:
>
> On Thu, Jul 26, 2018 at 06:41:52PM +0300, Georgios Tsotsos wrote:
> > Fixing coding style for CVMX_WAIT_FOR_FIELD32 was confusing. Also
> > encapsulates into parentheses timeout_usec.
> >
> > Signed-off-by: Georgios Tsotsos 
> > ---
> >  drivers/staging/octeon-usb/octeon-hcd.c | 44 
> > +
> >  1 file changed, 23 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
> > b/drivers/staging/octeon-usb/octeon-hcd.c
> > index cff5e790b196..c8e0ebf1434f 100644
> > --- a/drivers/staging/octeon-usb/octeon-hcd.c
> > +++ b/drivers/staging/octeon-usb/octeon-hcd.c
> > @@ -378,27 +378,29 @@ struct octeon_hcd {
> >  };
> >
> >  /* This macro spins on a register waiting for it to reach a condition. */
> > -#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec)   \
> > - ({int result;   \
> > - do {\
> > - u64 done = cvmx_get_cycle() + (u64)timeout_usec *   \
> > -octeon_get_clock_rate() / 100;   \
> > - union _union c; \
> > - \
> > - while (1) { \
> > - c.u32 = cvmx_usb_read_csr32(usb, address);  \
> > - \
> > - if (cond) { \
> > - result = 0; \
> > - break;  \
> > - } else if (cvmx_get_cycle() > done) {   \
> > - result = -1;\
> > - break;  \
> > - } else  \
> > - __delay(100);   \
> > - }   \
> > - } while (0);\
> > - result; })
> > +#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec)   \
> > +({   \
> > + int result; \
> > + do {\
> > + u64 done = cvmx_get_cycle() + (u64)(timeout_usec) * \
> > +octeon_get_clock_rate() / 100;   \
> > + union _union c; \
> > + \
> > + while (1) { \
> > + c.u32 = cvmx_usb_read_csr32(usb, address);  \
> > + \
> > + if (cond) { \
> > + result = 0; \
> > + break;  \
> > + } else if (cvmx_get_cycle() > done) {   \
> > + result = -1;\
> > + break;  \
> > + } else  \
> > + __delay(100);   \
> > + }   \
> > + } while (0);\
> > + result; \
> > +})
>
> It's still a mess, why not just make this a function call instead?
>
> thanks,
>
> greg k-h



-- 
Best regards!
Georgios Tsotsos
Greece-Evia-Chalkida

Georgios Tsotsos
*Greece - Evia - Chalkida*
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: rtl8188eu: remove unused rtw_calculate_wlan_pkt_size_by_attribue()

2018-07-28 Thread Michael Straube
The function rtw_calculate_wlan_pkt_size_by_attribue() also defined as
rtw_wlan_pkt_size() is never used, so remove it. Discovered by cppcheck.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c| 18 --
 drivers/staging/rtl8188eu/include/rtw_xmit.h |  2 --
 2 files changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 4265ad84547d..2130d78e0d9f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -892,24 +892,6 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, 
struct pkt_attrib *pat
return ptxservq->qcnt;
 }
 
-/*
- * Calculate wlan 802.11 packet MAX size from pkt_attrib
- * This function doesn't consider fragment case
- */
-u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib)
-{
-   u32 len = 0;
-
-   len = pattrib->hdrlen + pattrib->iv_len; /*  WLAN Header and IV */
-   len += SNAP_SIZE + sizeof(u16); /*  LLC */
-   len += pattrib->pktlen;
-   if (pattrib->encrypt == _TKIP_)
-   len += 8; /*  MIC */
-   len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /*  ICV */
-
-   return len;
-}
-
 /*
 
 This sub-routine will perform all the following:
diff --git a/drivers/staging/rtl8188eu/include/rtw_xmit.h 
b/drivers/staging/rtl8188eu/include/rtw_xmit.h
index af6485aa6900..788f59c74ea1 100644
--- a/drivers/staging/rtl8188eu/include/rtw_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtw_xmit.h
@@ -326,8 +326,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv 
*pxmitpriv,
 
 s32 rtw_xmit_classifier(struct adapter *padapter,
struct xmit_frame *pxmitframe);
-u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
-#define rtw_wlan_pkt_size(f) 
rtw_calculate_wlan_pkt_size_by_attribue(>attrib)
 s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt,
   struct xmit_frame *pxmitframe);
 s32 _rtw_init_hw_txqueue(struct hw_txqueue *phw_txqueue, u8 ac_tag);
-- 
2.18.0

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


[PATCH 1/3] staging: rtl8188eu: fix comparsions to NULL - coding style

2018-07-28 Thread Michael Straube
Use !x instead of x == NULL.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 89843201a338..03b65e9b067a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -70,7 +70,7 @@ s32   _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
 
pxmitpriv->pallocated_frame_buf = vzalloc(NR_XMITFRAME * sizeof(struct 
xmit_frame) + 4);
 
-   if (pxmitpriv->pallocated_frame_buf  == NULL) {
+   if (!pxmitpriv->pallocated_frame_buf) {
pxmitpriv->pxmit_frame_buf = NULL;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame 
fail!\n"));
res = _FAIL;
@@ -108,7 +108,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
 
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct 
xmit_buf) + 4);
 
-   if (pxmitpriv->pallocated_xmitbuf  == NULL) {
+   if (!pxmitpriv->pallocated_xmitbuf) {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_buf 
fail!\n"));
res = _FAIL;
goto exit;
@@ -149,7 +149,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
 
pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * 
sizeof(struct xmit_buf) + 4);
 
-   if (pxmitpriv->pallocated_xmit_extbuf  == NULL) {
+   if (!pxmitpriv->pallocated_xmit_extbuf) {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc 
xmit_extbuf fail!\n"));
res = _FAIL;
goto exit;
@@ -210,7 +210,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
 
-   if (pxmitpriv->pxmit_frame_buf == NULL)
+   if (!pxmitpriv->pxmit_frame_buf)
return;
 
for (i = 0; i < NR_XMITFRAME; i++) {
@@ -941,7 +941,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct 
sk_buff *pkt, struct
if (!psta)
return _FAIL;
 
-   if (pxmitframe->buf_addr == NULL) {
+   if (!pxmitframe->buf_addr) {
DBG_88E("==> %s buf_addr == NULL\n", __func__);
return _FAIL;
}
-- 
2.18.0

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


[PATCH 2/3] staging: rtl8188eu: replace tabs with spaces

2018-07-28 Thread Michael Straube
Replace tabs with spaces, clears a checkpatch 'line over 80 characters'
warning.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 03b65e9b067a..4265ad84547d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -23,7 +23,7 @@ static void _init_txservq(struct tx_servq *ptxservq)
ptxservq->qcnt = 0;
 }
 
-void   _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
+void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
 {
memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv));
spin_lock_init(_xmitpriv->lock);
@@ -35,12 +35,12 @@ void_rtw_init_sta_xmit_priv(struct sta_xmit_priv 
*psta_xmitpriv)
INIT_LIST_HEAD(_xmitpriv->apsd);
 }
 
-s32_rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter 
*padapter)
+s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 {
int i;
struct xmit_buf *pxmitbuf;
struct xmit_frame *pxframe;
-   int res = _SUCCESS;
+   int res = _SUCCESS;
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
 
-- 
2.18.0

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


Re: [PATCH] staging: erofs: fix a compile warning of Z_EROFS_VLE_VMAP_ONSTACK_PAGES

2018-07-28 Thread Chao Yu
On 2018/7/28 15:10, Gao Xiang wrote:
> There is a type mismatch in the definition of
> Z_EROFS_VLE_VMAP_ONSTACK_PAGES, let's fix it.
> 
> Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050707.html
> Reported-by: kbuild test robot 
> Signed-off-by: Gao Xiang 

Reviewed-by: Chao Yu 

Thanks,

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


Re: [PATCH 00/25] staging: erofs: introduce erofs file system

2018-07-28 Thread Chao Yu
Hello Greg,

On 2018/7/28 15:25, Greg Kroah-Hartman wrote:
> 
> Thanks for submitting this, the filesystem looks very interesting.  I've
> queued it all up now in the staging-next tree.

Thanks very much for queuing erofs filesystem, that's actually excellent news
for us that it can be upstreamed so quickly, I think it will help to attract
more developers or users' attention on the filesystem, it should be beneficial
to its growing. Anyway, hoping it can bring something different on experience of
user in linux. :)

Thanks,

> 
> greg k-h
> 
> .
> 

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


Re: [PATCH 00/25] staging: erofs: introduce erofs file system

2018-07-28 Thread Gao Xiang



On 2018/7/28 15:25, Greg Kroah-Hartman wrote:
> Thanks for submitting this, the filesystem looks very interesting.  I've
> queued it all up now in the staging-next tree.

Thanks for applying, we are continuously optimizing further and hope to attract 
more fs guys :)

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


Re: [PATCH 00/25] staging: erofs: introduce erofs file system

2018-07-28 Thread Greg Kroah-Hartman
On Thu, Jul 26, 2018 at 08:21:43PM +0800, Gao Xiang wrote:
> Hi,
> 
> This is actually the 2nd patchset of erofs file system,
> the original patchset can be found at
> 
> Link: https://marc.info/?l=linux-fsdevel=152776480425624
> 
> In order to keep up with the mainline linux-kernel changes and
> improve it in a more active and timely manner, we put forword
> this upstream proposal for linux-staging.
> 
> EROFS file system is a read-only file system with compression
> support designed for certain devices (especially embeded
> devices) with very limited physical memory and lots of memory
> consumers, such as Android devices. It aimes to provide
> a complete compression solution for such devices focuing
> on high performance and little extra memory overhead.
> 
> It is perferred to select larger compressed cluster sizes
> (generally >= 128k) for traditional compression file systems.
> It reads and decompresses a large compressed cluster at once,
> which has a good-looking random read number when memory
> is sufficient because all historial decompressed data
> is expected to be cached in memory. However, it also
> induces destructive effects when such devices have no enough
> spare memory for caching and decompression.
> 
> EROFS file system acts in some different way. It uses
> fixed-sized compressed size rather than fixed-sized input
> size, namely VLE (variable-length extent) compression,
> which has at least three adventages:
> 
>  1) all data read from block device at once can be
> utilized, and read amplification can be easier to
> estimate and control;
>  2) generally, it has a better compression ratio than
> fixed-sized input compression approaches configured
> with the same size;
>  3) aggressively optimized paths such as partial page
> read can be implemented to gain better performance
> for page-unaligned read (unimplemented yet, in TODO list).
> 
> As can be seen, VLE compression does a great job in small
> compressed cluster sizes, which is of course suitable for
> devices with limited memory. In this patchset, an in-place
> decompresion is also introduced to minimize extra memory usage.
> 
> 
> Apart from compression, EROFS also has the following features
> available and some limits:
>  o page-sized block support (currently, and no buffer-head);
>  o 32-bit block address (16TB for 4KB block);
>  o selectable v1 (32 bytes) / v2 (64 bytes) inode;
>  o 32-bit / 64-bit file size;
>  o 64-bit node number for addressing inodes;
>  o 64-bit s and 32-bit ns timestamps;
>  o inline data support;
>  o inline and shared xattr support;
>  o metadata and data can be mixed (optional);
>  o special inode support;
>  o posix acl support.
> 
> 
> The file system is still actively WIP, see _TODO_ for more details.
> 
> Any comments are welcome. :)

Thanks for submitting this, the filesystem looks very interesting.  I've
queued it all up now in the staging-next tree.

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


Re: [PATCH 5/5] staging: gasket: core: hold reference on device kobj while in use

2018-07-28 Thread Greg Kroah-Hartman
On Fri, Jul 27, 2018 at 10:22:00PM -0700, Todd Poynor wrote:
> From: Todd Poynor 
> 
> Hold a reference on the struct device kobject while a pointer to that
> device is in use by gasket.
> 
> Reported-by: Greg Kroah-Hartman 
> Signed-off-by: Todd Poynor 
> ---
>  drivers/staging/gasket/gasket_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/gasket/gasket_core.c 
> b/drivers/staging/gasket/gasket_core.c
> index 859a6df9e12df..1dc7273e38734 100644
> --- a/drivers/staging/gasket/gasket_core.c
> +++ b/drivers/staging/gasket/gasket_core.c
> @@ -449,6 +449,7 @@ static int gasket_alloc_dev(
>   gasket_dev->dev_idx = dev_idx;
>   snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", kobj_name);
>   gasket_dev->dev = parent;
> + kobject_get(_dev->dev->kobj);

Hint, if you are a driver, working with devices, you should never call a
kobject_* or sysfs_* call.  If you are, you are doing something really
wrong and odd and should seriously reconsider it.  No driver should ever
be touching a "raw" kobject.

For this case, get_device()/put_device() is what you should be using.

thanks,

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


[PATCH] staging: erofs: fix a compile warning of Z_EROFS_VLE_VMAP_ONSTACK_PAGES

2018-07-28 Thread Gao Xiang
There is a type mismatch in the definition of
Z_EROFS_VLE_VMAP_ONSTACK_PAGES, let's fix it.

Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050707.html
Reported-by: kbuild test robot 
Signed-off-by: Gao Xiang 
---
 drivers/staging/erofs/unzip_vle.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/erofs/unzip_vle.h 
b/drivers/staging/erofs/unzip_vle.h
index 3521dfb..3939985 100644
--- a/drivers/staging/erofs/unzip_vle.h
+++ b/drivers/staging/erofs/unzip_vle.h
@@ -218,7 +218,7 @@ static inline void z_erofs_onlinepage_endio(struct page 
*page)
 }
 
 #define Z_EROFS_VLE_VMAP_ONSTACK_PAGES \
-   min(THREAD_SIZE / 8 / sizeof(struct page *), 96UL)
+   min_t(unsigned int, THREAD_SIZE / 8 / sizeof(struct page *), 96U)
 #define Z_EROFS_VLE_VMAP_GLOBAL_PAGES  2048
 
 /* unzip_vle_lz4.c */
-- 
1.9.1

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