Re: [PATCH] staging: greybus: bootrom: fix uninitialized variables

2020-01-27 Thread Dan Carpenter
On Sat, Jan 25, 2020 at 02:14:03PM +0530, Saurav Girepunje wrote:
> fix uninitialized variables issue found using static code analysis tool
> 
> (error) Uninitialized variable: offset
> (error) Uninitialized variable: size
> 

These are false positives as Johan said.  Don't change the code just to
make the static analysis tool happy, fix the tools instead.

Also the patch doesn't apply.  Read the first paragraph of
Documentation/process/email-clients.rst and figure out why it's not
working.

regards,
dan carpenter

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


Re: [RESEND PATCH] staging: exfat: Fix alignment warnings

2020-01-27 Thread Dan Carpenter
It looks like you sent this on Jan 11 and it was applied already.  Why
are you resending?

regards,
dan carpenter

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


Re: [PATCH] staging: comedi: drivers: fix condition with no effect

2020-01-27 Thread Dan Carpenter
On Sat, Jan 25, 2020 at 06:45:35PM +0530, Saurav Girepunje wrote:
> fix warning reorted by coccicheck
> WARNING: possible condition with no effect (if == else)
> 
> Signed-off-by: Saurav Girepunje 
> ---
>  drivers/staging/comedi/drivers/das1800.c | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/das1800.c 
> b/drivers/staging/comedi/drivers/das1800.c
> index f16aa7e9..7ab72e8 100644
> --- a/drivers/staging/comedi/drivers/das1800.c
> +++ b/drivers/staging/comedi/drivers/das1800.c
> @@ -1299,12 +1299,6 @@ static int das1800_attach(struct comedi_device *dev,
>   outb(DAC(i), dev->iobase + DAS1800_SELECT);
>   outw(0, dev->iobase + DAS1800_DAC);
>   }
> - } else if (board->id == DAS1800_ID_AO) {
> - /*
> -  * 'ao' boards have waveform analog outputs that are not
> -  * currently supported.
> -  */
> - s->type = COMEDI_SUBD_UNUSED;
>   } else {
>   s->type = COMEDI_SUBD_UNUSED;

This is for documentation.  Just leave it as-is.

regards,
dan carpenter

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


Re: [PATCH] staging: rtl8723bs: core: fix condition with no effect

2020-01-27 Thread Dan Carpenter
On Sat, Jan 25, 2020 at 07:04:38PM +0530, Saurav Girepunje wrote:
> fix warning reorted by coccicheck
> WARNING: possible condition with no effect (if == else)
> 
> Signed-off-by: Saurav Girepunje 

This one looks good.

The difference between this one and the last one, is that this stuff
looks like documentation but it's just a lot of garbage dead code so
it's good to delete it.

But unfortunately, these patches don't apply.  Please read
Documentation/process/email-clients.rst

regards,
dan carpenter

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


Re: [PATCH] staging: bcm2835-audio: fix warning of no space is necessary

2020-01-27 Thread Dan Carpenter
On Sun, Jan 26, 2020 at 07:37:58PM +0200, Valery Ivanov wrote:
> This patch fixes "No space is necessary after a cast".
> Issue found by checkpatch.pl
> 
> Signed-off-by: Valery Ivanov 
> ---
>  drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c 
> b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> index 33485184a98a..997ce88c67c4 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
> @@ -237,7 +237,7 @@ static void snd_bcm2835_pcm_transfer(struct 
> snd_pcm_substream *substream,
>  {
>   struct snd_pcm_runtime *runtime = substream->runtime;
>   struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
> - void *src = (void *) (substream->runtime->dma_area + rec->sw_data);
> + void *src = (void *)(substream->runtime->dma_area + rec->sw_data);

There is no need for the cast to begin with.

regards,
dan carpenter

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


Re: [PATCH 1/2] staging: wilc1000: return zero on success and non-zero on function failure

2020-01-27 Thread Ajay.Kathat
Hi Dan,

On 27/01/20 1:07 pm, Dan Carpenter wrote:
> 
> Looks good.
> 
> Reviewed-by: Dan Carpenter 
> 
> On Thu, Jan 23, 2020 at 12:50:47PM +, ajay.kat...@microchip.com wrote:
>> @@ -384,19 +378,18 @@ static int wilc_sdio_write_reg(struct wilc *wilc, u32 
>> addr, u32 data)
>>   cmd.address = addr;
>>   cmd.data = data;
>>   ret = wilc_sdio_cmd52(wilc, &cmd);
>> - if (ret) {
>> + if (ret)
>>   dev_err(&func->dev,
>>   "Failed cmd 52, read reg (%08x) ...\n", addr);
>> - goto fail;
>> - }
> 
> Please don't resend, but try to avoid this sort of anti-pattern in the
> future.  You're treating the last failure condition in the function as
> special.  In this case it's particularly difficult to read because we
> are far from the bottom of the function, but even if we were right at
> the bottom, I would try to avoid it.
> 
> I am extreme enough that I would avoid even things like:
> 
> ret = frob();
> if (ret)
> printf("ret failed\n");
> return ret;
> 
> Instead I would write:
> 
> ret = frob();
> if (ret) {
> printf("ret failed\n");
> return ret;
> }
> return 0;
> 
> It's just nice to have the error path at indent level 2 and the
> success path at indent level 1.  And the other thing that I like is the
> BIG BOLD "return 0;" at the end of the function.  Some functions return
> positive numbers on success so if I see "return result;" then I have to
> look back a few lines to see if "result" can be positive.
> 
> The other anti-pattern which people often do is success handling
> (instead of error handling) for the last error condition in a function.
> 
> ret = one();
> if (ret)
> return ret;
> ret = two();
> if (ret)
> return ret;
> ret = three();
> if (!ret)
> ret = four();
> return ret;
> 

Thanks for your useful advice to avoid anti-pattern. I shall keep these
points in mind while working on future patches.

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


[PATCH 02/22] staging: exfat: Rename variable "Month" to "mont"h

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Month" to "month" in exfat.

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 c3c562fba133..95e27aed350d 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 7534b86192aa..293d103a6b54 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)
 
p_fs->fs_func->get_entry_time(ep, &tm, 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)
 
p_fs->fs_func->get_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, TM_MODIFY);
 
@@ -1926,7 +1926,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
 
fs_func->get_entry_time(ep, &tm, 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;
@@ -1935,7 +1935,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
 
fs_func->get_entry_time(ep, &tm, TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
-   dir_e

[PATCH 03/22] staging: exfat: Rename variable "Day" to "day"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Day" to "day" in exfat.

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 95e27aed350d..4211148405c5 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 293d103a6b54..b30f9517cfef 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)
p_fs->fs_func->get_entry_time(ep, &tm, 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)
p_fs->fs_func->get_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, TM_MODIFY);
@@ -1927,7 +1927,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
fs_func->get_entry_time(ep, &tm, 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 = 

[PATCH 04/22] staging: exfat: Rename variable "Hour" to "hour"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Hour" to "hour" in exfat.

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 4211148405c5..03eaf25692aa 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 b30f9517cfef..ae9180be4cc0 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;
@@ -1928,7 +1928,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;
dir_entry->CreateTimestamp.MilliS

[PATCH 08/22] staging: exfat: Rename variable "Offset" to "offset"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Offset" to "offset" in exfat.

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 5c207d715f44..52f314d50b91 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -232,7 +232,7 @@ struct date_time_t {
 };
 
 struct part_info_t {
-   u32  Offset;/* start sector number of the partition */
+   u32  offset;/* start sector number of the partition */
u32  Size;  /* in sectors */
 };
 
-- 
2.17.1

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


[PATCH 07/22] staging: exfat: Rename variable "MilliSecond" to "milli_second"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "MilliSecond" to "milli_second" in exfat.

Signed-off-by: Pragat Pandya 
---
 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 85fbea44219a..5c207d715f44 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  milli_second;
 };
 
 struct part_info_t {
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 0582c49f091d..6cc21d795589 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->milli_second * 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, &tm);
 
if (second < UNIX_SECS_1980) {
-   tp->MilliSecond = 0;
+   tp->milli_second = 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->milli_second = 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->milli_second = 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.milli_second = 0;
 
p_fs->fs_func->get_entry_time(ep, &tm, 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.milli_second = 0;
 
memset((char *)&info->AccessTimestamp, 0, sizeof(struct date_time_t));
 
@@ -1931,7 +1931,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.milli_second = 0;
 
fs_func->get_entry_time(ep, &tm, TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
@@ -1940,7 +1940,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.milli_second = 0;
 
memset((char *)&dir_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 05/22] staging: exfat: Rename variable "Minute" to "minute"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Minute" to "minute" in exfat.

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 03eaf25692aa..755e2fd6e3fd 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 ae9180be4cc0..70fa5f118a38 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)
p_fs->fs_func->set_entry_time(ep, &tm, 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;
@@ -1929,7 +1929,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;
 
@@ -1938,7 +1938,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->ModifyTimestamp.month = tm.mon;
dir_entry->ModifyTimestamp.day = tm.day

[PATCH 09/22] staging: exfat: Rename variable "Size" to "size"

2020-01-27 Thread Pragat Pandya
Change all the occurences of "Size" to "size" in exfat.

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 52f314d50b91..a228350acdb4 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -233,7 +233,7 @@ struct date_time_t {
 
 struct part_info_t {
u32  offset;/* start sector number of the partition */
-   u32  Size;  /* in sectors */
+   u32  size;  /* in sectors */
 };
 
 struct dev_info_t {
-- 
2.17.1

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


[PATCH 00/22] staging: exfat: Fix checkpatch warning: Avoid

2020-01-27 Thread Pragat Pandya


This patchset renames following twenty-two variables declared in exfat.h
Fix checkpatch warning: Avoid CamelCase.
 -Year->year
 -Month->month
 -Day->day
 -Hour->hour
 -Minute->minute
 -Second->second
 -MilliSecond->milli_secnod
 -Offset->offset
 -Size->size
 -SecSize->sec_size
 -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


Pragat Pandya (22):
  staging: exfat: Rename variable "Year" to "year"
  staging: exfat: Rename variable "Month" to "mont"h
  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 "milli_second"
  staging: exfat: Rename variable "Offset" to "offset"
  staging: exfat: Rename variable "Size" to "size"
  staging: exfat: Rename variable "SecSize" to "sec_size"
  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 variabel "NumSubdirs" to "num_subdirs"
  staging: exfat: Rename variabel "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   |  44 +++---
 drivers/staging/exfat/exfat_super.c | 232 ++--
 2 files changed, 138 insertions(+), 138 deletions(-)

-- 
2.17.1

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


[PATCH 01/22] staging: exfat: Rename variable "Year" to "year"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Year" to "year" in exfat.

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 51c665a924b7..c3c562fba133 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 9f91853b189b..7534b86192aa 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 = p_fs->fs_func->get_entry_attr(ep);
 
p_fs->fs_func->get_entry_time(ep, &tm, 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;
 
p_fs->fs_func->get_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, TM_MODIFY);
 
p_fs->fs_func->set_entry_size(ep2, info->Size);
@@ -1925,7 +1925,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->Attr = fs_func->get_entry_attr(ep);
 
fs_func->get_entry_time(ep, &tm, 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;
@@ -1934,7 +1934,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->CreateTimestamp.MilliSecond = 0;
 
fs_func->get_entry_time(ep, &tm, TM_MODIFY);
-   dir_entry->ModifyTimestamp.Year = tm.year;
+  

[PATCH 11/22] staging: exfat: Rename variable "FatType" to "fat_type"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "FatType" to "fat_type" in exfat.

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 58292495bb57..8a4668d301fc 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 6cc21d795589..695c8793fe5f 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 = p_fs->fs_func->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;
@@ -3348,7 +3348,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 10/22] staging: exfat: Rename variable "SecSize" to "sec_size"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "SecSize" to "sec_size" in exfat.

Signed-off-by: Pragat Pandya 
---
 drivers/staging/exfat/exfat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index a228350acdb4..58292495bb57 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -237,7 +237,7 @@ struct part_info_t {
 };
 
 struct dev_info_t {
-   u32  SecSize;/* sector size in bytes */
+   u32  sec_size;/* sector size in bytes */
u32  DevSize;/* block device size in sectors */
 };
 
-- 
2.17.1

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


[PATCH 06/22] staging: exfat: Rename variable "Second" to "second"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Second" to "second" in exfat.

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 755e2fd6e3fd..85fbea44219a 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 70fa5f118a38..0582c49f091d 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;
 
p_fs->fs_func->get_entry_time(ep, &tm, 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 *)&info->AccessTimestamp, 0, sizeof(struct date_time_t));
@@ -1605,7 +1605,7 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
p_fs->fs_func->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;
p_fs->fs_func->set_entry_time(ep, &tm, 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;
@@ -1930,7 +1930,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;
 
fs_func->get_entry_time(ep, &tm, TM_MODIFY);
@@ -1939,7 +1939,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 16/22] staging: exfat: Rename variable "Name" to "name"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Name" to "name" in exfat.

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 abed7fed3823..bc917b241bab 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 223699a21079..8a4915aa3849 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 *)&info->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)
 */
p_fs->fs_func->get_uni_name_from_ext_entry(sb, &fid->dir, fid->entry,
   uni_name.name);
-   nls_uniname_to_cstring(sb, info->Name, &uni_name);
+   nls_uniname_to_cstring(sb, info->name, &uni_name);
 
info->NumSubdirs = 2;
 
@@ -1948,7 +1948,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
*uni_name.name = 0x0;
fs_func->get_uni_name_from_ext_entry(sb, &dir, dentry,
 uni_name.name);
-   nls_uniname_to_cstring(sb, dir_entry->Name, &uni_name);
+   nls_uniname_to_cstring(sb, dir_entry->name, &uni_name);
exfat_buf_unlock(sb, sector);
 
ep = get_entry_in_dir(sb, &clu, i + 1, NULL);
@@ -1991,7 +1991,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);
 
@@ -2129,7 +2129,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)) {
@@ -2149,7 +2149,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 17/22] staging: exfat: Rename variable "ShortName" to "short_name"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "ShortName" to "short_name" in exfat.

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 bc917b241bab..c334467d6c94 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 8a4915aa3849..73ebe5a5dde9 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 *)&info->AccessTimestamp, 0,
   sizeof(struct date_time_t));
