Re: [PATCH 3/3] staging: wilc1000: refactor p2p action frames handling API's

2020-02-10 Thread Dan Carpenter
On Tue, Feb 11, 2020 at 09:51:01AM +0300, Dan Carpenter wrote:
> On Mon, Feb 10, 2020 at 06:36:01PM +, ajay.kat...@microchip.com wrote:
> > +   if (sta_ch == WILC_INVALID_CHANNEL)
> > +   return;
> >  
> > while (index < len) {
> 
> This range checking was there in the original code, but it's not
> correct.  index and len are in terms of bytes so we know that we can
> read one byte from [index] but we are reading a wilc_attr_entry
> struct which is larger than a type.  The struct is actually flexibly

I meant byte.

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


Re: [PATCH 3/3] staging: wilc1000: refactor p2p action frames handling API's

2020-02-10 Thread Dan Carpenter
On Mon, Feb 10, 2020 at 06:36:01PM +, ajay.kat...@microchip.com wrote:
> + if (sta_ch == WILC_INVALID_CHANNEL)
> + return;
>  
>   while (index < len) {

This range checking was there in the original code, but it's not
correct.  index and len are in terms of bytes so we know that we can
read one byte from [index] but we are reading a wilc_attr_entry
struct which is larger than a type.  The struct is actually flexibly
sized so this should be something like:

while (index + sizeof(struct wilc_attr_entry) <= len) {
e = (struct wilc_attr_entry *)[index];
if (index + sizeof(struct wilc_attr_entry) +
le16_to_cpu(e->attr_len) > len)
break;

> - if (buf[index] ==  CHANLIST_ATTR_ID)
> - channel_list_attr_index = index;
> - else if (buf[index] ==  OPERCHAN_ATTR_ID)
> - op_channel_attr_index = index;
> - index += buf[index + 1] + 3;
> + e = (struct wilc_attr_entry *)[index];
> + if (e->attr_type == IEEE80211_P2P_ATTR_CHANNEL_LIST)
> + ch_list_idx = index;
> + else if (e->attr_type == IEEE80211_P2P_ATTR_OPER_CHANNEL)
> + op_ch_idx = index;
> + if (ch_list_idx && op_ch_idx)
> + break;
> + index += le16_to_cpu(e->attr_len) + sizeof(*e);
>   }

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


[PATCH] staging: rtl8188eu: rename variable pnetdev -> netdev

2020-02-10 Thread Michael Straube
Rename the local variable pnetdev in rtw_alloc_etherdev_with_old_priv
to avoid hungarian notation and clear the last checkpatch warning in
the file osdep_service.c.

rtl8188eu/os_dep/osdep_service.c:32: WARNING: line over 80 characters

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

diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c 
b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
index 4ba2378a1bb8..4d6d0347ab8e 100644
--- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
@@ -26,17 +26,17 @@ void _rtw_init_queue(struct __queue *pqueue)
 
 struct net_device *rtw_alloc_etherdev_with_old_priv(void *old_priv)
 {
-   struct net_device *pnetdev;
+   struct net_device *netdev;
struct rtw_netdev_priv_indicator *pnpi;
 
-   pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 
4);
-   if (!pnetdev)
+   netdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
+   if (!netdev)
return NULL;
 
-   pnpi = netdev_priv(pnetdev);
+   pnpi = netdev_priv(netdev);
pnpi->priv = old_priv;
 
-   return pnetdev;
+   return netdev;
 }
 
 void rtw_free_netdev(struct net_device *netdev)
-- 
2.25.0

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


[PATCH v2 17/19] staging: exfat: Rename variable 'CreateTimestamp' to 'create_timestamp'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "CreateTimestamp" to
"create_timestamp"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 46 ++---
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 90153175bbb9..c99652ab13f1 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -278,7 +278,7 @@ struct dir_entry_t {
u32 attr;
u64 Size;
u32 num_subdirs;
-   struct date_time_t CreateTimestamp;
+   struct date_time_t create_timestamp;
struct date_time_t ModifyTimestamp;
struct date_time_t AccessTimestamp;
 };
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 365e9e719bcf..ed862c3e3e10 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1458,7 +1458,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
if ((fid->dir.dir == p_fs->root_dir) &&
(fid->entry == -1)) {
info->attr = ATTR_SUBDIR;
-   memset((char *)>CreateTimestamp, 0,
+   memset((char *)>create_timestamp, 0,
   sizeof(struct date_time_t));
memset((char *)>ModifyTimestamp, 0,
   sizeof(struct date_time_t));
@@ -1505,13 +1505,13 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
-   info->CreateTimestamp.year = tm.year;
-   info->CreateTimestamp.month = tm.mon;
-   info->CreateTimestamp.day = tm.day;
-   info->CreateTimestamp.hour = tm.hour;
-   info->CreateTimestamp.minute = tm.min;
-   info->CreateTimestamp.second = tm.sec;
-   info->CreateTimestamp.millisecond = 0;
+   info->create_timestamp.year = tm.year;
+   info->create_timestamp.month = tm.mon;
+   info->create_timestamp.day = tm.day;
+   info->create_timestamp.hour = tm.hour;
+   info->create_timestamp.minute = tm.min;
+   info->create_timestamp.second = tm.sec;
+   info->create_timestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
info->ModifyTimestamp.year = tm.year;
@@ -1605,12 +1605,12 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
exfat_set_entry_attr(ep, info->attr);
 
/* set FILE_INFO structure using the acquired struct dentry_t */
-   tm.sec  = info->CreateTimestamp.second;
-   tm.min  = info->CreateTimestamp.minute;
-   tm.hour = info->CreateTimestamp.hour;
-   tm.day  = info->CreateTimestamp.day;
-   tm.mon  = info->CreateTimestamp.month;
-   tm.year = info->CreateTimestamp.year;
+   tm.sec  = info->create_timestamp.second;
+   tm.min  = info->create_timestamp.minute;
+   tm.hour = info->create_timestamp.hour;
+   tm.day  = info->create_timestamp.day;
+   tm.mon  = info->create_timestamp.month;
+   tm.year = info->create_timestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
 
tm.sec  = info->ModifyTimestamp.second;
@@ -1922,13 +1922,13 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
-   dir_entry->CreateTimestamp.year = tm.year;
-   dir_entry->CreateTimestamp.month = tm.mon;
-   dir_entry->CreateTimestamp.day = tm.day;
-   dir_entry->CreateTimestamp.hour = tm.hour;
-   dir_entry->CreateTimestamp.minute = tm.min;
-   dir_entry->CreateTimestamp.second = tm.sec;
-   dir_entry->CreateTimestamp.millisecond = 0;
+   dir_entry->create_timestamp.year = tm.year;
+   dir_entry->create_timestamp.month = tm.mon;
+   dir_entry->create_timestamp.day = tm.day;
+   dir_entry->create_timestamp.hour = tm.hour;
+   dir_entry->create_timestamp.minute = tm.min;
+   dir_entry->create_timestamp.second = tm.sec;
+   dir_entry->create_timestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
@@ -3189,7 +3189,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
& ~((loff_t)p_fs->cluster_size - 1)) >> 9;
 
exfat_time_fat2unix(>i_mtime, );
-   exfat_time_fat2unix(>i_ctime, );
+   exfat_time_fat2unix(>i_ctime, _timestamp);

[PATCH v2 18/19] staging: exfat: Rename variable 'ModifyTimestamp' to 'modify_timestamp'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "ModifyTimestamp" to
"modify_timestamp"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 46 ++---
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index c99652ab13f1..2c911f1ea949 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -279,7 +279,7 @@ struct dir_entry_t {
u64 Size;
u32 num_subdirs;
struct date_time_t create_timestamp;
-   struct date_time_t ModifyTimestamp;
+   struct date_time_t modify_timestamp;
struct date_time_t AccessTimestamp;
 };
 
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index ed862c3e3e10..7388aa8fb344 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1460,7 +1460,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->attr = ATTR_SUBDIR;
memset((char *)>create_timestamp, 0,
   sizeof(struct date_time_t));
-   memset((char *)>ModifyTimestamp, 0,
+   memset((char *)>modify_timestamp, 0,
   sizeof(struct date_time_t));
memset((char *)>AccessTimestamp, 0,
   sizeof(struct date_time_t));
@@ -1514,13 +1514,13 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->create_timestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
-   info->ModifyTimestamp.year = tm.year;
-   info->ModifyTimestamp.month = tm.mon;
-   info->ModifyTimestamp.day = tm.day;
-   info->ModifyTimestamp.hour = tm.hour;
-   info->ModifyTimestamp.minute = tm.min;
-   info->ModifyTimestamp.second = tm.sec;
-   info->ModifyTimestamp.millisecond = 0;
+   info->modify_timestamp.year = tm.year;
+   info->modify_timestamp.month = tm.mon;
+   info->modify_timestamp.day = tm.day;
+   info->modify_timestamp.hour = tm.hour;
+   info->modify_timestamp.minute = tm.min;
+   info->modify_timestamp.second = tm.sec;
+   info->modify_timestamp.millisecond = 0;
 
memset((char *)>AccessTimestamp, 0, sizeof(struct date_time_t));
 
@@ -1613,12 +1613,12 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.year = info->create_timestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
 
-   tm.sec  = info->ModifyTimestamp.second;
-   tm.min  = info->ModifyTimestamp.minute;
-   tm.hour = info->ModifyTimestamp.hour;
-   tm.day  = info->ModifyTimestamp.day;
-   tm.mon  = info->ModifyTimestamp.month;
-   tm.year = info->ModifyTimestamp.year;
+   tm.sec  = info->modify_timestamp.second;
+   tm.min  = info->modify_timestamp.minute;
+   tm.hour = info->modify_timestamp.hour;
+   tm.day  = info->modify_timestamp.day;
+   tm.mon  = info->modify_timestamp.month;
+   tm.year = info->modify_timestamp.year;
exfat_set_entry_time(ep, , TM_MODIFY);
 
exfat_set_entry_size(ep2, info->Size);
@@ -1931,13 +1931,13 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->create_timestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
-   dir_entry->ModifyTimestamp.year = tm.year;
-   dir_entry->ModifyTimestamp.month = tm.mon;
-   dir_entry->ModifyTimestamp.day = tm.day;
-   dir_entry->ModifyTimestamp.hour = tm.hour;
-   dir_entry->ModifyTimestamp.minute = tm.min;
-   dir_entry->ModifyTimestamp.second = tm.sec;
-   dir_entry->ModifyTimestamp.millisecond = 0;
+   dir_entry->modify_timestamp.year = tm.year;
+   dir_entry->modify_timestamp.month = tm.mon;
+   dir_entry->modify_timestamp.day = tm.day;
+   dir_entry->modify_timestamp.hour = tm.hour;
+   dir_entry->modify_timestamp.minute = tm.min;
+   dir_entry->modify_timestamp.second = tm.sec;
+   dir_entry->modify_timestamp.millisecond = 0;
 
memset((char *)_entry->AccessTimestamp, 0,
   sizeof(struct date_time_t));
@@ -3188,7 +3188,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
inode->i_blocks = ((i_size_read(inode) + (p_fs->cluster_size - 1))
& ~((loff_t)p_fs->cluster_size - 1)) >> 9;
 
-   exfat_time_fat2unix(>i_mtime, );
+   exfat_time_fat2unix(>i_mtime, _timestamp);

[PATCH v2 16/19] staging: exfat: Rename variable 'NumSubdirs' to 'num_subdirs'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "NumSubdirs" to "num_subdirs"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 883e2c5ae6df..90153175bbb9 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -277,7 +277,7 @@ struct dir_entry_t {
 
u32 attr;
u64 Size;
-   u32 NumSubdirs;
+   u32 num_subdirs;
struct date_time_t CreateTimestamp;
struct date_time_t ModifyTimestamp;
struct date_time_t AccessTimestamp;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 13ff6ba97528..365e9e719bcf 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1484,7 +1484,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
ret = count; /* propagate error upward */
goto out;
}
-   info->NumSubdirs = count;
+   info->num_subdirs = count;
 
if (p_fs->dev_ejected)
ret = -EIO;
@@ -1532,7 +1532,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
  uni_name.name);
nls_uniname_to_cstring(sb, info->name, _name);
 
-   info->NumSubdirs = 2;
+   info->num_subdirs = 2;
 
info->Size = exfat_get_entry_size(ep2);
 
@@ -1551,7 +1551,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
ret = count; /* propagate error upward */
goto out;
}
-   info->NumSubdirs += count;
+   info->num_subdirs += count;
}
 