-   strcpy(info->ShortName, ".");
+   strcpy(info->short_name, ".");
strcpy(info->name, ".");
 
dir.dir = p_fs->root_dir;
@@ -2132,9 +2132,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 21/22] staging: exfat: Rename variable "ModifyTimestamp" to "modify_timestamp"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "ModifyTimestamp" to "modify_timestamp" in
exfat.

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 9b3b4a6f586b..92f36fcc4591 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 4279fb309f9e..3fb7977ef27f 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 *)&info->create_timestamp, 0,
   sizeof(struct date_time_t));
-   memset((char *)&info->ModifyTimestamp, 0,
+   memset((char *)&info->modify_timestamp, 0,
   sizeof(struct date_time_t));
memset((char *)&info->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.milli_second = 0;
 
p_fs->fs_func->get_entry_time(ep, &tm, 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.milli_second = 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.milli_second = 0;
 
memset((char *)&info->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;
p_fs->fs_func->set_entry_time(ep, &tm, 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;
p_fs->fs_func->set_entry_time(ep, &tm, TM_MODIFY);
 
p_fs->fs_func->set_entry_size(ep2, info->Size);
@@ -1934,13 +1934,13 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->create_timestamp.milli_second = 0;
 
fs_func->get_entry_time(ep, &tm, 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.milli_second = 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.milli_second = 0;
 
memset((char *)&dir_entry->AccessTimestamp, 0,
   sizeof(struct date_time_t));
@@ -3191,7 +3191,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(&inode->i_mtime, &info.ModifyTi

[PATCH 13/22] staging: exfat: Rename variable "NumClusters" to "num_clusters"

2020-01-27 Thread Pragat Pandya
Change all the occurreces of "NumClusters" to "num_clusters" in exfat.

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 8787cb3203ba..36baa4c9a98a 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 b9445bef0e6d..c5edf09f1123 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;
@@ -3350,9 +3350,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");
@@ -3360,7 +3360,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 14/22] staging: exfat: Rename variable "FreeClusters" to "free_clusters"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "FreeClusters" to "free_clusters" in
exfat.

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 36baa4c9a98a..4cc5c1914864 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 c5edf09f1123..7a8b876414bd 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;
@@ -3352,7 +3352,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");
@@ -3361,8 +3361,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 19/22] staging: exfat: Rename variabel "NumSubdirs" to "num_subdirs"

2020-01-27 Thread Pragat Pandya
Change all the occurreces of "NumSubdirs" to "num_subdirs" in exfat.

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 ab48bbd083e5..2e07cb6b694a 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 27d6362f2102..2fe59bdabb56 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; /* propogate 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, &uni_name);
 
-   info->NumSubdirs = 2;
+   info->num_subdirs = 2;
 
info->Size = p_fs->fs_func->get_entry_size(ep2);
 
@@ -1551,7 +1551,7 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
ret = count; /* propogate error upward */
goto out;
}
-   info->NumSubdirs += count;
+   info->num_subdirs += count;
}
 
if (p_fs->dev_ejected)
@@ -3167,7 +3167,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);
@@ -3667,7 +3667,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 20/22] staging: exfat: Rename variabel "CreateTimestamp" to "create_timestamp"

2020-01-27 Thread Pragat Pandya
Change all the occurreces of "CreateTimestamp" to "create_timestamp" in
exfat.

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 2e07cb6b694a..9b3b4a6f586b 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 2fe59bdabb56..4279fb309f9e 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 *)&info->CreateTimestamp, 0,
+   memset((char *)&info->create_timestamp, 0,
   sizeof(struct date_time_t));