if (p_fs->dev_ejected)
@@ -3164,7 +3164,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
 
i_size_write(inode, info.Size);
EXFAT_I(inode)->mmu_private = i_size_read(inode);
-   set_nlink(inode, info.NumSubdirs);
+   set_nlink(inode, info.num_subdirs);
} else if (info.attr & ATTR_SYMLINK) { /* symbolic link */
inode->i_generation |= 1;
inode->i_mode = exfat_make_mode(sbi, info.attr, 0777);
@@ -3664,7 +3664,7 @@ static int exfat_read_root(struct inode *inode)
inode->i_mtime = curtime;
inode->i_atime = curtime;
inode->i_ctime = curtime;
-   set_nlink(inode, info.NumSubdirs + 2);
+   set_nlink(inode, info.num_subdirs + 2);
 
return 0;
 }
-- 
2.17.1

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


[PATCH v2 19/19] staging: exfat: Rename variable 'AccessTimestamp' to 'access_timestamp'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "AccessTimestamp" to
"access_timestamp"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 2c911f1ea949..46cfac322821 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -280,7 +280,7 @@ struct dir_entry_t {
u32 num_subdirs;
struct date_time_t create_timestamp;
struct date_time_t modify_timestamp;
-   struct date_time_t AccessTimestamp;
+   struct date_time_t access_timestamp;
 };
 
 struct timestamp_t {
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 7388aa8fb344..9f47102e3f38 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1462,7 +1462,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
   sizeof(struct date_time_t));
memset((char *)>modify_timestamp, 0,
   sizeof(struct date_time_t));
-   memset((char *)>AccessTimestamp, 0,
+   memset((char *)>access_timestamp, 0,
   sizeof(struct date_time_t));
strcpy(info->short_name, ".");
strcpy(info->name, ".");
@@ -1522,7 +1522,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->modify_timestamp.second = tm.sec;
info->modify_timestamp.millisecond = 0;
 
-   memset((char *)>AccessTimestamp, 0, sizeof(struct date_time_t));
+   memset((char *)>access_timestamp, 0, sizeof(struct date_time_t));
 
*uni_name.name = 0x0;
/* XXX this is very bad for exfat cuz name is already included in es.
@@ -1939,7 +1939,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->modify_timestamp.second = tm.sec;
dir_entry->modify_timestamp.millisecond = 0;
 
-   memset((char *)_entry->AccessTimestamp, 0,
+   memset((char *)_entry->access_timestamp, 0,
   sizeof(struct date_time_t));
 
*uni_name.name = 0x0;
@@ -3190,7 +3190,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
 
exfat_time_fat2unix(>i_mtime, _timestamp);
exfat_time_fat2unix(>i_ctime, _timestamp);
-   exfat_time_fat2unix(>i_atime, );
+   exfat_time_fat2unix(>i_atime, _timestamp);
 
return 0;
 }
@@ -3261,7 +3261,7 @@ static int exfat_write_inode(struct inode *inode, struct 
writeback_control *wbc)
 
exfat_time_unix2fat(>i_mtime, _timestamp);
exfat_time_unix2fat(>i_ctime, _timestamp);
-   exfat_time_unix2fat(>i_atime, );
+   exfat_time_unix2fat(>i_atime, _timestamp);
 
ffsWriteStat(inode, );
 
-- 
2.17.1

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


[PATCH v2 12/19] staging: exfat: Rename variable 'UsedClusters' to 'used_clusters'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "UsedClusters" to "used_clusters"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   | 2 +-
 drivers/staging/exfat/exfat_super.c | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index aa6c46628fdd..01d79dcc1c94 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -246,7 +246,7 @@ struct vol_info_t {
u32  cluster_size;
u32  num_clusters;
u32  free_clusters;
-   u32  UsedClusters;
+   u32  used_clusters;
 };
 
 /* directory structure */
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index dcccf4170afe..7d70206eb5f8 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -497,8 +497,8 @@ static int ffsGetVolInfo(struct super_block *sb, struct 
vol_info_t *info)
info->fat_type = p_fs->vol_type;
info->cluster_size = p_fs->cluster_size;
info->num_clusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
-   info->UsedClusters = p_fs->used_clusters;
-   info->free_clusters = info->num_clusters - info->UsedClusters;
+   info->used_clusters = p_fs->used_clusters;
+   info->free_clusters = info->num_clusters - info->used_clusters;
 
if (p_fs->dev_ejected)
err = -EIO;
@@ -3348,8 +3348,8 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
info.fat_type = p_fs->vol_type;
info.cluster_size = p_fs->cluster_size;
info.num_clusters = p_fs->num_clusters - 2;
-   info.UsedClusters = p_fs->used_clusters;
-   info.free_clusters = info.num_clusters - info.UsedClusters;
+   info.used_clusters = p_fs->used_clusters;
+   info.free_clusters = info.num_clusters - info.used_clusters;
 
if (p_fs->dev_ejected)
pr_info("[EXFAT] statfs on device that is ejected\n");
-- 
2.17.1

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


[PATCH v2 15/19] staging: exfat: Rename variable 'Attr' to 'attr'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Attr" to "attr"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 24 
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 319c53fb62dc..883e2c5ae6df 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -275,7 +275,7 @@ struct dir_entry_t {
/* used only for FAT12/16/32, not used for exFAT */
char short_name[DOS_NAME_LENGTH + 2];
 
-   u32 Attr;
+   u32 attr;
u64 Size;
u32 NumSubdirs;
struct date_time_t CreateTimestamp;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index d32759d5ba68..13ff6ba97528 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1457,7 +1457,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
if (is_dir) {
if ((fid->dir.dir == p_fs->root_dir) &&
(fid->entry == -1)) {
-   info->Attr = ATTR_SUBDIR;
+   info->attr = ATTR_SUBDIR;
memset((char *)>CreateTimestamp, 0,
   sizeof(struct date_time_t));
memset((char *)>ModifyTimestamp, 0,
@@ -1502,7 +1502,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
ep2 = ep + 1;
 
/* set FILE_INFO structure using the acquired struct dentry_t */
-   info->Attr = exfat_get_entry_attr(ep);
+   info->attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
info->CreateTimestamp.year = tm.year;
@@ -1602,7 +1602,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
}
ep2 = ep + 1;
 
-   exfat_set_entry_attr(ep, info->Attr);
+   exfat_set_entry_attr(ep, info->attr);
 
/* set FILE_INFO structure using the acquired struct dentry_t */
tm.sec  = info->CreateTimestamp.second;
@@ -1919,7 +1919,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
continue;
 
exfat_buf_lock(sb, sector);
-   dir_entry->Attr = exfat_get_entry_attr(ep);
+   dir_entry->attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
dir_entry->CreateTimestamp.year = tm.year;
@@ -2147,7 +2147,7 @@ static int exfat_readdir(struct file *filp, struct 
dir_context *ctx)
}
 
if (!dir_emit(ctx, de.name, strlen(de.name), inum,
- (de.Attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
+ (de.attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
goto out;
 
ctx->pos = cpos;
@@ -3156,25 +3156,25 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
INC_IVERSION(inode);
inode->i_generation = prandom_u32();
 
-   if (info.Attr & ATTR_SUBDIR) { /* directory */
+   if (info.attr & ATTR_SUBDIR) { /* directory */
inode->i_generation &= ~1;
-   inode->i_mode = exfat_make_mode(sbi, info.Attr, 0777);
+   inode->i_mode = exfat_make_mode(sbi, info.attr, 0777);
inode->i_op = _dir_inode_operations;
inode->i_fop = _dir_operations;
 
i_size_write(inode, info.Size);
EXFAT_I(inode)->mmu_private = i_size_read(inode);
set_nlink(inode, info.NumSubdirs);
-   } else if (info.Attr & ATTR_SYMLINK) { /* symbolic link */
+   } else if (info.attr & ATTR_SYMLINK) { /* symbolic link */
inode->i_generation |= 1;
-   inode->i_mode = exfat_make_mode(sbi, info.Attr, 0777);
+   inode->i_mode = exfat_make_mode(sbi, info.attr, 0777);
inode->i_op = _symlink_inode_operations;
 
i_size_write(inode, info.Size);
EXFAT_I(inode)->mmu_private = i_size_read(inode);
} else { /* regular file */
inode->i_generation |= 1;
-   inode->i_mode = exfat_make_mode(sbi, info.Attr, 0777);
+   inode->i_mode = exfat_make_mode(sbi, info.attr, 0777);
inode->i_op = _file_inode_operations;
inode->i_fop = _file_operations;
inode->i_mapping->a_ops = _aops;
@@ -3183,7 +3183,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
i_size_write(inode, info.Size);
EXFAT_I(inode)->mmu_private = i_size_read(inode);
}
-   exfat_save_attr(inode, info.Attr);
+   exfat_save_attr(inode, info.attr);
 
inode->i_blocks = ((i_size_read(inode) + (p_fs->cluster_size - 1))
  

[PATCH v2 14/19] staging: exfat: Rename variable 'ShortName' to 'short_name'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "ShortName" to "short_name"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   | 2 +-
 drivers/staging/exfat/exfat_super.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 3acb4701a30b..319c53fb62dc 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -273,7 +273,7 @@ struct dir_entry_t {
char name[MAX_NAME_LENGTH * MAX_CHARSET_SIZE];
 
/* used only for FAT12/16/32, not used for exFAT */
-   char ShortName[DOS_NAME_LENGTH + 2];
+   char short_name[DOS_NAME_LENGTH + 2];
 
u32 Attr;
u64 Size;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 566a6f62ed67..d32759d5ba68 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1464,7 +1464,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
   sizeof(struct date_time_t));
memset((char *)>AccessTimestamp, 0,
   sizeof(struct date_time_t));
-   strcpy(info->ShortName, ".");
+   strcpy(info->short_name, ".");
strcpy(info->name, ".");
 
dir.dir = p_fs->root_dir;
@@ -2129,9 +2129,9 @@ static int exfat_readdir(struct file *filp, struct 
dir_context *ctx)
if (!de.name[0])
goto end_of_dir;
 
-   if (!memcmp(de.ShortName, DOS_CUR_DIR_NAME, DOS_NAME_LENGTH)) {
+   if (!memcmp(de.short_name, DOS_CUR_DIR_NAME, DOS_NAME_LENGTH)) {
inum = inode->i_ino;
-   } else if (!memcmp(de.ShortName, DOS_PAR_DIR_NAME, DOS_NAME_LENGTH)) {
+   } else if (!memcmp(de.short_name, DOS_PAR_DIR_NAME, DOS_NAME_LENGTH)) {
inum = parent_ino(filp->f_path.dentry);
} else {
loff_t i_pos = ((loff_t)EXFAT_I(inode)->fid.start_clu << 32) |
-- 
2.17.1

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


[PATCH v2 06/19] staging: exfat: Rename variable 'Second' to 'second'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Second" to "second"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index fe0270e7b685..20179ef7b956 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -227,7 +227,7 @@ struct date_time_t {
u16  day;
u16  hour;
u16  minute;
-   u16  Second;
+   u16  second;
u16  MilliSecond;
 };
 
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 9e1b6a7ad5ff..eced4a408f68 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -60,7 +60,7 @@ static void exfat_write_super(struct super_block *sb);
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->day,
- tp->hour, tp->minute, tp->Second);
+ tp->hour, tp->minute, tp->second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
 }
@@ -75,7 +75,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
 
if (second < UNIX_SECS_1980) {
tp->MilliSecond = 0;
-   tp->Second  = 0;
+   tp->second  = 0;
tp->minute  = 0;
tp->hour= 0;
tp->day = 1;
@@ -86,7 +86,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
 
if (second >= UNIX_SECS_2108) {
tp->MilliSecond = 999;
-   tp->Second  = 59;
+   tp->second  = 59;
tp->minute  = 59;
tp->hour= 23;
tp->day = 31;
@@ -96,7 +96,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
}
 
tp->MilliSecond = ts->tv_nsec / NSEC_PER_MSEC;
-   tp->Second  = tm.tm_sec;
+   tp->second  = tm.tm_sec;
tp->minute  = tm.tm_min;
tp->hour= tm.tm_hour;
tp->day = tm.tm_mday;
@@ -1510,7 +1510,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->CreateTimestamp.day = tm.day;
info->CreateTimestamp.hour = tm.hour;
info->CreateTimestamp.minute = tm.min;
-   info->CreateTimestamp.Second = tm.sec;
+   info->CreateTimestamp.second = tm.sec;
info->CreateTimestamp.MilliSecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
@@ -1519,7 +1519,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->ModifyTimestamp.day = tm.day;
info->ModifyTimestamp.hour = tm.hour;
info->ModifyTimestamp.minute = tm.min;
-   info->ModifyTimestamp.Second = tm.sec;
+   info->ModifyTimestamp.second = tm.sec;
info->ModifyTimestamp.MilliSecond = 0;
 
memset((char *)>AccessTimestamp, 0, sizeof(struct date_time_t));
@@ -1605,7 +1605,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
exfat_set_entry_attr(ep, info->Attr);
 
/* set FILE_INFO structure using the acquired struct dentry_t */
-   tm.sec  = info->CreateTimestamp.Second;
+   tm.sec  = info->CreateTimestamp.second;
tm.min  = info->CreateTimestamp.minute;
tm.hour = info->CreateTimestamp.hour;
tm.day  = info->CreateTimestamp.day;
@@ -1613,7 +1613,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.year = info->CreateTimestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
 
-   tm.sec  = info->ModifyTimestamp.Second;
+   tm.sec  = info->ModifyTimestamp.second;
tm.min  = info->ModifyTimestamp.minute;
tm.hour = info->ModifyTimestamp.hour;
tm.day  = info->ModifyTimestamp.day;
@@ -1927,7 +1927,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.day = tm.day;
dir_entry->CreateTimestamp.hour = tm.hour;
dir_entry->CreateTimestamp.minute = tm.min;
-   dir_entry->CreateTimestamp.Second = tm.sec;
+   dir_entry->CreateTimestamp.second = tm.sec;
dir_entry->CreateTimestamp.MilliSecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
@@ -1936,7 +1936,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->ModifyTimestamp.day = tm.day;
dir_entry->ModifyTimestamp.hour = tm.hour;
dir_entry->ModifyTimestamp.minute = tm.min;
-  

[PATCH v2 13/19] staging: exfat: Rename variable 'Name' to 'name'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Name" to "name"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 01d79dcc1c94..3acb4701a30b 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -270,7 +270,7 @@ struct file_id_t {
 };
 
 struct dir_entry_t {
-   char Name[MAX_NAME_LENGTH * MAX_CHARSET_SIZE];
+   char name[MAX_NAME_LENGTH * MAX_CHARSET_SIZE];
 
/* used only for FAT12/16/32, not used for exFAT */
char ShortName[DOS_NAME_LENGTH + 2];
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 7d70206eb5f8..566a6f62ed67 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1465,7 +1465,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
memset((char *)>AccessTimestamp, 0,
   sizeof(struct date_time_t));
strcpy(info->ShortName, ".");
-   strcpy(info->Name, ".");
+   strcpy(info->name, ".");
 
dir.dir = p_fs->root_dir;
dir.flags = 0x01;
@@ -1530,7 +1530,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
 */
exfat_get_uni_name_from_ext_entry(sb, >dir, fid->entry,
  uni_name.name);
-   nls_uniname_to_cstring(sb, info->Name, _name);
+   nls_uniname_to_cstring(sb, info->name, _name);
 
info->NumSubdirs = 2;
 
@@ -1945,7 +1945,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
*uni_name.name = 0x0;
exfat_get_uni_name_from_ext_entry(sb, , dentry,
  uni_name.name);
-   nls_uniname_to_cstring(sb, dir_entry->Name, _name);
+   nls_uniname_to_cstring(sb, dir_entry->name, _name);
exfat_buf_unlock(sb, sector);
 
ep = get_entry_in_dir(sb, , i + 1, NULL);
@@ -1988,7 +1988,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
}
}
 
-   *dir_entry->Name = '\0';
+   *dir_entry->name = '\0';
 
fid->rwoffset = (s64)(++dentry);
 
@@ -2126,7 +2126,7 @@ static int exfat_readdir(struct file *filp, struct 
dir_context *ctx)
 
cpos = EXFAT_I(inode)->fid.rwoffset << DENTRY_SIZE_BITS;
 
-   if (!de.Name[0])
+   if (!de.name[0])
goto end_of_dir;
 
if (!memcmp(de.ShortName, DOS_CUR_DIR_NAME, DOS_NAME_LENGTH)) {
@@ -2146,7 +2146,7 @@ static int exfat_readdir(struct file *filp, struct 
dir_context *ctx)
}
}
 
-   if (!dir_emit(ctx, de.Name, strlen(de.Name), inum,
+   if (!dir_emit(ctx, de.name, strlen(de.name), inum,
  (de.Attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
goto out;
 
-- 
2.17.1

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


[PATCH v2 11/19] staging: exfat: Rename variable 'FreeClusters' to 'free_clusters'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "FreeClusters" to "free_clusters"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   | 2 +-
 drivers/staging/exfat/exfat_super.c | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index df84a729d5d5..aa6c46628fdd 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -245,7 +245,7 @@ struct vol_info_t {
u32  fat_type;
u32  cluster_size;
u32  num_clusters;
-   u32  FreeClusters;
+   u32  free_clusters;
u32  UsedClusters;
 };
 
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 59e18b37dd7d..dcccf4170afe 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -498,7 +498,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct 
vol_info_t *info)
info->cluster_size = p_fs->cluster_size;
info->num_clusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
info->UsedClusters = p_fs->used_clusters;
-   info->FreeClusters = info->num_clusters - info->UsedClusters;
+   info->free_clusters = info->num_clusters - info->UsedClusters;
 
if (p_fs->dev_ejected)
err = -EIO;
@@ -3349,7 +3349,7 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
info.cluster_size = p_fs->cluster_size;
info.num_clusters = p_fs->num_clusters - 2;
info.UsedClusters = p_fs->used_clusters;
-   info.FreeClusters = info.num_clusters - info.UsedClusters;
+   info.free_clusters = info.num_clusters - info.UsedClusters;
 
if (p_fs->dev_ejected)
pr_info("[EXFAT] statfs on device that is ejected\n");
@@ -3358,8 +3358,8 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
buf->f_type = sb->s_magic;
buf->f_bsize = info.cluster_size;
buf->f_blocks = info.num_clusters;
-   buf->f_bfree = info.FreeClusters;
-   buf->f_bavail = info.FreeClusters;
+   buf->f_bfree = info.free_clusters;
+   buf->f_bavail = info.free_clusters;
buf->f_fsid.val[0] = (u32)id;
buf->f_fsid.val[1] = (u32)(id >> 32);
buf->f_namelen = 260;
-- 
2.17.1

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


[PATCH v2 10/19] staging: exfat: Rename variable 'NumClusters' to 'num_clusters'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences identifier "NumClusters" to "num_clusters"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index c6e3981cc370..df84a729d5d5 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -244,7 +244,7 @@ struct dev_info_t {
 struct vol_info_t {
u32  fat_type;
u32  cluster_size;
-   u32  NumClusters;
+   u32  num_clusters;
u32  FreeClusters;
u32  UsedClusters;
 };
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index cac5631d0f11..59e18b37dd7d 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -496,9 +496,9 @@ static int ffsGetVolInfo(struct super_block *sb, struct 
vol_info_t *info)
 
info->fat_type = p_fs->vol_type;
info->cluster_size = p_fs->cluster_size;
-   info->NumClusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
+   info->num_clusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
info->UsedClusters = p_fs->used_clusters;
-   info->FreeClusters = info->NumClusters - info->UsedClusters;
+   info->FreeClusters = info->num_clusters - info->UsedClusters;
 
if (p_fs->dev_ejected)
err = -EIO;
@@ -3347,9 +3347,9 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
} else {
info.fat_type = p_fs->vol_type;
info.cluster_size = p_fs->cluster_size;
-   info.NumClusters = p_fs->num_clusters - 2;
+   info.num_clusters = p_fs->num_clusters - 2;
info.UsedClusters = p_fs->used_clusters;
-   info.FreeClusters = info.NumClusters - info.UsedClusters;
+   info.FreeClusters = info.num_clusters - info.UsedClusters;
 
if (p_fs->dev_ejected)
pr_info("[EXFAT] statfs on device that is ejected\n");
@@ -3357,7 +3357,7 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
 
buf->f_type = sb->s_magic;
buf->f_bsize = info.cluster_size;
-   buf->f_blocks = info.NumClusters;
+   buf->f_blocks = info.num_clusters;
buf->f_bfree = info.FreeClusters;
buf->f_bavail = info.FreeClusters;
buf->f_fsid.val[0] = (u32)id;
-- 
2.17.1

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


[PATCH v2 05/19] staging: exfat: Rename variable 'Minute' to 'minute'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Minute" to "minute"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 4ec4660e3a4d..fe0270e7b685 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -226,7 +226,7 @@ struct date_time_t {
u16  month;
u16  day;
u16  hour;
-   u16  Minute;
+   u16  minute;
u16  Second;
u16  MilliSecond;
 };
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 41e4fb8b697f..9e1b6a7ad5ff 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -60,7 +60,7 @@ static void exfat_write_super(struct super_block *sb);
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->day,
- tp->hour, tp->Minute, tp->Second);
+ tp->hour, tp->minute, tp->Second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
 }
@@ -76,7 +76,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
if (second < UNIX_SECS_1980) {
tp->MilliSecond = 0;
tp->Second  = 0;
-   tp->Minute  = 0;
+   tp->minute  = 0;
tp->hour= 0;
tp->day = 1;
tp->month   = 1;
@@ -87,7 +87,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
if (second >= UNIX_SECS_2108) {
tp->MilliSecond = 999;
tp->Second  = 59;
-   tp->Minute  = 59;
+   tp->minute  = 59;
tp->hour= 23;
tp->day = 31;
tp->month   = 12;
@@ -97,7 +97,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
 
tp->MilliSecond = ts->tv_nsec / NSEC_PER_MSEC;
tp->Second  = tm.tm_sec;
-   tp->Minute  = tm.tm_min;
+   tp->minute  = tm.tm_min;
tp->hour= tm.tm_hour;
tp->day = tm.tm_mday;
tp->month   = tm.tm_mon + 1;
@@ -1509,7 +1509,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->CreateTimestamp.month = tm.mon;
info->CreateTimestamp.day = tm.day;
info->CreateTimestamp.hour = tm.hour;
-   info->CreateTimestamp.Minute = tm.min;
+   info->CreateTimestamp.minute = tm.min;
info->CreateTimestamp.Second = tm.sec;
info->CreateTimestamp.MilliSecond = 0;
 
@@ -1518,7 +1518,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->ModifyTimestamp.month = tm.mon;
info->ModifyTimestamp.day = tm.day;
info->ModifyTimestamp.hour = tm.hour;
-   info->ModifyTimestamp.Minute = tm.min;
+   info->ModifyTimestamp.minute = tm.min;
info->ModifyTimestamp.Second = tm.sec;
info->ModifyTimestamp.MilliSecond = 0;
 
@@ -1606,7 +1606,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
 
/* set FILE_INFO structure using the acquired struct dentry_t */
tm.sec  = info->CreateTimestamp.Second;
-   tm.min  = info->CreateTimestamp.Minute;
+   tm.min  = info->CreateTimestamp.minute;
tm.hour = info->CreateTimestamp.hour;
tm.day  = info->CreateTimestamp.day;
tm.mon  = info->CreateTimestamp.month;
@@ -1614,7 +1614,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
exfat_set_entry_time(ep, , TM_CREATE);
 
tm.sec  = info->ModifyTimestamp.Second;
-   tm.min  = info->ModifyTimestamp.Minute;
+   tm.min  = info->ModifyTimestamp.minute;
tm.hour = info->ModifyTimestamp.hour;
tm.day  = info->ModifyTimestamp.day;
tm.mon  = info->ModifyTimestamp.month;
@@ -1926,7 +1926,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.month = tm.mon;
dir_entry->CreateTimestamp.day = tm.day;
dir_entry->CreateTimestamp.hour = tm.hour;
-   dir_entry->CreateTimestamp.Minute = tm.min;
+   dir_entry->CreateTimestamp.minute = tm.min;
dir_entry->CreateTimestamp.Second = tm.sec;
dir_entry->CreateTimestamp.MilliSecond = 0;
 
@@ -1935,7 +1935,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->ModifyTimestamp.month = tm.mon;

[PATCH v2 04/19] staging: exfat: Rename variable 'Hour' to 'hour'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Hour" to "hour"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 49e9390b4372..4ec4660e3a4d 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -225,7 +225,7 @@ struct date_time_t {
u16  year;
u16  month;
u16  day;
-   u16  Hour;
+   u16  hour;
u16  Minute;
u16  Second;
u16  MilliSecond;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 020529228fdd..41e4fb8b697f 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -60,7 +60,7 @@ static void exfat_write_super(struct super_block *sb);
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->day,
- tp->Hour, tp->Minute, tp->Second);
+ tp->hour, tp->Minute, tp->Second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
 }
@@ -77,7 +77,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->MilliSecond = 0;
tp->Second  = 0;
tp->Minute  = 0;
-   tp->Hour= 0;
+   tp->hour= 0;
tp->day = 1;
tp->month   = 1;
tp->year= 0;
@@ -88,7 +88,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->MilliSecond = 999;
tp->Second  = 59;
tp->Minute  = 59;
-   tp->Hour= 23;
+   tp->hour= 23;
tp->day = 31;
tp->month   = 12;
tp->year= 127;
@@ -98,7 +98,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->MilliSecond = ts->tv_nsec / NSEC_PER_MSEC;
tp->Second  = tm.tm_sec;
tp->Minute  = tm.tm_min;
-   tp->Hour= tm.tm_hour;
+   tp->hour= tm.tm_hour;
tp->day = tm.tm_mday;
tp->month   = tm.tm_mon + 1;
tp->year= tm.tm_year + 1900 - 1980;
@@ -1508,7 +1508,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->CreateTimestamp.year = tm.year;
info->CreateTimestamp.month = tm.mon;
info->CreateTimestamp.day = tm.day;
-   info->CreateTimestamp.Hour = tm.hour;
+   info->CreateTimestamp.hour = tm.hour;
info->CreateTimestamp.Minute = tm.min;
info->CreateTimestamp.Second = tm.sec;
info->CreateTimestamp.MilliSecond = 0;
@@ -1517,7 +1517,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->ModifyTimestamp.year = tm.year;
info->ModifyTimestamp.month = tm.mon;
info->ModifyTimestamp.day = tm.day;
-   info->ModifyTimestamp.Hour = tm.hour;
+   info->ModifyTimestamp.hour = tm.hour;
info->ModifyTimestamp.Minute = tm.min;
info->ModifyTimestamp.Second = tm.sec;
info->ModifyTimestamp.MilliSecond = 0;
@@ -1607,7 +1607,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
/* set FILE_INFO structure using the acquired struct dentry_t */
tm.sec  = info->CreateTimestamp.Second;
tm.min  = info->CreateTimestamp.Minute;
-   tm.hour = info->CreateTimestamp.Hour;
+   tm.hour = info->CreateTimestamp.hour;
tm.day  = info->CreateTimestamp.day;
tm.mon  = info->CreateTimestamp.month;
tm.year = info->CreateTimestamp.year;
@@ -1615,7 +1615,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
 
tm.sec  = info->ModifyTimestamp.Second;
tm.min  = info->ModifyTimestamp.Minute;
-   tm.hour = info->ModifyTimestamp.Hour;
+   tm.hour = info->ModifyTimestamp.hour;
tm.day  = info->ModifyTimestamp.day;
tm.mon  = info->ModifyTimestamp.month;
tm.year = info->ModifyTimestamp.year;
@@ -1925,7 +1925,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.year = tm.year;
dir_entry->CreateTimestamp.month = tm.mon;
dir_entry->CreateTimestamp.day = tm.day;
-   dir_entry->CreateTimestamp.Hour = tm.hour;
+   dir_entry->CreateTimestamp.hour = tm.hour;
dir_entry->CreateTimestamp.Minute = tm.min;
dir_entry->CreateTimestamp.Second = tm.sec;

[PATCH v2 09/19] staging: exfat: Rename variable 'ClusterSize' to 'cluster_size'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "ClusterSize" to "cluster_size"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   | 2 +-
 drivers/staging/exfat/exfat_super.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 43c40addf5a5..c6e3981cc370 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -243,7 +243,7 @@ struct dev_info_t {
 
 struct vol_info_t {
u32  fat_type;
-   u32  ClusterSize;
+   u32  cluster_size;
u32  NumClusters;
u32  FreeClusters;
u32  UsedClusters;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 7b5be94a0bb7..cac5631d0f11 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -495,7 +495,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct 
vol_info_t *info)
p_fs->used_clusters = exfat_count_used_clusters(sb);
 
info->fat_type = p_fs->vol_type;
-   info->ClusterSize = p_fs->cluster_size;
+   info->cluster_size = p_fs->cluster_size;
info->NumClusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
info->UsedClusters = p_fs->used_clusters;
info->FreeClusters = info->NumClusters - info->UsedClusters;
@@ -3346,7 +3346,7 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
 
} else {
info.fat_type = p_fs->vol_type;
-   info.ClusterSize = p_fs->cluster_size;
+   info.cluster_size = p_fs->cluster_size;
info.NumClusters = p_fs->num_clusters - 2;
info.UsedClusters = p_fs->used_clusters;
info.FreeClusters = info.NumClusters - info.UsedClusters;
@@ -3356,7 +3356,7 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
}
 
buf->f_type = sb->s_magic;
-   buf->f_bsize = info.ClusterSize;
+   buf->f_bsize = info.cluster_size;
buf->f_blocks = info.NumClusters;
buf->f_bfree = info.FreeClusters;
buf->f_bavail = info.FreeClusters;
-- 
2.17.1

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


[PATCH v2 07/19] staging: exfat: Rename variable 'MilliSecond' to 'millisecond'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "MilliSecond" to "millisecond"

Signed-off-by: Pragat Pandya 
---
Changes in v1:
 -Rename variable "MilliSecond" to "milli_second"

Changes in v2:
 -Remove unnecessary '_' underscore character in renamed identifier
  name.
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 16 
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 20179ef7b956..96e1e1553e56 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -228,7 +228,7 @@ struct date_time_t {
u16  hour;
u16  minute;
u16  second;
-   u16  MilliSecond;
+   u16  millisecond;
 };
 
 struct part_info_t {
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index eced4a408f68..472a6c8efcbb 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -62,7 +62,7 @@ static void exfat_time_fat2unix(struct timespec64 *ts, struct 
date_time_t *tp)
ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->day,
  tp->hour, tp->minute, tp->second);
 
-   ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
+   ts->tv_nsec = tp->millisecond * NSEC_PER_MSEC;
 }
 
 /* Convert linear UNIX date to a FAT time/date pair. */
@@ -74,7 +74,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
time64_to_tm(second, 0, );
 
if (second < UNIX_SECS_1980) {
-   tp->MilliSecond = 0;
+   tp->millisecond = 0;
tp->second  = 0;
tp->minute  = 0;
tp->hour= 0;
@@ -85,7 +85,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
}
 
if (second >= UNIX_SECS_2108) {
-   tp->MilliSecond = 999;
+   tp->millisecond = 999;
tp->second  = 59;
tp->minute  = 59;
tp->hour= 23;
@@ -95,7 +95,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
return;
}
 
-   tp->MilliSecond = ts->tv_nsec / NSEC_PER_MSEC;
+   tp->millisecond = ts->tv_nsec / NSEC_PER_MSEC;
tp->second  = tm.tm_sec;
tp->minute  = tm.tm_min;
tp->hour= tm.tm_hour;
@@ -1511,7 +1511,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->CreateTimestamp.hour = tm.hour;
info->CreateTimestamp.minute = tm.min;
info->CreateTimestamp.second = tm.sec;
-   info->CreateTimestamp.MilliSecond = 0;
+   info->CreateTimestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
info->ModifyTimestamp.year = tm.year;
@@ -1520,7 +1520,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->ModifyTimestamp.hour = tm.hour;
info->ModifyTimestamp.minute = tm.min;
info->ModifyTimestamp.second = tm.sec;
-   info->ModifyTimestamp.MilliSecond = 0;
+   info->ModifyTimestamp.millisecond = 0;
 
memset((char *)>AccessTimestamp, 0, sizeof(struct date_time_t));
 
@@ -1928,7 +1928,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.hour = tm.hour;
dir_entry->CreateTimestamp.minute = tm.min;
dir_entry->CreateTimestamp.second = tm.sec;
-   dir_entry->CreateTimestamp.MilliSecond = 0;
+   dir_entry->CreateTimestamp.millisecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
@@ -1937,7 +1937,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->ModifyTimestamp.hour = tm.hour;
dir_entry->ModifyTimestamp.minute = tm.min;
dir_entry->ModifyTimestamp.second = tm.sec;
-   dir_entry->ModifyTimestamp.MilliSecond = 0;
+   dir_entry->ModifyTimestamp.millisecond = 0;
 
memset((char *)_entry->AccessTimestamp, 0,
   sizeof(struct date_time_t));
-- 
2.17.1

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


[PATCH v2 08/19] staging: exfat: Rename variable 'FatType' to 'fat_type'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "FatType" to "fat_type"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   | 2 +-
 drivers/staging/exfat/exfat_super.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 96e1e1553e56..43c40addf5a5 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -242,7 +242,7 @@ struct dev_info_t {
 };
 
 struct vol_info_t {
-   u32  FatType;
+   u32  fat_type;
u32  ClusterSize;
u32  NumClusters;
u32  FreeClusters;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 472a6c8efcbb..7b5be94a0bb7 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -494,7 +494,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct 
vol_info_t *info)
if (p_fs->used_clusters == UINT_MAX)
p_fs->used_clusters = exfat_count_used_clusters(sb);
 
-   info->FatType = p_fs->vol_type;
+   info->fat_type = p_fs->vol_type;
info->ClusterSize = p_fs->cluster_size;
info->NumClusters = p_fs->num_clusters - 2; /* clu 0 & 1 */
info->UsedClusters = p_fs->used_clusters;
@@ -3345,7 +3345,7 @@ static int exfat_statfs(struct dentry *dentry, struct 
kstatfs *buf)
return -EIO;
 
} else {
-   info.FatType = p_fs->vol_type;
+   info.fat_type = p_fs->vol_type;
info.ClusterSize = p_fs->cluster_size;
info.NumClusters = p_fs->num_clusters - 2;
info.UsedClusters = p_fs->used_clusters;
-- 
2.17.1

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


[PATCH 2/3] staging: wilc1000: directly fetch 'priv' handler from 'vif' instance

2020-02-10 Thread Ajay.Kathat
From: Ajay Singh 

The 'priv' handler is already present in 'vif' struct so directly fetch
its value from vif handler in wilc_handle_roc_expired().

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

diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c
index 658790bd465b..c8c41c2df4ec 100644
--- a/drivers/staging/wilc1000/hif.c
+++ b/drivers/staging/wilc1000/hif.c
@@ -861,9 +861,8 @@ static int wilc_handle_roc_expired(struct wilc_vif *vif, 
u64 cookie)
struct wid wid;
int result;
struct host_if_drv *hif_drv = vif->hif_drv;
-   struct wilc_priv *priv = wdev_priv(vif->ndev->ieee80211_ptr);
 
-   if (priv->p2p_listen_state) {
+   if (vif->priv.p2p_listen_state) {
remain_on_chan_flag = false;
wid.id = WID_REMAIN_ON_CHAN;
wid.type = WID_STR;
-- 
2.24.0
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 01/19] staging: exfat: Rename variable 'Year' to 'year'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Year" to "year"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 4d87360fab35..30ec81250f08 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -222,7 +222,7 @@ static inline u16 get_row_index(u16 i)
 #endif
 
 struct date_time_t {
-   u16  Year;
+   u16  year;
u16  Month;
u16  Day;
u16  Hour;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index b81d2a87b82e..c2b97a059f52 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -59,7 +59,7 @@ static void exfat_write_super(struct super_block *sb);
 /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
-   ts->tv_sec = mktime64(tp->Year + 1980, tp->Month + 1, tp->Day,
+   ts->tv_sec = mktime64(tp->year + 1980, tp->Month + 1, tp->Day,
  tp->Hour, tp->Minute, tp->Second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
@@ -80,7 +80,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Hour= 0;
tp->Day = 1;
tp->Month   = 1;
-   tp->Year= 0;
+   tp->year= 0;
return;
}
 
@@ -91,7 +91,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Hour= 23;
tp->Day = 31;
tp->Month   = 12;
-   tp->Year= 127;
+   tp->year= 127;
return;
}
 
@@ -101,7 +101,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, 
struct date_time_t *tp)
tp->Hour= tm.tm_hour;
tp->Day = tm.tm_mday;
tp->Month   = tm.tm_mon + 1;
-   tp->Year= tm.tm_year + 1900 - 1980;
+   tp->year= tm.tm_year + 1900 - 1980;
 }
 
 struct timestamp_t *tm_current(struct timestamp_t *tp)
@@ -1505,7 +1505,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->Attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
-   info->CreateTimestamp.Year = tm.year;
+   info->CreateTimestamp.year = tm.year;
info->CreateTimestamp.Month = tm.mon;
info->CreateTimestamp.Day = tm.day;
info->CreateTimestamp.Hour = tm.hour;
@@ -1514,7 +1514,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->CreateTimestamp.MilliSecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
-   info->ModifyTimestamp.Year = tm.year;
+   info->ModifyTimestamp.year = tm.year;
info->ModifyTimestamp.Month = tm.mon;
info->ModifyTimestamp.Day = tm.day;
info->ModifyTimestamp.Hour = tm.hour;
@@ -1610,7 +1610,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.hour = info->CreateTimestamp.Hour;
tm.day  = info->CreateTimestamp.Day;
tm.mon  = info->CreateTimestamp.Month;
-   tm.year = info->CreateTimestamp.Year;
+   tm.year = info->CreateTimestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
 
tm.sec  = info->ModifyTimestamp.Second;
@@ -1618,7 +1618,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.hour = info->ModifyTimestamp.Hour;
tm.day  = info->ModifyTimestamp.Day;
tm.mon  = info->ModifyTimestamp.Month;
-   tm.year = info->ModifyTimestamp.Year;
+   tm.year = info->ModifyTimestamp.year;
exfat_set_entry_time(ep, , TM_MODIFY);
 
exfat_set_entry_size(ep2, info->Size);
@@ -1922,7 +1922,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->Attr = exfat_get_entry_attr(ep);
 
exfat_get_entry_time(ep, , TM_CREATE);
-   dir_entry->CreateTimestamp.Year = tm.year;
+   dir_entry->CreateTimestamp.year = tm.year;
dir_entry->CreateTimestamp.Month = tm.mon;
dir_entry->CreateTimestamp.Day = tm.day;
dir_entry->CreateTimestamp.Hour = tm.hour;
@@ -1931,7 +1931,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.MilliSecond = 0;
 
exfat_get_entry_time(ep, , TM_MODIFY);
-   dir_entry->ModifyTimestamp.Year = tm.year;
+   

[PATCH 1/3] staging: wilc1000: remove use of vendor specific IE for p2p handling

2020-02-10 Thread Ajay.Kathat
From: Ajay Singh 

Remove the use of vendor specific IE parameter to decide
p2p_GO/p2p_Client roles between two 'wilc' device. Previously p2p group
formation between two 'wilc' device make use of vendor IE for roles
decision. The role is decided based on the 'go_intent' value.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/cfg80211.c | 72 ++---
 drivers/staging/wilc1000/netdev.c   |  2 -
 drivers/staging/wilc1000/netdev.h   |  7 ---
 3 files changed, 4 insertions(+), 77 deletions(-)

diff --git a/drivers/staging/wilc1000/cfg80211.c 
b/drivers/staging/wilc1000/cfg80211.c
index 4863e516ff13..7afbc475b3ea 100644
--- a/drivers/staging/wilc1000/cfg80211.c
+++ b/drivers/staging/wilc1000/cfg80211.c
@@ -68,7 +68,6 @@ struct wilc_p2p_mgmt_data {
 };
 
 static const u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09};
-static const u8 p2p_vendor_spec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03};
 
 static void cfg_scan_result(enum scan_event scan_event,
struct wilc_rcvd_net_info *info, void *user_void)
@@ -172,9 +171,6 @@ static void cfg_connect_result(enum conn_event 
conn_disconn_evt, u8 mac_status,
} else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
u16 reason = 0;
 
-   priv->p2p.local_random = 0x01;
-   priv->p2p.recv_random = 0x00;
-   priv->p2p.is_wilc_ie = false;
eth_zero_addr(priv->associated_bss);
wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE);
 
@@ -446,9 +442,6 @@ static int disconnect(struct wiphy *wiphy, struct 
net_device *dev,
wilc->sta_ch = WILC_INVALID_CHANNEL;
wilc_wlan_set_bssid(priv->dev, NULL, WILC_STATION_MODE);
 
-   priv->p2p.local_random = 0x01;
-   priv->p2p.recv_random = 0x00;
-   priv->p2p.is_wilc_ie = false;
priv->hif_drv->p2p_timeout = 0;
 
ret = wilc_disconnect(vif);
@@ -934,9 +927,6 @@ static void wilc_wfi_cfg_parse_rx_action(u8 *buf, u32 len, 
u8 sta_ch)
u8 channel_list_attr_index = 0;
 
while (index < len) {
-   if (buf[index] == GO_INTENT_ATTR_ID)
-   buf[index + 3] = (buf[index + 3]  & 0x01) | (0x00 << 1);
-
if (buf[index] ==  CHANLIST_ATTR_ID)
channel_list_attr_index = index;
else if (buf[index] ==  OPERCHAN_ATTR_ID)
@@ -956,12 +946,6 @@ static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 len, 
bool oper_ch,
u8 channel_list_attr_index = 0;
 
while (index < len) {
-   if (buf[index] == GO_INTENT_ATTR_ID) {
-   buf[index + 3] = (buf[index + 3]  & 0x01) | (0x0f << 1);
-
-   break;
-   }
-
if (buf[index] ==  CHANLIST_ATTR_ID)
channel_list_attr_index = index;
else if (buf[index] ==  OPERCHAN_ATTR_ID)
@@ -981,24 +965,6 @@ static void wilc_wfi_cfg_parse_rx_vendor_spec(struct 
wilc_priv *priv, u8 *buff,
struct wilc_vif *vif = netdev_priv(priv->dev);
 
subtype = buff[P2P_PUB_ACTION_SUBTYPE];
-   if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) &&
-   !priv->p2p.is_wilc_ie) {
-   for (i = P2P_PUB_ACTION_SUBTYPE; i < size; i++) {
-   if (!memcmp(p2p_vendor_spec, [i], 6)) {
-   priv->p2p.recv_random = buff[i + 6];
-   priv->p2p.is_wilc_ie = true;
-   break;
-   }
-   }
-   }
-
-   if (priv->p2p.local_random <= priv->p2p.recv_random) {
-   netdev_dbg(vif->ndev,
-  "PEER WILL BE GO LocaRand=%02x RecvRand %02x\n",
-  priv->p2p.local_random, priv->p2p.recv_random);
-   return;
-   }
-
if (subtype == GO_NEG_REQ || subtype == GO_NEG_RSP ||
subtype == P2P_INV_REQ || subtype == P2P_INV_RSP) {
for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < size; i++) {
@@ -1051,8 +1017,6 @@ void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 
size)
return;
}
if (buff[ACTION_CAT_ID] == PUB_ACTION_ATTR_ID) {
-   u8 subtype = buff[P2P_PUB_ACTION_SUBTYPE];
-
switch (buff[ACTION_SUBTYPE_ID]) {
case GAS_INITIAL_REQ:
case GAS_INITIAL_RSP:
@@ -1063,10 +1027,6 @@ void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 
size)
wilc_wfi_cfg_parse_rx_vendor_spec(priv, buff,
  size);
 
-   if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) &&
-   priv->p2p.is_wilc_ie)
-   size -= 7;
-
break;
 
default:
@@ -1167,17 +1127,8 @@ static void wilc_wfi_cfg_tx_vendor_spec(struct wilc_priv 
*priv,
  

[PATCH v2 02/19] staging: exfat: Rename variable 'Month' to 'month'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Month" to "month"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 30ec81250f08..ae7f8e035a71 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -223,7 +223,7 @@ static inline u16 get_row_index(u16 i)
 
 struct date_time_t {
u16  year;
-   u16  Month;
+   u16  month;
u16  Day;
u16  Hour;
u16  Minute;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index c2b97a059f52..dfc7b545f67a 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -59,7 +59,7 @@ static void exfat_write_super(struct super_block *sb);
 /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
-   ts->tv_sec = mktime64(tp->year + 1980, tp->Month + 1, tp->Day,
+   ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->Day,
  tp->Hour, tp->Minute, tp->Second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
@@ -79,7 +79,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Minute  = 0;
tp->Hour= 0;
tp->Day = 1;
-   tp->Month   = 1;
+   tp->month   = 1;
tp->year= 0;
return;
}
@@ -90,7 +90,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Minute  = 59;
tp->Hour= 23;
tp->Day = 31;
-   tp->Month   = 12;
+   tp->month   = 12;
tp->year= 127;
return;
}
@@ -100,7 +100,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, 
struct date_time_t *tp)
tp->Minute  = tm.tm_min;
tp->Hour= tm.tm_hour;
tp->Day = tm.tm_mday;
-   tp->Month   = tm.tm_mon + 1;
+   tp->month   = tm.tm_mon + 1;
tp->year= tm.tm_year + 1900 - 1980;
 }
 
@@ -1506,7 +1506,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
 
exfat_get_entry_time(ep, , TM_CREATE);
info->CreateTimestamp.year = tm.year;
-   info->CreateTimestamp.Month = tm.mon;
+   info->CreateTimestamp.month = tm.mon;
info->CreateTimestamp.Day = tm.day;
info->CreateTimestamp.Hour = tm.hour;
info->CreateTimestamp.Minute = tm.min;
@@ -1515,7 +1515,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
 
exfat_get_entry_time(ep, , TM_MODIFY);
info->ModifyTimestamp.year = tm.year;
-   info->ModifyTimestamp.Month = tm.mon;
+   info->ModifyTimestamp.month = tm.mon;
info->ModifyTimestamp.Day = tm.day;
info->ModifyTimestamp.Hour = tm.hour;
info->ModifyTimestamp.Minute = tm.min;
@@ -1609,7 +1609,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.min  = info->CreateTimestamp.Minute;
tm.hour = info->CreateTimestamp.Hour;
tm.day  = info->CreateTimestamp.Day;
-   tm.mon  = info->CreateTimestamp.Month;
+   tm.mon  = info->CreateTimestamp.month;
tm.year = info->CreateTimestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
 
@@ -1617,7 +1617,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.min  = info->ModifyTimestamp.Minute;
tm.hour = info->ModifyTimestamp.Hour;
tm.day  = info->ModifyTimestamp.Day;
-   tm.mon  = info->ModifyTimestamp.Month;
+   tm.mon  = info->ModifyTimestamp.month;
tm.year = info->ModifyTimestamp.year;
exfat_set_entry_time(ep, , TM_MODIFY);
 
@@ -1923,7 +1923,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
 
exfat_get_entry_time(ep, , TM_CREATE);
dir_entry->CreateTimestamp.year = tm.year;
-   dir_entry->CreateTimestamp.Month = tm.mon;
+   dir_entry->CreateTimestamp.month = tm.mon;
dir_entry->CreateTimestamp.Day = tm.day;
dir_entry->CreateTimestamp.Hour = tm.hour;
dir_entry->CreateTimestamp.Minute = tm.min;
@@ -1932,7 +1932,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
 
exfat_get_entry_time(ep, , TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
-   

[PATCH 3/3] staging: wilc1000: refactor p2p action frames handling API's

2020-02-10 Thread Ajay.Kathat
From: Ajay Singh 

Refactor handling of P2P specific action frames. Make use of 'struct' to
handle the P2P frames instead of manipulating using 'buf' pointer.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/cfg80211.c | 298 
 1 file changed, 127 insertions(+), 171 deletions(-)

diff --git a/drivers/staging/wilc1000/cfg80211.c 
b/drivers/staging/wilc1000/cfg80211.c
index 7afbc475b3ea..1430b95a06de 100644
--- a/drivers/staging/wilc1000/cfg80211.c
+++ b/drivers/staging/wilc1000/cfg80211.c
@@ -6,29 +6,17 @@
 
 #include "cfg80211.h"
 
-#define FRAME_TYPE_ID  0
-#define ACTION_CAT_ID  24
-#define ACTION_SUBTYPE_ID  25
-#define P2P_PUB_ACTION_SUBTYPE 30
-
-#define ACTION_FRAME   0xd0
-#define GO_INTENT_ATTR_ID  0x04
-#define CHANLIST_ATTR_ID   0x0b
-#define OPERCHAN_ATTR_ID   0x11
-#define PUB_ACTION_ATTR_ID 0x04
-#define P2PELEM_ATTR_ID0xdd
-
 #define GO_NEG_REQ 0x00
 #define GO_NEG_RSP 0x01
 #define GO_NEG_CONF0x02
 #define P2P_INV_REQ0x03
 #define P2P_INV_RSP0x04
-#define PUBLIC_ACT_VENDORSPEC  0x09
-#define GAS_INITIAL_REQ0x0a
-#define GAS_INITIAL_RSP0x0b
 
 #define WILC_INVALID_CHANNEL   0
 
+/* Operation at 2.4 GHz with channels 1-13 */
+#define WILC_WLAN_OPERATING_CLASS_2_4GHZ   0x51
+
 static const struct ieee80211_txrx_stypes
wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = {
[NL80211_IFTYPE_STATION] = {
@@ -67,7 +55,50 @@ struct wilc_p2p_mgmt_data {
u8 *buff;
 };
 
-static const u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09};
+struct wilc_p2p_pub_act_frame {
+   u8 category;
+   u8 action;
+   u8 oui[3];
+   u8 oui_type;
+   u8 oui_subtype;
+   u8 dialog_token;
+   u8 elem[0];
+} __packed;
+
+struct wilc_vendor_specific_ie {
+   u8 tag_number;
+   u8 tag_len;
+   u8 oui[3];
+   u8 oui_type;
+   u8 attr[0];
+} __packed;
+
+struct wilc_attr_entry {
+   u8  attr_type;
+   __le16 attr_len;
+   u8 val[0];
+} __packed;
+
+struct wilc_attr_oper_ch {
+   u8 attr_type;
+   __le16 attr_len;
+   u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
+   u8 op_class;
+   u8 op_channel;
+} __packed;
+
+struct wilc_attr_ch_list {
+   u8 attr_type;
+   __le16 attr_len;
+   u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
+   u8 elem[0];
+} __packed;
+
+struct wilc_ch_list_elem {
+   u8 op_class;
+   u8 no_of_channels;
+   u8 ch_list[0];
+} __packed;
 
 static void cfg_scan_result(enum scan_event scan_event,
struct wilc_rcvd_net_info *info, void *user_void)
@@ -896,87 +927,51 @@ static int flush_pmksa(struct wiphy *wiphy, struct 
net_device *netdev)
return 0;
 }
 
-static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u8 ch_list_attr_idx,
- u8 op_ch_attr_idx, u8 sta_ch)
-{
-   int i = 0;
-   int j = 0;
-
-   if (ch_list_attr_idx) {
-   u8 limit = ch_list_attr_idx + 3 + buf[ch_list_attr_idx + 1];
-
-   for (i = ch_list_attr_idx + 3; i < limit; i++) {
-   if (buf[i] == 0x51) {
-   for (j = i + 2; j < ((i + 2) + buf[i + 1]); j++)
-   buf[j] = sta_ch;
-   break;
-   }
-   }
-   }
-
-   if (op_ch_attr_idx) {
-   buf[op_ch_attr_idx + 6] = 0x51;
-   buf[op_ch_attr_idx + 7] = sta_ch;
-   }
-}
-
-static void wilc_wfi_cfg_parse_rx_action(u8 *buf, u32 len, u8 sta_ch)
+static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u32 len, u8 sta_ch)
 {
+   struct wilc_attr_entry *e;
+   struct wilc_attr_ch_list *ch_list;
+   struct wilc_attr_oper_ch *op_ch;
u32 index = 0;
-   u8 op_channel_attr_index = 0;
-   u8 channel_list_attr_index = 0;
-
-   while (index < len) {
-   if (buf[index] ==  CHANLIST_ATTR_ID)
-   channel_list_attr_index = index;
-   else if (buf[index] ==  OPERCHAN_ATTR_ID)
-   op_channel_attr_index = index;
-   index += buf[index + 1] + 3;
-   }
-   if (sta_ch != WILC_INVALID_CHANNEL)
-   wilc_wfi_cfg_parse_ch_attr(buf, channel_list_attr_index,
-  op_channel_attr_index, sta_ch);
-}
+   u8 ch_list_idx = 0;
+   u8 op_ch_idx = 0;
 
-static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 len, bool oper_ch,
-u8 iftype, u8 sta_ch)
-{
-   u32 index = 0;
-   u8 op_channel_attr_index = 0;
-   u8 channel_list_attr_index = 0;
+   if (sta_ch == 

[PATCH v2 03/19] staging: exfat: Rename variable 'Day' to 'day'

2020-02-10 Thread Pragat Pandya
Fix checkpatch warning: Avoid CamelCase
Change all occurrences of identifier "Day" to "day"

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h   |  2 +-
 drivers/staging/exfat/exfat_super.c | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index ae7f8e035a71..49e9390b4372 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -224,7 +224,7 @@ static inline u16 get_row_index(u16 i)
 struct date_time_t {
u16  year;
u16  month;
-   u16  Day;
+   u16  day;
u16  Hour;
u16  Minute;
u16  Second;
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index dfc7b545f67a..020529228fdd 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -59,7 +59,7 @@ static void exfat_write_super(struct super_block *sb);
 /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
 static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
 {
-   ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->Day,
+   ts->tv_sec = mktime64(tp->year + 1980, tp->month + 1, tp->day,
  tp->Hour, tp->Minute, tp->Second);
 
ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
@@ -78,7 +78,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Second  = 0;
tp->Minute  = 0;
tp->Hour= 0;
-   tp->Day = 1;
+   tp->day = 1;
tp->month   = 1;
tp->year= 0;
return;
@@ -89,7 +89,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Second  = 59;
tp->Minute  = 59;
tp->Hour= 23;
-   tp->Day = 31;
+   tp->day = 31;
tp->month   = 12;
tp->year= 127;
return;
@@ -99,7 +99,7 @@ static void exfat_time_unix2fat(struct timespec64 *ts, struct 
date_time_t *tp)
tp->Second  = tm.tm_sec;
tp->Minute  = tm.tm_min;
tp->Hour= tm.tm_hour;
-   tp->Day = tm.tm_mday;
+   tp->day = tm.tm_mday;
tp->month   = tm.tm_mon + 1;
tp->year= tm.tm_year + 1900 - 1980;
 }
@@ -1507,7 +1507,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
exfat_get_entry_time(ep, , TM_CREATE);
info->CreateTimestamp.year = tm.year;
info->CreateTimestamp.month = tm.mon;
-   info->CreateTimestamp.Day = tm.day;
+   info->CreateTimestamp.day = tm.day;
info->CreateTimestamp.Hour = tm.hour;
info->CreateTimestamp.Minute = tm.min;
info->CreateTimestamp.Second = tm.sec;
@@ -1516,7 +1516,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
exfat_get_entry_time(ep, , TM_MODIFY);
info->ModifyTimestamp.year = tm.year;
info->ModifyTimestamp.month = tm.mon;
-   info->ModifyTimestamp.Day = tm.day;
+   info->ModifyTimestamp.day = tm.day;
info->ModifyTimestamp.Hour = tm.hour;
info->ModifyTimestamp.Minute = tm.min;
info->ModifyTimestamp.Second = tm.sec;
@@ -1608,7 +1608,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.sec  = info->CreateTimestamp.Second;
tm.min  = info->CreateTimestamp.Minute;
tm.hour = info->CreateTimestamp.Hour;
-   tm.day  = info->CreateTimestamp.Day;
+   tm.day  = info->CreateTimestamp.day;
tm.mon  = info->CreateTimestamp.month;
tm.year = info->CreateTimestamp.year;
exfat_set_entry_time(ep, , TM_CREATE);
@@ -1616,7 +1616,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
tm.sec  = info->ModifyTimestamp.Second;
tm.min  = info->ModifyTimestamp.Minute;
tm.hour = info->ModifyTimestamp.Hour;
-   tm.day  = info->ModifyTimestamp.Day;
+   tm.day  = info->ModifyTimestamp.day;
tm.mon  = info->ModifyTimestamp.month;
tm.year = info->ModifyTimestamp.year;
exfat_set_entry_time(ep, , TM_MODIFY);
@@ -1924,7 +1924,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
exfat_get_entry_time(ep, , TM_CREATE);
dir_entry->CreateTimestamp.year = tm.year;
dir_entry->CreateTimestamp.month = tm.mon;
-   dir_entry->CreateTimestamp.Day = tm.day;
+   dir_entry->CreateTimestamp.day = tm.day;
dir_entry->CreateTimestamp.Hour = tm.hour;
dir_entry->CreateTimestamp.Minute = tm.min;
 

[PATCH v2 00/19] Renaming some identifiers.

2020-02-10 Thread Pragat Pandya
This patchset renames following nineteen variables in exfat.h
Fix checkpatch warning: Avoid CamelCase
 -Year->year
 -Day->day
 -Hour->hour
 -Minute->minute
 -Second->second
 -Millisecond->millisecond
 -FatType->fat_type
 -ClusterSize->cluster_size
 -NumClusters->num_clusters
 -FreeClusters->free_clusters
 -UsedClusters->used_clusters
 -Name->name
 -ShortName->short_name
 -Attr->attr
 -NumSubdirs->num_subdirs
 -CreateTimestamp->create_timestamp
 -ModifyTimestamp->modify_timestamp
 -AccessTimestamp->access_timestamp

v2:
 -Correct misplaced quatation character in subject line(s).
 -Remove unnecessary '_'(underscore) character in renaming of identifier
  MilliSecond.
 -Drop commits renaming unused structure members.


Pragat Pandya (19):
  staging: exfat: Rename variable 'Year' to 'year'
  staging: exfat: Rename variable 'Month' to 'month'
  staging: exfat: Rename variable 'Day' to 'day'
  staging: exfat: Rename variable 'Hour' to 'hour'
  staging: exfat: Rename variable 'Minute' to 'minute'
  staging: exfat: Rename variable 'Second' to 'second'
  staging: exfat: Rename variable 'MilliSecond' to 'millisecond'
  staging: exfat: Rename variable 'FatType' to 'fat_type'
  staging: exfat: Rename variable 'ClusterSize' to 'cluster_size'
  staging: exfat: Rename variable 'NumClusters' to 'num_clusters'
  staging: exfat: Rename variable 'FreeClusters' to 'free_clusters'
  staging: exfat: Rename variable 'UsedClusters' to 'used_clusters'
  staging: exfat: Rename variable 'Name' to 'name'
  staging: exfat: Rename variable 'ShortName' to 'short_name'
  staging: exfat: Rename variable 'Attr' to 'attr'
  staging: exfat: Rename variable 'NumSubdirs' to 'num_subdirs'
  staging: exfat: Rename variable 'CreateTimestamp' to
'create_timestamp'
  staging: exfat: Rename variable 'ModifyTimestamp' to
'modify_timestamp'
  staging: exfat: Rename variable 'AccessTimestamp' to
'access_timestamp'

 drivers/staging/exfat/exfat.h   |  38 ++---
 drivers/staging/exfat/exfat_super.c | 232 ++--
 2 files changed, 135 insertions(+), 135 deletions(-)

-- 
2.17.1

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


Re: [PATCH 4/6] staging: rtl8723bs: Fix potential overuse of kernel memory

2020-02-10 Thread Greg KH
On Mon, Feb 10, 2020 at 12:02:33PM -0600, Larry Finger wrote:
> In routine wpa_supplicant_ioctl(), the user-controlled p->length is
> checked to be at least the size of struct ieee_param size, but the code
> does not detect the case where p->length is greater than the size
> of the struct, thus a malicious user could be wasting kernel memory.
> Fixes commit 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver").
> 
> Reported by: Pietro Oliva 
> Cc: Pietro Oliva 
> Cc: Stable 
> Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver").
> Signed-off-by: Larry Finger 
> -# Please enter the commit message for your changes. Lines starting
> ---

Funny line :)

I'll go edit it...

thanks,

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


[PATCH 1/6] staging: rtl8188eu: Fix potential security hole

2020-02-10 Thread Larry Finger
In routine rtw_hostapd_ioctl(), the user-controlled p->length is assumed
to be at least the size of struct ieee_param size, but this assumption is
never checked. This could result in out-of-bounds read/write on kernel
heap in case a p->length less than the size of struct ieee_param is
specified by the user. If p->length is allowed to be greater than the size
of the struct, then a malicious user could be wasting kernel memory.
Fixes commit a2c60d42d97c ("Add files for new driver - part 16").

Reported by: Pietro Oliva 
Cc: Pietro Oliva 
Cc: Stable 
Fixes: a2c60d42d97c ("Add files for new driver - part 16").
Signed-off-by: Larry Finger 
---
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 9b6ea86d1dcf..7d21f5799640 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2796,7 +2796,7 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
goto out;
}
 
-   if (!p->pointer) {
+   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
ret = -EINVAL;
goto out;
}
-- 
2.25.0

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


[PATCH 3/6] staging: rtl8188eu: Fix potential overuse of kernel memory

2020-02-10 Thread Larry Finger
In routine wpa_supplicant_ioctl(), the user-controlled p->length is
checked to be at least the size of struct ieee_param size, but the code
does not detect the case where p->length is greater than the size
of the struct, thus a malicious user could be wasting kernel memory.
Fixes commit a2c60d42d97c ("Add files for new driver - part 16").

Reported by: Pietro Oliva 
Cc: Pietro Oliva 
Cc: Stable 
Fixes commit a2c60d42d97c ("Add files for new driver - part 16").
Signed-off-by: Larry Finger 
---
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 7d21f5799640..acca3ae8b254 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2009,7 +2009,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
struct ieee_param *param;
uint ret = 0;
 
-   if (p->length < sizeof(struct ieee_param) || !p->pointer) {
+   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
ret = -EINVAL;
goto out;
}
-- 
2.25.0

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


[PATCH 2/6] staging: rtl8723bs: Fix potential security hole

2020-02-10 Thread Larry Finger
In routine rtw_hostapd_ioctl(), the user-controlled p->length is assumed
to be at least the size of struct ieee_param size, but this assumption is
never checked. This could result in out-of-bounds read/write on kernel
heap in case a p->length less than the size of struct ieee_param is
specified by the user. If p->length is allowed to be greater than the size
of the struct, then a malicious user could be wasting kernel memory.
Fixes commit 554c0a3abf216 ("0taging: Add rtl8723bs sdio wifi driver").

Reported by: Pietro Oliva 
Cc: Pietro Oliva 
Cc: Stable 
Fixes 554c0a3abf216 ("0taging: Add rtl8723bs sdio wifi driver").
Signed-off-by: Larry Finger 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index db6528a01229..3128766dd50e 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -4207,7 +4207,7 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
 
 
/* if (p->length < sizeof(struct ieee_param) || !p->pointer) { */
-   if (!p->pointer) {
+   if (!p->pointer || p->length != sizeof(*param)) {
ret = -EINVAL;
goto out;
}
-- 
2.25.0

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


[PATCH 5/6] staging: rtl8188eu: Remove some unneeded goto statements

2020-02-10 Thread Larry Finger
In routines rtw_hostapd_ioctl() and wpa_supplicant_ioctl(), several
error conditions involve setting a variable indicating the error,
followed by a goto. The code following the target of that goto merely
returns the value. It is simpler, therefore to return the error value
immediately, and eliminate the got  target.

Signed-off-by: Larry Finger 
Cc: Pietro Oliva 
---
 .../staging/rtl8188eu/os_dep/ioctl_linux.c| 40 ++-
 1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index acca3ae8b254..ba53959e1303 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2009,21 +2009,16 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
struct ieee_param *param;
uint ret = 0;
 
-   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (!p->pointer || p->length != sizeof(struct ieee_param))
+   return -EINVAL;
 
param = (struct ieee_param *)rtw_malloc(p->length);
-   if (!param) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!param)
+   return -ENOMEM;
 
if (copy_from_user(param, p->pointer, p->length)) {
kfree(param);
-   ret = -EFAULT;
-   goto out;
+   return -EFAULT;
}
 
switch (param->cmd) {
@@ -2054,9 +2049,6 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
ret = -EFAULT;
 
kfree(param);
-
-out:
-
return ret;
 }
 
@@ -2791,26 +2783,19 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
* so, we just check hw_init_completed
*/
 
-   if (!padapter->hw_init_completed) {
-   ret = -EPERM;
-   goto out;
-   }
+   if (!padapter->hw_init_completed)
+   return -EPERM;
 
-   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (!p->pointer || p->length != sizeof(struct ieee_param))
+   return -EINVAL;
 
param = (struct ieee_param *)rtw_malloc(p->length);
-   if (!param) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!param)
+   return -ENOMEM;
 
if (copy_from_user(param, p->pointer, p->length)) {
kfree(param);
-   ret = -EFAULT;
-   goto out;
+   return -EFAULT;
}
 
switch (param->cmd) {
@@ -2865,7 +2850,6 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
if (ret == 0 && copy_to_user(p->pointer, param, p->length))
ret = -EFAULT;
kfree(param);
-out:
return ret;
 }
 #endif
-- 
2.25.0

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


[PATCH 4/6] staging: rtl8723bs: Fix potential overuse of kernel memory

2020-02-10 Thread Larry Finger
In routine wpa_supplicant_ioctl(), the user-controlled p->length is
checked to be at least the size of struct ieee_param size, but the code
does not detect the case where p->length is greater than the size
of the struct, thus a malicious user could be wasting kernel memory.
Fixes commit 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver").

Reported by: Pietro Oliva 
Cc: Pietro Oliva 
Cc: Stable 
Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver").
Signed-off-by: Larry Finger 
-# Please enter the commit message for your changes. Lines starting
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3128766dd50e..2ac0d84f090e 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -3373,7 +3373,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
 
/* down(>wx_sem); */
 
-   if (p->length < sizeof(struct ieee_param) || !p->pointer) {
+   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
ret = -EINVAL;
goto out;
}
-- 
2.25.0

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


[PATCH 6/6] staging: rtl8723bs: Remove unneeded goto statements

2020-02-10 Thread Larry Finger
In routines rtw_hostapd_ioctl() and wpa_supplicant_ioctl(), several
error conditions involve setting a variable indicating the error,
followed by a goto. The code following the target of that goto merely
returns the value. It is simpler, therefore to return the error value
immediately, and eliminate the got  target.

Signed-off-by: Larry Finger 
Cc: Pietro Oliva 
---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c| 47 +--
 1 file changed, 12 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 2ac0d84f090e..9b9038e7deb1 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -3373,21 +3373,16 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
 
/* down(>wx_sem); */
 
-   if (!p->pointer || p->length != sizeof(struct ieee_param)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (!p->pointer || p->length != sizeof(struct ieee_param))
+   return -EINVAL;
 
param = rtw_malloc(p->length);
-   if (param == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (param == NULL)
+   return -ENOMEM;
 
if (copy_from_user(param, p->pointer, p->length)) {
kfree(param);
-   ret = -EFAULT;
-   goto out;
+   return -EFAULT;
}
 
switch (param->cmd) {
@@ -3421,12 +3416,8 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
 
kfree(param);
 
-out:
-
/* up(>wx_sem); */
-
return ret;
-
 }
 
 static int rtw_set_encryption(struct net_device *dev, struct ieee_param 
*param, u32 param_len)
@@ -4200,28 +4191,19 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
* so, we just check hw_init_completed
*/
 
-   if (!padapter->hw_init_completed) {
-   ret = -EPERM;
-   goto out;
-   }
-
+   if (!padapter->hw_init_completed)
+   return -EPERM;
 
-   /* if (p->length < sizeof(struct ieee_param) || !p->pointer) { */
-   if (!p->pointer || p->length != sizeof(*param)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (!p->pointer || p->length != sizeof(*param))
+   return -EINVAL;
 
param = rtw_malloc(p->length);
-   if (param == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (param == NULL)
+   return -ENOMEM;
 
if (copy_from_user(param, p->pointer, p->length)) {
kfree(param);
-   ret = -EFAULT;
-   goto out;
+   return -EFAULT;
}
 
/* DBG_871X("%s, cmd =%d\n", __func__, param->cmd); */
@@ -4321,13 +4303,8 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
if (ret == 0 && copy_to_user(p->pointer, param, p->length))
ret = -EFAULT;
 
-
kfree(param);
-
-out:
-
return ret;
-
 }
 
 static int rtw_wx_set_priv(struct net_device *dev,
-- 
2.25.0

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


[PATCH 0/6] staging: rtl8188eu and rtl8723bs - some fixes and cleanups

2020-02-10 Thread Larry Finger
It was recently reported that staging drivers rtl8188eu and rtl8723bs
contained a security flaw because a parameter had not been checked.
The following patches fix that flaw and cleans up the routines.

Signed-off-by: Larry Finger 


Larry Finger (6):
  staging: rtl8188eu: Fix potential security hole
  staging: rtl8723bs: Fix potential security hole
  staging: rtl8188eu: Fix potential overuse of kernel memory
  staging: rtl8723bs: Fix potential overuse of kernel memory
  staging: rtl8188eu: Remove some unneeded goto statements
  staging: rtl8723bs: Remove unneeded goto statements

 .../staging/rtl8188eu/os_dep/ioctl_linux.c| 40 +---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c| 47 +--
 2 files changed, 24 insertions(+), 63 deletions(-)

-- 
2.25.0

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


[PATCH] staging: exfat: Replace printk with pr_info

2020-02-10 Thread JieunKim
pr_info is preferred to use than printk.
pr_info calls printk with KERN_INFO macros by itself.

Signed-off-by: JieunKim 
---
 drivers/staging/exfat/exfat_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index b81d2a87b82e..3806036c0ef6 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -364,7 +364,7 @@ static int ffsMountVol(struct super_block *sb)
exfat_bdev_open(sb);
 
if (p_bd->sector_size < sb->s_blocksize) {
-   printk(KERN_INFO "EXFAT: mount failed - sector size %d less 
than blocksize %ld\n",
+   pr_info("EXFAT: mount failed - sector size %d less than 
blocksize %ld\n",
   p_bd->sector_size,  sb->s_blocksize);
ret = -EINVAL;
goto out;
-- 
2.17.1

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