memset((char *)&info->ModifyTimestamp, 0,
   sizeof(struct date_time_t));
@@ -1505,13 +1505,13 @@ static int ffsReadStat(struct inode *inode, struct 
dir_entry_t *info)
info->attr = p_fs->fs_func->get_entry_attr(ep);
 
p_fs->fs_func->get_entry_time(ep, &tm, 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.milli_second = 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.milli_second = 0;
 
p_fs->fs_func->get_entry_time(ep, &tm, TM_MODIFY);
info->ModifyTimestamp.year = tm.year;
@@ -1605,12 +1605,12 @@ static int ffsWriteStat(struct inode *inode, struct 
dir_entry_t *info)
p_fs->fs_func->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;
p_fs->fs_func->set_entry_time(ep, &tm, TM_CREATE);
 
tm.sec  = info->ModifyTimestamp.second;
@@ -1925,13 +1925,13 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->attr = fs_func->get_entry_attr(ep);
 
fs_func->get_entry_time(ep, &tm, 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.milli_second = 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.milli_second = 0;
 
fs_func->get_entry_time(ep, &tm, TM_MODIFY);
dir_entry->ModifyTimestamp.year = tm.year;
@@ -3192,7 +3192,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(&inode->i_mtime, &info.ModifyTimestamp);
-   exfat_time_fat2unix(&

[PATCH 12/22] staging: exfat: Rename variable "ClusterSize" to "cluster_size"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "ClusterSize" to "cluster_size" in exfat.

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 8a4668d301fc..8787cb3203ba 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 695c8793fe5f..b9445bef0e6d 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 = p_fs->fs_func->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;
@@ -3349,7 +3349,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;
@@ -3359,7 +3359,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 18/22] staging: exfat: Rename variable "Attr" to "attr"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "Attr" to "attr" in exfat.

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 c334467d6c94..ab48bbd083e5 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 73ebe5a5dde9..27d6362f2102 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 *)&info->CreateTimestamp, 0,
   sizeof(struct date_time_t));
memset((char *)&info->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 = p_fs->fs_func->get_entry_attr(ep);
+   info->attr = p_fs->fs_func->get_entry_attr(ep);
 
p_fs->fs_func->get_entry_time(ep, &tm, 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;
 
-   p_fs->fs_func->set_entry_attr(ep, info->Attr);
+   p_fs->fs_func->set_entry_attr(ep, info->attr);
 
/* set FILE_INFO structure using the acquired struct dentry_t */
tm.sec  = info->CreateTimestamp.second;
@@ -1922,7 +1922,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
continue;
 
exfat_buf_lock(sb, sector);
-   dir_entry->Attr = fs_func->get_entry_attr(ep);
+   dir_entry->attr = fs_func->get_entry_attr(ep);
 
fs_func->get_entry_time(ep, &tm, TM_CREATE);
dir_entry->CreateTimestamp.year = tm.year;
@@ -2150,7 +2150,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;
@@ -3159,25 +3159,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 = &exfat_dir_inode_operations;
inode->i_fop = &exfat_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 = &exfat_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 = &exfat_file_inode_operations;
inode->i_fop = &exfat_file_operations;
inode->i_mapping->a_ops = &exfat_aops;
@@ -3186,7 +3186,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

[PATCH 15/22] staging: exfat: Rename variable "UsedClusters" to "used_clusters"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "UsedClusters" to "used_clusters" in
exfat.

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 4cc5c1914864..abed7fed3823 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 7a8b876414bd..223699a21079 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;
@@ -3351,8 +3351,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 22/22] staging: exfat: Rename variable "AccessTimestamp" to "access_timestamp"

2020-01-27 Thread Pragat Pandya
Change all the occurrences of "AccessTimestamp" to "access_timestamp" in
exfat.

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 92f36fcc4591..7424a27ca23f 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 3fb7977ef27f..3364bc2140f5 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 *)&info->modify_timestamp, 0,
   sizeof(struct date_time_t));
-   memset((char *)&info->AccessTimestamp, 0,
+   memset((char *)&info->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.milli_second = 0;
 
-   memset((char *)&info->AccessTimestamp, 0, sizeof(struct date_time_t));
+   memset((char *)&info->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.
@@ -1942,7 +1942,7 @@ static int ffsReadDir(struct inode *inode, struct 
dir_entry_t *dir_entry)
dir_entry->modify_timestamp.second = tm.sec;
dir_entry->modify_timestamp.milli_second = 0;
 
-   memset((char *)&dir_entry->AccessTimestamp, 0,
+   memset((char *)&dir_entry->access_timestamp, 0,
   sizeof(struct date_time_t));
 
*uni_name.name = 0x0;
@@ -3193,7 +3193,7 @@ static int exfat_fill_inode(struct inode *inode, struct 
file_id_t *fid)
 
exfat_time_fat2unix(&inode->i_mtime, &info.modify_timestamp);
exfat_time_fat2unix(&inode->i_ctime, &info.create_timestamp);
-   exfat_time_fat2unix(&inode->i_atime, &info.AccessTimestamp);
+   exfat_time_fat2unix(&inode->i_atime, &info.access_timestamp);
 
return 0;
 }
@@ -3264,7 +3264,7 @@ static int exfat_write_inode(struct inode *inode, struct 
writeback_control *wbc)
 
exfat_time_unix2fat(&inode->i_mtime, &info.modify_timestamp);
exfat_time_unix2fat(&inode->i_ctime, &info.create_timestamp);
-   exfat_time_unix2fat(&inode->i_atime, &info.AccessTimestamp);
+   exfat_time_unix2fat(&inode->i_atime, &info.access_timestamp);
 
ffsWriteStat(inode, &info);
 
-- 
2.17.1

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


Re: [PATCH 02/22] staging: exfat: Rename variable "Month" to "month"

2020-01-27 Thread Markus Elfring
> Change all the occurrences of "Month" to "month" in exfat.

I hope that the final commit will not contain a misplaced quotation character
in the subject.

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


Re: [PATCH 02/22] staging: exfat: Rename variable "Month" to "month"

2020-01-27 Thread Markus Elfring
> Change all the occurrences of "Month" to "month" in exfat.

I hope that the final commit will not contain a misplaced quotation character
in the subject.

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


Re: [PATCH 06/22] staging: vc04_services: get rid of vchiq_platform_use_suspend_timer()

2020-01-27 Thread Nicolas Saenz Julienne
On Fri, 2020-01-24 at 15:46 +0100, Nicolas Saenz Julienne wrote:
> @@ -3059,7 +2986,6 @@ vchiq_check_service(struct vchiq_service *service)
>   arm_state->videocore_use_count,
>   suspend_state_names[arm_state->vc_suspend_state +
>   VC_SUSPEND_NUM_OFFSET]);
> - vchiq_dump_service_use_state(service->state);
>   }
>  out:
>   return ret;

As highlighted by the kbuild test robot, this shouldn't be removed. Sorry it
slipped through the cracks. Happened because of it similarities with
vchiq_dump_platform_use_state(), which is being rightfully removed.

I'll give some time for further feedback, and send a v2.

Regards,
Nicolas



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


Re: [PATCH 00/22] staging: exfat: Fix checkpatch warning: …

2020-01-27 Thread Markus Elfring
> This patchset renames following twenty-two variables declared in exfat.h

Would a subject like “staging: exfat: Renaming of some identifiers”
be more appropriate (than an incomplete one) for this cover letter?

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


Re: [PATCH 07/22] staging: exfat: Rename variable "MilliSecond" to "milli_second"

2020-01-27 Thread Dan Carpenter
On Mon, Jan 27, 2020 at 03:43:28PM +0530, Pragat Pandya wrote:
> Change all the occurrences of "MilliSecond" to "milli_second" in exfat.
> 
> Signed-off-by: Pragat Pandya 
> ---
>  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 85fbea44219a..5c207d715f44 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  milli_second;

Normally we would just call it "ms".

regards,
dan carpenter

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


Re: [PATCH 09/22] staging: exfat: Rename variable "Size" to "size"

2020-01-27 Thread Dan Carpenter
On Mon, Jan 27, 2020 at 03:43:30PM +0530, Pragat Pandya wrote:
> Change all the occurences of "Size" to "size" in exfat.
> 
> Signed-off-by: Pragat Pandya 
> ---
>  drivers/staging/exfat/exfat.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
> index 52f314d50b91..a228350acdb4 100644
> --- a/drivers/staging/exfat/exfat.h
> +++ b/drivers/staging/exfat/exfat.h
> @@ -233,7 +233,7 @@ struct date_time_t {
>  
>  struct part_info_t {
>   u32  offset;/* start sector number of the partition */
> - u32  Size;  /* in sectors */
> + u32  size;  /* in sectors */
>  };

We just renamed all the struct members of this without changing any
users.  Which suggests that this is unused and can be deleted.

regards,
dan carpenter

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


Re: [PATCH 10/22] staging: exfat: Rename variable "SecSize" to "sec_size"

2020-01-27 Thread Dan Carpenter
On Mon, Jan 27, 2020 at 03:43:31PM +0530, Pragat Pandya wrote:
> Change all the occurrences of "SecSize" to "sec_size" in exfat.
> 
> Signed-off-by: Pragat Pandya 
> ---
>  drivers/staging/exfat/exfat.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
> index a228350acdb4..58292495bb57 100644
> --- a/drivers/staging/exfat/exfat.h
> +++ b/drivers/staging/exfat/exfat.h
> @@ -237,7 +237,7 @@ struct part_info_t {
>  };
>  
>  struct dev_info_t {
> - u32  SecSize;/* sector size in bytes */
> + u32  sec_size;/* sector size in bytes */
>   u32  DevSize;/* block device size in sectors */
 ^^^
The comments aren't aligned any more.

regards,
dan carpenter

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


Re: [PATCH 07/22] staging: exfat: Rename variable "MilliSecond" to "milli_second"

2020-01-27 Thread Greg KH
On Mon, Jan 27, 2020 at 02:55:31PM +0300, Dan Carpenter wrote:
> On Mon, Jan 27, 2020 at 03:43:28PM +0530, Pragat Pandya wrote:
> > Change all the occurrences of "MilliSecond" to "milli_second" in exfat.
> > 
> > Signed-off-by: Pragat Pandya 
> > ---
> >  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 85fbea44219a..5c207d715f44 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  milli_second;
> 
> Normally we would just call it "ms".

Or millisecond, no "_" needed either way.

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


Re: [PATCH 10/22] staging: exfat: Rename variable "SecSize" to "sec_size"

2020-01-27 Thread Greg KH
On Mon, Jan 27, 2020 at 03:43:31PM +0530, Pragat Pandya wrote:
> Change all the occurrences of "SecSize" to "sec_size" in exfat.
> 
> Signed-off-by: Pragat Pandya 
> ---
>  drivers/staging/exfat/exfat.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
> index a228350acdb4..58292495bb57 100644
> --- a/drivers/staging/exfat/exfat.h
> +++ b/drivers/staging/exfat/exfat.h
> @@ -237,7 +237,7 @@ struct part_info_t {
>  };
>  
>  struct dev_info_t {
> - u32  SecSize;/* sector size in bytes */

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


Re: [PATCH] staging: rtl8723bs: fix copy of overlapping memory

2020-01-27 Thread Hans de Goede

HI,

On 26-01-2020 23:05, Colin King wrote:

From: Colin Ian King 

Currently the rtw_sprintf prints the contents of thread_name
onto thread_name and this can lead to a potential copy of a
string over itself. Avoid this by printing the literal string RTWHALXT
instread of the contents of thread_name.

Addresses-Coverity: ("copy of overlapping memory")
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Colin Ian King 


Patch looks good to me:

Reviewed-by: Hans de Goede 

Regards,

Hans



---
  drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c 
b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index b44e902ed338..890e0ecbeb2e 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -476,14 +476,13 @@ int rtl8723bs_xmit_thread(void *context)
s32 ret;
struct adapter *padapter;
struct xmit_priv *pxmitpriv;
-   u8 thread_name[20] = "RTWHALXT";
-
+   u8 thread_name[20];
  
  	ret = _SUCCESS;

padapter = context;
pxmitpriv = &padapter->xmitpriv;
  
-	rtw_sprintf(thread_name, 20, "%s-"ADPT_FMT, thread_name, ADPT_ARG(padapter));

+   rtw_sprintf(thread_name, 20, "RTWHALXT-" ADPT_FMT, ADPT_ARG(padapter));
thread_enter(thread_name);
  
  	DBG_871X("start "FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));




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


[PATCH 0/4] Hantro VPU JPEG encoder fixes

2020-01-27 Thread Andrzej Pietrasiewicz
This series addresses quality issues in encoded JPEG images.

The first patch actually restores the intention of the original submission
of this driver: due to a typo the helper variables were unused and then
have been removed in some cleanup done by Mauro.

The second patch aligns the driver's luma quantization table with
the one in the ITU-T.81 standard.

The third patch changes the order in which quantization tables are
written to the resulting file and to the hardware. The file expects
a zig-zag order, while the hardware wants some special order, neither
linear nor zig-zag. In other words, hardware-wise it rearranges which
parts of quantization tables go into which 4-byte registers - in a hardware
specific order rather than linear or zig-zag. It also affects rk3288 and
hasn't been tested with it.

The fourth patch then rearranges the sequence of register writes.
The whole luma quantization table must be written first, and then the
chroma quantization is written. In other words, while patch 3/4
changes what goes into which register, this patch changes when each
register is written to. It also affects rk3288 and hasn't been
tested with it.

Andrzej Pietrasiewicz (4):
  media: hantro: Read be32 words starting at every fourth byte
  media: hantro: Use standard luma quantization table
  media: hantro: Write the quantization tables in proper order
  media: hantro: Write quantization table registers in increasing
addresses order

 .../staging/media/hantro/hantro_h1_jpeg_enc.c | 19 -
 drivers/staging/media/hantro/hantro_jpeg.c| 76 ++-
 drivers/staging/media/hantro/hantro_jpeg.h|  2 +-
 .../media/hantro/rk3399_vpu_hw_jpeg_enc.c | 24 --
 4 files changed, 89 insertions(+), 32 deletions(-)

-- 
2.17.1

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


[PATCH 3/4] media: hantro: Write the quantization tables in proper order

2020-01-27 Thread Andrzej Pietrasiewicz
The quantization tables as defined in the file (luma_q_table,
chroma_q_table) are in fact in linear order. The JPEG file header, which is
not generated by the hardware, but must be programatically created with the
CPU, expects the table in zigzag order. On the other hand, the hardware
doesn't expect neither linear, nor zigzag order. Instead it expects the
quantization tables in vertical groups of four quantization parameters,
and the groups are organized in blocks of two vertically adjacent groups.
On top of that the blocks must be provided to the hardware in this order:
leftmost top block, leftmost bottom block, second leftmost top block,
second leftmost bottom block and so on. So, if this is the quantization
table in linear order:

0x10, 0x0b, 0x0a, 0x10, 0x18, 0x28, 0x33, 0x3d,
0x0c, 0x0c, 0x0e, 0x13, 0x1a, 0x3a, 0x3c, 0x37,
0x0e, 0x0d, 0x10, 0x18, 0x28, 0x39, 0x45, 0x38,
0x0e, 0x11, 0x16, 0x1d, 0x33, 0x57, 0x50, 0x3e,
0x12, 0x16, 0x25, 0x38, 0x44, 0x6d, 0x67, 0x4d,
0x18, 0x23, 0x37, 0x40, 0x51, 0x68, 0x71, 0x5c,
0x31, 0x40, 0x4e, 0x57, 0x67, 0x79, 0x78, 0x65,
0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0x63

then the hardware expects this in its consecutive registers:

0x100c0e0e,
0x0b0c0d11,
0x12183148,
0x1623405c,
0x0a0e1016,
0x1013181d,
0x25374e5f,
0x38405762,

and so on.

Consequently, the same area of memory cannot be used both for dumping it
into the JPEG file header and writing its contents to the hardware
registers. Instead, a separate pair of arrays is added for properly
reordered quantization tables, to be read with get_unaligned_be32()
and linearly written to the registers.

The "ctx" parameter is not needed any more for hantro_jpeg_get_qtable().

Signed-off-by: Andrzej Pietrasiewicz 
---
 .../staging/media/hantro/hantro_h1_jpeg_enc.c |  4 +-
 drivers/staging/media/hantro/hantro_jpeg.c| 60 +++
 drivers/staging/media/hantro/hantro_jpeg.h|  2 +-
 .../media/hantro/rk3399_vpu_hw_jpeg_enc.c |  9 ++-
 4 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c 
b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
index be787a045c7e..bd05aea1bd71 100644
--- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
+++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
@@ -108,8 +108,8 @@ void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx)
hantro_h1_set_src_img_ctrl(vpu, ctx);
hantro_h1_jpeg_enc_set_buffers(vpu, ctx, &src_buf->vb2_buf);
hantro_h1_jpeg_enc_set_qtable(vpu,
- hantro_jpeg_get_qtable(&jpeg_ctx, 0),
- hantro_jpeg_get_qtable(&jpeg_ctx, 1));
+ hantro_jpeg_get_qtable(0),
+ hantro_jpeg_get_qtable(1));
 
reg = H1_REG_AXI_CTRL_OUTPUT_SWAP16
| H1_REG_AXI_CTRL_INPUT_SWAP16
diff --git a/drivers/staging/media/hantro/hantro_jpeg.c 
b/drivers/staging/media/hantro/hantro_jpeg.c
index d3b381d00b23..36c140fc6a36 100644
--- a/drivers/staging/media/hantro/hantro_jpeg.c
+++ b/drivers/staging/media/hantro/hantro_jpeg.c
@@ -36,6 +36,8 @@ static const unsigned char luma_q_table[] = {
0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0x63
 };
 
+static unsigned char luma_q_table_reordered[ARRAY_SIZE(luma_q_table)];
+
 static const unsigned char chroma_q_table[] = {
0x11, 0x12, 0x18, 0x2f, 0x63, 0x63, 0x63, 0x63,
0x12, 0x15, 0x1a, 0x42, 0x63, 0x63, 0x63, 0x63,
@@ -47,6 +49,30 @@ static const unsigned char chroma_q_table[] = {
0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63
 };
 
+static unsigned char chroma_q_table_reordered[ARRAY_SIZE(chroma_q_table)];
+
+static const unsigned char zigzag[64] = {
+0,  1,  8, 16,  9,  2,  3, 10,
+   17, 24, 32, 25, 18, 11,  4,  5,
+   12, 19, 26, 33, 40, 48, 41, 34,
+   27, 20, 13,  6,  7, 14, 21, 28,
+   35, 42, 49, 56, 57, 50, 43, 36,
+   29, 22, 15, 23, 30, 37, 44, 51,
+   58, 59, 52, 45, 38, 31, 39, 46,
+   53, 60, 61, 54, 47, 55, 62, 63
+};
+
+static const u32 hw_reorder[64] = {
+0,  8, 16, 24,  1,  9, 17, 25,
+   32, 40, 48, 56, 33, 41, 49, 57,
+2, 10, 18, 26,  3, 11, 19, 27,
+   34, 42, 50, 58, 35, 43, 51, 59,
+4, 12, 20, 28,  5, 13, 21, 29,
+   36, 44, 52, 60, 37, 45, 53, 61,
+6, 14, 22, 30,  7, 15, 23, 31,
+   38, 46, 54, 62, 39, 47, 55, 63
+};
+
 /* Huffman tables are shared with CODA */
 static const unsigned char luma_dc_table[] = {
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
@@ -225,20 +251,29 @@ static const unsigned char 
hantro_jpeg_header[JPEG_HEADER_SIZE] = {
0x11, 0x03, 0x11, 0x00, 0x3f, 0x00,
 };
 
+static unsigned char jpeg_scale_qp(const unsigned char qp, int scale)
+{
+   unsigned int temp;
+
+   temp = DIV_ROUND_CLOSEST((unsigned int)qp * scale, 100);
+   if (temp <= 0)
+   temp = 1;
+   if (temp > 255)
+   temp = 255;
+
+  

[PATCH 1/4] media: hantro: Read be32 words starting at every fourth byte

2020-01-27 Thread Andrzej Pietrasiewicz
Since (luma/chroma)_qtable is an array of unsigned char, indexing it
returns consecutive byte locations, but we are supposed to read the arrays
in four-byte words. Consequently, we should be pointing
get_unaligned_be32() at consecutive word locations instead.

Signed-off-by: Andrzej Pietrasiewicz 
---
 drivers/staging/media/hantro/hantro_h1_jpeg_enc.c | 9 +++--
 drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c | 9 +++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c 
b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
index 938b48d4d3d9..be787a045c7e 100644
--- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
+++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
@@ -67,12 +67,17 @@ hantro_h1_jpeg_enc_set_qtable(struct hantro_dev *vpu,
  unsigned char *chroma_qtable)
 {
u32 reg, i;
+   __be32 *luma_qtable_p;
+   __be32 *chroma_qtable_p;
+
+   luma_qtable_p = (__be32 *)luma_qtable;
+   chroma_qtable_p = (__be32 *)chroma_qtable;
 
for (i = 0; i < H1_JPEG_QUANT_TABLE_COUNT; i++) {
-   reg = get_unaligned_be32(&luma_qtable[i]);
+   reg = get_unaligned_be32(&luma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, H1_REG_JPEG_LUMA_QUAT(i));
 
-   reg = get_unaligned_be32(&chroma_qtable[i]);
+   reg = get_unaligned_be32(&chroma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, H1_REG_JPEG_CHROMA_QUAT(i));
}
 }
diff --git a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c 
b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
index 067892345b5d..bdb95652d6a8 100644
--- a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
+++ b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
@@ -98,12 +98,17 @@ rk3399_vpu_jpeg_enc_set_qtable(struct hantro_dev *vpu,
   unsigned char *chroma_qtable)
 {
u32 reg, i;
+   __be32 *luma_qtable_p;
+   __be32 *chroma_qtable_p;
+
+   luma_qtable_p = (__be32 *)luma_qtable;
+   chroma_qtable_p = (__be32 *)chroma_qtable;
 
for (i = 0; i < VEPU_JPEG_QUANT_TABLE_COUNT; i++) {
-   reg = get_unaligned_be32(&luma_qtable[i]);
+   reg = get_unaligned_be32(&luma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_LUMA_QUAT(i));
 
-   reg = get_unaligned_be32(&chroma_qtable[i]);
+   reg = get_unaligned_be32(&chroma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_CHROMA_QUAT(i));
}
 }
-- 
2.17.1

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


[PATCH 2/4] media: hantro: Use standard luma quantization table

2020-01-27 Thread Andrzej Pietrasiewicz
The table is actually different in the document than in this file, so align
this file with the document.

Signed-off-by: Andrzej Pietrasiewicz 
---
 drivers/staging/media/hantro/hantro_jpeg.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_jpeg.c 
b/drivers/staging/media/hantro/hantro_jpeg.c
index 125eb41f2ede..d3b381d00b23 100644
--- a/drivers/staging/media/hantro/hantro_jpeg.c
+++ b/drivers/staging/media/hantro/hantro_jpeg.c
@@ -23,17 +23,17 @@
 #define HUFF_CHROMA_AC_OFF 409
 
 /* Default tables from JPEG ITU-T.81
- * (ISO/IEC 10918-1) Annex K.3, I
+ * (ISO/IEC 10918-1) Annex K, tables K.1 and K.2
  */
 static const unsigned char luma_q_table[] = {
-   0x10, 0x0b, 0x0a, 0x10, 0x7c, 0x8c, 0x97, 0xa1,
-   0x0c, 0x0c, 0x0e, 0x13, 0x7e, 0x9e, 0xa0, 0x9b,
-   0x0e, 0x0d, 0x10, 0x18, 0x8c, 0x9d, 0xa9, 0x9c,
-   0x0e, 0x11, 0x16, 0x1d, 0x97, 0xbb, 0xb4, 0xa2,
-   0x12, 0x16, 0x25, 0x38, 0xa8, 0x6d, 0x67, 0xb1,
-   0x18, 0x23, 0x37, 0x40, 0xb5, 0x68, 0x71, 0xc0,
+   0x10, 0x0b, 0x0a, 0x10, 0x18, 0x28, 0x33, 0x3d,
+   0x0c, 0x0c, 0x0e, 0x13, 0x1a, 0x3a, 0x3c, 0x37,
+   0x0e, 0x0d, 0x10, 0x18, 0x28, 0x39, 0x45, 0x38,
+   0x0e, 0x11, 0x16, 0x1d, 0x33, 0x57, 0x50, 0x3e,
+   0x12, 0x16, 0x25, 0x38, 0x44, 0x6d, 0x67, 0x4d,
+   0x18, 0x23, 0x37, 0x40, 0x51, 0x68, 0x71, 0x5c,
0x31, 0x40, 0x4e, 0x57, 0x67, 0x79, 0x78, 0x65,
-   0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0xc7,
+   0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0x63
 };
 
 static const unsigned char chroma_q_table[] = {
-- 
2.17.1

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


[PATCH 4/4] media: hantro: Write quantization table registers in increasing addresses order

2020-01-27 Thread Andrzej Pietrasiewicz
Luma and chroma qtables need to be written into two 16-register blocks,
each table consisting of 64 bytes total. The blocks are contiguous and
start at offset 0 for luma and at offset 0x40 for chroma.

The seemingly innocent optimization of writing the two blocks using one
loop causes side effects which result in improper values of quantization
tables being used by the hardware during encoding. Visually this results
in macroblocking artifacts around contrasting edges in encoded images. The
artifacts look like horizontally flipped shadows of the said edges.
Changing the write operations to non-relaxed variant doesn't help.

This patch removes this premature optimization and after this change the
macroblocking artifacts around contrasting edges are gone.

Signed-off-by: Andrzej Pietrasiewicz 
---
 drivers/staging/media/hantro/hantro_h1_jpeg_enc.c | 6 ++
 drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c 
b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
index bd05aea1bd71..fb43ec770e9e 100644
--- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
+++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
@@ -73,10 +73,16 @@ hantro_h1_jpeg_enc_set_qtable(struct hantro_dev *vpu,
luma_qtable_p = (__be32 *)luma_qtable;
chroma_qtable_p = (__be32 *)chroma_qtable;
 
+   /*
+* Quantization table registers must be written in contiguous blocks.
+* DO NOT collapse the below two "for" loops into one.
+*/
for (i = 0; i < H1_JPEG_QUANT_TABLE_COUNT; i++) {
reg = get_unaligned_be32(&luma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, H1_REG_JPEG_LUMA_QUAT(i));
+   }
 
+   for (i = 0; i < H1_JPEG_QUANT_TABLE_COUNT; i++) {
reg = get_unaligned_be32(&chroma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, H1_REG_JPEG_CHROMA_QUAT(i));
}
diff --git a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c 
b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
index a0cf34073235..f4dbffda0be7 100644
--- a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
+++ b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
@@ -103,10 +103,16 @@ rk3399_vpu_jpeg_enc_set_qtable(struct hantro_dev *vpu,
luma_qtable_p = (__be32 *)luma_qtable;
chroma_qtable_p = (__be32 *)chroma_qtable;
 
+   /*
+* Quantization table registers must be written in contiguous blocks.
+* DO NOT collapse the below two "for" loops into one.
+*/
for (i = 0; i < VEPU_JPEG_QUANT_TABLE_COUNT; i++) {
reg = get_unaligned_be32(&luma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_LUMA_QUAT(i));
+   }
 
+   for (i = 0; i < VEPU_JPEG_QUANT_TABLE_COUNT; i++) {
reg = get_unaligned_be32(&chroma_qtable_p[i]);
vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_CHROMA_QUAT(i));
}
-- 
2.17.1

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


Re: [greybus-dev] [PATCH] staging: greybus: bootrom: fix uninitialized variables

2020-01-27 Thread Alex Elder
On 1/25/20 6:14 AM, SAURAV GIREPUNJE wrote:
> On 25/01/20 11:00 +0100, Johan Hovold wrote:
>> On Sat, Jan 25, 2020 at 02:14:03PM +0530, Saurav Girepunje wrote:
>>> fix uninitialized variables issue found using static code analysis tool
>>
>> Which tool is that?
>>
>>> (error) Uninitialized variable: offset
>>> (error) Uninitialized variable: size
>>>
>>> Signed-off-by: Saurav Girepunje 
>>> ---
>>>   drivers/staging/greybus/bootrom.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/greybus/bootrom.c 
>>> b/drivers/staging/greybus/bootrom.c
>>> index a8efb86..9eabeb3 100644
>>> --- a/drivers/staging/greybus/bootrom.c
>>> +++ b/drivers/staging/greybus/bootrom.c
>>> @@ -245,7 +245,7 @@ static int gb_bootrom_get_firmware(struct gb_operation 
>>> *op)
>>>   struct gb_bootrom_get_firmware_request *firmware_request;
>>>   struct gb_bootrom_get_firmware_response *firmware_response;
>>>   struct device *dev = &op->connection->bundle->dev;
>>> -    unsigned int offset, size;
>>> +    unsigned int offset = 0, size = 0;
>>>   enum next_request_type next_request;
>>>   int ret = 0;
>>
>> I think this has come up in the past, and while the code in question is
>> overly complicated and confuses static checkers as well as humans, it
>> looks correct to me.
>>
>> Please make sure to verify the output of any tools before posting
>> patches based on them.
>>
>> Johan
> I used cppcheck tool .

Implied in Johan's question is a suggestion.

When you propose a patch that addresses something flagged by a
tool of some kind, it is good practice to identify the tool in
the patch description, and even better, give an example of how
the tool was invoked when reported the problem you're fixing.
Sometimes people even include the output of the tool, though
I think that can sometimes be a bit much.

And as you have now heard several times, do not blindly trust
the output of these tools.  They're intended to call attention
to things for you to examine; they are no match for a human,
and things they tell you about are not guaranteed to be real
problems.

-Alex

> ___ 
> greybus-dev mailing list
> greybus-...@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/greybus-dev

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


Re: [PATCH 0/4] Hantro VPU JPEG encoder fixes

2020-01-27 Thread Ezequiel Garcia
Hi Andrzej,

Thanks a lot for the fixes!

On Mon, 2020-01-27 at 15:30 +0100, Andrzej Pietrasiewicz wrote:
> This series addresses quality issues in encoded JPEG images.
> 
> The first patch actually restores the intention of the original submission
> of this driver: due to a typo the helper variables were unused and then
> have been removed in some cleanup done by Mauro.
> 
> The second patch aligns the driver's luma quantization table with
> the one in the ITU-T.81 standard.
> 
> The third patch changes the order in which quantization tables are
> written to the resulting file and to the hardware. The file expects
> a zig-zag order, while the hardware wants some special order, neither
> linear nor zig-zag. In other words, hardware-wise it rearranges which
> parts of quantization tables go into which 4-byte registers - in a hardware
> specific order rather than linear or zig-zag. It also affects rk3288 and
> hasn't been tested with it.
> 
> The fourth patch then rearranges the sequence of register writes.
> The whole luma quantization table must be written first, and then the
> chroma quantization is written. In other words, while patch 3/4
> changes what goes into which register, this patch changes when each
> register is written to. It also affects rk3288 and hasn't been
> tested with it.
> 

I've just tested RK3288, and this series is indeed fixing
these issues. So for all patches:

Tested-by: Ezequiel Garcia 

Thanks,
Ezequiel

> Andrzej Pietrasiewicz (4):
>   media: hantro: Read be32 words starting at every fourth byte
>   media: hantro: Use standard luma quantization table
>   media: hantro: Write the quantization tables in proper order
>   media: hantro: Write quantization table registers in increasing
> addresses order
> 
>  .../staging/media/hantro/hantro_h1_jpeg_enc.c | 19 -
>  drivers/staging/media/hantro/hantro_jpeg.c| 76 ++-
>  drivers/staging/media/hantro/hantro_jpeg.h|  2 +-
>  .../media/hantro/rk3399_vpu_hw_jpeg_enc.c | 24 --
>  4 files changed, 89 insertions(+), 32 deletions(-)
> 
> -- 
> 2.17.1
> 
> 


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


Re: [PATCH 1/4] media: hantro: Read be32 words starting at every fourth byte

2020-01-27 Thread Ezequiel Garcia
On Mon, 2020-01-27 at 15:30 +0100, Andrzej Pietrasiewicz wrote:
> Since (luma/chroma)_qtable is an array of unsigned char, indexing it
> returns consecutive byte locations, but we are supposed to read the arrays
> in four-byte words. Consequently, we should be pointing
> get_unaligned_be32() at consecutive word locations instead.
> 

Ouch!

Seems we were too fast on that cleanup. Please add:

Cc: sta...@vger.kernel.org
Fixes: 00c30f42c7595f "media: rockchip vpu: remove some unused vars"
Reviewed-by: Ezequiel Garcia 

Thanks,
Ezequiel

> Signed-off-by: Andrzej Pietrasiewicz 
> ---
>  drivers/staging/media/hantro/hantro_h1_jpeg_enc.c | 9 +++--
>  drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c | 9 +++--
>  2 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c 
> b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
> index 938b48d4d3d9..be787a045c7e 100644
> --- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
> +++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
> @@ -67,12 +67,17 @@ hantro_h1_jpeg_enc_set_qtable(struct hantro_dev *vpu,
> unsigned char *chroma_qtable)
>  {
>   u32 reg, i;
> + __be32 *luma_qtable_p;
> + __be32 *chroma_qtable_p;
> +
> + luma_qtable_p = (__be32 *)luma_qtable;
> + chroma_qtable_p = (__be32 *)chroma_qtable;
>  
>   for (i = 0; i < H1_JPEG_QUANT_TABLE_COUNT; i++) {
> - reg = get_unaligned_be32(&luma_qtable[i]);
> + reg = get_unaligned_be32(&luma_qtable_p[i]);
>   vepu_write_relaxed(vpu, reg, H1_REG_JPEG_LUMA_QUAT(i));
>  
> - reg = get_unaligned_be32(&chroma_qtable[i]);
> + reg = get_unaligned_be32(&chroma_qtable_p[i]);
>   vepu_write_relaxed(vpu, reg, H1_REG_JPEG_CHROMA_QUAT(i));
>   }
>  }
> diff --git a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c 
> b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
> index 067892345b5d..bdb95652d6a8 100644
> --- a/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
> +++ b/drivers/staging/media/hantro/rk3399_vpu_hw_jpeg_enc.c
> @@ -98,12 +98,17 @@ rk3399_vpu_jpeg_enc_set_qtable(struct hantro_dev *vpu,
>  unsigned char *chroma_qtable)
>  {
>   u32 reg, i;
> + __be32 *luma_qtable_p;
> + __be32 *chroma_qtable_p;
> +
> + luma_qtable_p = (__be32 *)luma_qtable;
> + chroma_qtable_p = (__be32 *)chroma_qtable;
>  
>   for (i = 0; i < VEPU_JPEG_QUANT_TABLE_COUNT; i++) {
> - reg = get_unaligned_be32(&luma_qtable[i]);
> + reg = get_unaligned_be32(&luma_qtable_p[i]);
>   vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_LUMA_QUAT(i));
>  
> - reg = get_unaligned_be32(&chroma_qtable[i]);
> + reg = get_unaligned_be32(&chroma_qtable_p[i]);
>   vepu_write_relaxed(vpu, reg, VEPU_REG_JPEG_CHROMA_QUAT(i));
>   }
>  }
> -- 
> 2.17.1
> 
> 


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


Re: [PATCH 2/4] media: hantro: Use standard luma quantization table

2020-01-27 Thread Ezequiel Garcia
Hi Andrzej,

On Mon, 2020-01-27 at 15:30 +0100, Andrzej Pietrasiewicz wrote:
> The table is actually different in the document than in this file, so align
> this file with the document.
> 
> Signed-off-by: Andrzej Pietrasiewicz 
> ---
>  drivers/staging/media/hantro/hantro_jpeg.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_jpeg.c 
> b/drivers/staging/media/hantro/hantro_jpeg.c
> index 125eb41f2ede..d3b381d00b23 100644
> --- a/drivers/staging/media/hantro/hantro_jpeg.c
> +++ b/drivers/staging/media/hantro/hantro_jpeg.c
> @@ -23,17 +23,17 @@
>  #define HUFF_CHROMA_AC_OFF   409
>  
>  /* Default tables from JPEG ITU-T.81
> - * (ISO/IEC 10918-1) Annex K.3, I
> + * (ISO/IEC 10918-1) Annex K, tables K.1 and K.2
>   */

I wonder if we shouldn't just have these tables
in decimal instead of hexa, so they look exactly
like the ones in the spec.

Thanks,
Ezequiel

>  static const unsigned char luma_q_table[] = {
> - 0x10, 0x0b, 0x0a, 0x10, 0x7c, 0x8c, 0x97, 0xa1,
> - 0x0c, 0x0c, 0x0e, 0x13, 0x7e, 0x9e, 0xa0, 0x9b,
> - 0x0e, 0x0d, 0x10, 0x18, 0x8c, 0x9d, 0xa9, 0x9c,
> - 0x0e, 0x11, 0x16, 0x1d, 0x97, 0xbb, 0xb4, 0xa2,
> - 0x12, 0x16, 0x25, 0x38, 0xa8, 0x6d, 0x67, 0xb1,
> - 0x18, 0x23, 0x37, 0x40, 0xb5, 0x68, 0x71, 0xc0,
> + 0x10, 0x0b, 0x0a, 0x10, 0x18, 0x28, 0x33, 0x3d,
> + 0x0c, 0x0c, 0x0e, 0x13, 0x1a, 0x3a, 0x3c, 0x37,
> + 0x0e, 0x0d, 0x10, 0x18, 0x28, 0x39, 0x45, 0x38,
> + 0x0e, 0x11, 0x16, 0x1d, 0x33, 0x57, 0x50, 0x3e,
> + 0x12, 0x16, 0x25, 0x38, 0x44, 0x6d, 0x67, 0x4d,
> + 0x18, 0x23, 0x37, 0x40, 0x51, 0x68, 0x71, 0x5c,
>   0x31, 0x40, 0x4e, 0x57, 0x67, 0x79, 0x78, 0x65,
> - 0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0xc7,
> + 0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0x63
>  };
>  
>  static const unsigned char chroma_q_table[] = {
> -- 
> 2.17.1
> 
> 


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


Re: [PATCH v2] staging: android: ashmem: Disallow ashmem memory from being remapped

2020-01-27 Thread Joel Fernandes
On Mon, Jan 27, 2020 at 03:56:16PM -0800, Todd Kjos wrote:
> From: Suren Baghdasaryan 
> 
> When ashmem file is mmapped, the resulting vma->vm_file points to the
> backing shmem file with the generic fops that do not check ashmem
> permissions like fops of ashmem do. If an mremap is done on the ashmem
> region, then the permission checks will be skipped. Fix that by disallowing
> mapping operation on the backing shmem file.

Reviewed-by: Joel Fernandes (Google) 

thanks!

 - Joel

> 
> Reported-by: Jann Horn 
> Signed-off-by: Suren Baghdasaryan 
> Cc: stable  # 4.4,4.9,4.14,4.18,5.4
> Signed-off-by: Todd Kjos 
> ---
>  drivers/staging/android/ashmem.c | 28 
>  1 file changed, 28 insertions(+)
> 
> v2: update commit message as suggested by joe...@google.com.
> 
> diff --git a/drivers/staging/android/ashmem.c 
> b/drivers/staging/android/ashmem.c
> index 74d497d39c5a..c6695354b123 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -351,8 +351,23 @@ static inline vm_flags_t calc_vm_may_flags(unsigned long 
> prot)
>  _calc_vm_trans(prot, PROT_EXEC,  VM_MAYEXEC);
>  }
>  
> +static int ashmem_vmfile_mmap(struct file *file, struct vm_area_struct *vma)
> +{
> + /* do not allow to mmap ashmem backing shmem file directly */
> + return -EPERM;
> +}
> +
> +static unsigned long
> +ashmem_vmfile_get_unmapped_area(struct file *file, unsigned long addr,
> + unsigned long len, unsigned long pgoff,
> + unsigned long flags)
> +{
> + return current->mm->get_unmapped_area(file, addr, len, pgoff, flags);
> +}
> +
>  static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
>  {
> + static struct file_operations vmfile_fops;
>   struct ashmem_area *asma = file->private_data;
>   int ret = 0;
>  
> @@ -393,6 +408,19 @@ static int ashmem_mmap(struct file *file, struct 
> vm_area_struct *vma)
>   }
>   vmfile->f_mode |= FMODE_LSEEK;
>   asma->file = vmfile;
> + /*
> +  * override mmap operation of the vmfile so that it can't be
> +  * remapped which would lead to creation of a new vma with no
> +  * asma permission checks. Have to override get_unmapped_area
> +  * as well to prevent VM_BUG_ON check for f_ops modification.
> +  */
> + if (!vmfile_fops.mmap) {
> + vmfile_fops = *vmfile->f_op;
> + vmfile_fops.mmap = ashmem_vmfile_mmap;
> + vmfile_fops.get_unmapped_area =
> + ashmem_vmfile_get_unmapped_area;
> + }
> + vmfile->f_op = &vmfile_fops;
>   }
>   get_file(asma->file);
>  
> -- 
> 2.25.0.341.g760bfbb309-goog
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel