[PATCH] drivers/staging/ccree: Removing trailing whitespaces

2017-05-14 Thread Pushkar Jambhlekar
Fixing 'checkpatch.pl' warnings: Trailing whitespaces

Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/ccree/ssi_cipher.c | 110 ++---
 1 file changed, 55 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/ccree/ssi_cipher.c 
b/drivers/staging/ccree/ssi_cipher.c
index 664ed7e..7e85d2c 100644
--- a/drivers/staging/ccree/ssi_cipher.c
+++ b/drivers/staging/ccree/ssi_cipher.c
@@ -1,15 +1,15 @@
 /*
  * Copyright (C) 2012-2017 ARM Limited or its affiliates.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see .
  */
@@ -117,7 +117,7 @@ static int validate_data_size(struct ssi_ablkcipher_ctx 
*ctx_p, unsigned int siz
switch (ctx_p->cipher_mode){
case DRV_CIPHER_XTS:
if ((size >= SSI_MIN_AES_XTS_SIZE) &&
-   (size <= SSI_MAX_AES_XTS_SIZE) && 
+   (size <= SSI_MAX_AES_XTS_SIZE) &&
IS_ALIGNED(size, AES_BLOCK_SIZE))
return 0;
break;
@@ -189,7 +189,7 @@ static int ssi_blkcipher_init(struct crypto_tfm *tfm)
int rc = 0;
unsigned int max_key_buf_size = get_max_keysize(tfm);
 
-   SSI_LOG_DEBUG("Initializing context @%p for %s\n", ctx_p, 
+   SSI_LOG_DEBUG("Initializing context @%p for %s\n", ctx_p,
crypto_tfm_alg_name(tfm));
 
CHECK_AND_RETURN_UPON_FIPS_ERROR();
@@ -251,7 +251,7 @@ static void ssi_blkcipher_exit(struct crypto_tfm *tfm)
SSI_RESTORE_DMA_ADDR_TO_48BIT(ctx_p->user.key_dma_addr);
dma_unmap_single(dev, ctx_p->user.key_dma_addr, max_key_buf_size,
DMA_TO_DEVICE);
-   SSI_LOG_DEBUG("Unmapped key buffer key_dma_addr=0x%llX\n", 
+   SSI_LOG_DEBUG("Unmapped key buffer key_dma_addr=0x%llX\n",
(unsigned long long)ctx_p->user.key_dma_addr);
 
/* Free key buffer in context */
@@ -266,9 +266,9 @@ typedef struct tdes_keys{
 u8  key3[DES_KEY_SIZE];
 }tdes_keys_t;
 
-static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
+static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+   0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
-   0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
 
 /* The function verifies that tdes keys are not weak.*/
@@ -278,7 +278,7 @@ static int ssi_fips_verify_3des_keys(const u8 *key, 
unsigned int keylen)
 tdes_keys_t *tdes_key = (tdes_keys_t*)key;
 
/* verify key1 != key2 and key3 != key2*/
-if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, 
sizeof(tdes_key->key1)) == 0) || 
+if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, 
sizeof(tdes_key->key1)) == 0) ||
  (memcmp((u8*)tdes_key->key3, (u8*)tdes_key->key2, 
sizeof(tdes_key->key3)) == 0) )) {
 return -ENOEXEC;
 }
@@ -317,8 +317,8 @@ static enum HwCryptoKey hw_key_to_cc_hw_key(int slot_num)
return END_OF_KEYS;
 }
 
-static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, 
-   const u8 *key, 
+static int ssi_blkcipher_setkey(struct crypto_tfm *tfm,
+   const u8 *key,
unsigned int keylen)
 {
struct ssi_ablkcipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
@@ -334,7 +334,7 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm,
CHECK_AND_RETURN_UPON_FIPS_ERROR();
 
SSI_LOG_DEBUG("ssi_blkcipher_setkey: after FIPS check");
-   
+
/* STAT_PHASE_0: Init and sanity checks */
START_CYCLE_COUNT();
 
@@ -396,13 +396,13 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm,
return -EINVAL;
}
}
-   if ((ctx_p->cipher_mode == DRV_CIPHER_XTS) && 
+   if ((ctx_p->cipher_mode == DRV_CIPHER_XTS) &&
ssi_fips_verify_xts_keys(key, keylen) != 0) {
SSI_LOG_DEBUG("ssi_blkcipher_setkey: weak XTS key");
return -EINVAL;
}
-   if ((ctx_p->flow_mode == S_DIN_to_DES) && 
-   (keylen == DES3_EDE_KEY_SIZE) && 
+   if ((ctx_p->flow

Re: [PATCH] staging: iio: meter: Replace symbolic permissions with octal permissions

2017-05-14 Thread harinath Nampally
Jonathan,

Thank you for letting me know about correct iio git tree.

I checked out 'togreg' branch, and noticed that
latest ade7758_core.c still has checkpatch.pl warnings.

Actually Quentin Swain fixed the similar warnings in the ade7854.c,
and my patch is fix for similar warnings but it is for different file
ade7758_core.c

Please correct me if I am wrong.

Thanks,
Harinath

On Mon, May 15, 2017 at 12:27 AM, harinath Nampally
 wrote:
> Jonathan,
>
> Thank you for letting me know about correct iio git tree.
>
> I checked out 'togreg' branch, and noticed that
> latest ade7758_core.c still has checkpatch.pl warnings.
>
> Actually Quentin Swain fixed the similar warnings in the ade7854.c,
> and my patch is fix for similar warnings but it is for different file
> ade7758_core.c
>
> Please refer to below link for Quentin Swain's patch.
> https://www.spinics.net/lists/linux-iio/msg33010.html
>
> Please let me know if I am wrong.
>
> Thanks,
> Harinath
>
> On Mon, May 15, 2017 at 12:22 AM, harinath Nampally
>  wrote:
>> Jonathan,
>>
>> Thank you for letting me know about correct iio git tree.
>>
>> I checked out 'togreg' branch, and noticed that
>> latest ade7758_core.c still has checkpatch.pl warnings.
>>
>> Actually Quentin Swain fixed the similar warnings in the ade7854.c,
>> and my patch is fix for similar warnings but it is for different file
>> ade7758_core.c
>>
>> Please refer to below link for Quentin Swain's patch.
>> https://www.spinics.net/lists/linux-iio/msg33010.html
>>
>> Please let me know if I am wrong.
>>
>> Thanks,
>> Harinath
>>
>> On Sun, May 14, 2017 at 10:41 AM, Jonathan Cameron  wrote:
>>>
>>> On 12/05/17 22:19, Harinath Nampally wrote:

 This patch fixes below kind of warnings:
 WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.

 Issue found and fixed by checkpatch.pl

 Signed-off-by: Harinath Nampally 
>>>
>>> Already done by Quentin Swain  last month...
>>>
>>> For IIO related patches, stuff gets queued up in iio.git on
>>> kernel.org before it gets sent on to Greg.  This is relatively
>>> unusual for staging, but does lead to lots of repeats of
>>> patches like this unfortunately.
>>>
>>> Jonathan
>>>
 ---
   drivers/staging/iio/meter/ade7758_core.c | 50
 
   1 file changed, 25 insertions(+), 25 deletions(-)

 diff --git a/drivers/staging/iio/meter/ade7758_core.c
 b/drivers/staging/iio/meter/ade7758_core.c
 index 99c89e6..40498af 100644
 --- a/drivers/staging/iio/meter/ade7758_core.c
 +++ b/drivers/staging/iio/meter/ade7758_core.c
 @@ -301,103 +301,103 @@ static int ade7758_reset(struct device *dev)
 return ret;
   }
   -static IIO_DEV_ATTR_VPEAK(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_VPEAK(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_VPEAK);
 -static IIO_DEV_ATTR_IPEAK(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_IPEAK(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_VPEAK);
 -static IIO_DEV_ATTR_APHCAL(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_APHCAL(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_APHCAL);
 -static IIO_DEV_ATTR_BPHCAL(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_BPHCAL(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_BPHCAL);
 -static IIO_DEV_ATTR_CPHCAL(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_CPHCAL(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_CPHCAL);
 -static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_WDIV(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_WDIV);
 -static IIO_DEV_ATTR_VADIV(S_IWUSR | S_IRUGO,
 +static IIO_DEV_ATTR_VADIV(0644,
 ade7758_read_8bit,
 ade7758_write_8bit,
 ADE7758_VADIV);
 -static IIO_DEV_ATTR_AIRMS(S_IRUGO,
 +static IIO_DEV_ATTR_AIRMS(0444,
 ade7758_read_24bit,
 NULL,
 ADE7758_AIRMS);
 -static IIO_DEV_ATTR_BIRMS(S_IRUGO,
 +static IIO_DEV_ATTR_BIRMS(0444,
 ade7758_read_24bit,
 NULL,
 ADE7758_BIRMS);
 -static IIO_DEV_ATTR_CIRMS(S_IRUGO,
 +static IIO_DEV_ATTR_CIRMS(0444,
 ade7758_read_24bit,
 NULL,
 ADE7758_CIRMS);
 -static IIO_DEV_ATTR_AVRMS(S_IRUGO,
 +static IIO_DEV_ATTR_AVRMS(0444,
 ade7758_read_24bit,
 NULL,
 ADE7758_AVRMS);
 -static IIO_DEV_ATTR_BVRMS(S_IRUGO,
 +static IIO_DEV_ATTR_BVRMS(0444,
  

Re: [PATCH] staging: iio: meter: Replace symbolic permissions with octal permissions

2017-05-14 Thread harinath Nampally
Jonathan,

Thank you for letting me know about correct iio git tree.

I checked out 'togreg' branch, and noticed that
latest ade7758_core.c still has checkpatch.pl warnings.

Actually Quentin Swain fixed the similar warnings in the ade7854.c,
and my patch is fix for similar warnings but it is for different file
ade7758_core.c

Please refer to below link for Quentin Swain's patch.
https://www.spinics.net/lists/linux-iio/msg33010.html

Please let me know if I am wrong.

Thanks,
Harinath

On Mon, May 15, 2017 at 12:22 AM, harinath Nampally
 wrote:
> Jonathan,
>
> Thank you for letting me know about correct iio git tree.
>
> I checked out 'togreg' branch, and noticed that
> latest ade7758_core.c still has checkpatch.pl warnings.
>
> Actually Quentin Swain fixed the similar warnings in the ade7854.c,
> and my patch is fix for similar warnings but it is for different file
> ade7758_core.c
>
> Please refer to below link for Quentin Swain's patch.
> https://www.spinics.net/lists/linux-iio/msg33010.html
>
> Please let me know if I am wrong.
>
> Thanks,
> Harinath
>
> On Sun, May 14, 2017 at 10:41 AM, Jonathan Cameron  wrote:
>>
>> On 12/05/17 22:19, Harinath Nampally wrote:
>>>
>>> This patch fixes below kind of warnings:
>>> WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.
>>>
>>> Issue found and fixed by checkpatch.pl
>>>
>>> Signed-off-by: Harinath Nampally 
>>
>> Already done by Quentin Swain  last month...
>>
>> For IIO related patches, stuff gets queued up in iio.git on
>> kernel.org before it gets sent on to Greg.  This is relatively
>> unusual for staging, but does lead to lots of repeats of
>> patches like this unfortunately.
>>
>> Jonathan
>>
>>> ---
>>>   drivers/staging/iio/meter/ade7758_core.c | 50
>>> 
>>>   1 file changed, 25 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/drivers/staging/iio/meter/ade7758_core.c
>>> b/drivers/staging/iio/meter/ade7758_core.c
>>> index 99c89e6..40498af 100644
>>> --- a/drivers/staging/iio/meter/ade7758_core.c
>>> +++ b/drivers/staging/iio/meter/ade7758_core.c
>>> @@ -301,103 +301,103 @@ static int ade7758_reset(struct device *dev)
>>> return ret;
>>>   }
>>>   -static IIO_DEV_ATTR_VPEAK(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_VPEAK(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_VPEAK);
>>> -static IIO_DEV_ATTR_IPEAK(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_IPEAK(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_VPEAK);
>>> -static IIO_DEV_ATTR_APHCAL(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_APHCAL(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_APHCAL);
>>> -static IIO_DEV_ATTR_BPHCAL(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_BPHCAL(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_BPHCAL);
>>> -static IIO_DEV_ATTR_CPHCAL(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_CPHCAL(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_CPHCAL);
>>> -static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_WDIV(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_WDIV);
>>> -static IIO_DEV_ATTR_VADIV(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_VADIV(0644,
>>> ade7758_read_8bit,
>>> ade7758_write_8bit,
>>> ADE7758_VADIV);
>>> -static IIO_DEV_ATTR_AIRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_AIRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_AIRMS);
>>> -static IIO_DEV_ATTR_BIRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_BIRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_BIRMS);
>>> -static IIO_DEV_ATTR_CIRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_CIRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_CIRMS);
>>> -static IIO_DEV_ATTR_AVRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_AVRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_AVRMS);
>>> -static IIO_DEV_ATTR_BVRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_BVRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_BVRMS);
>>> -static IIO_DEV_ATTR_CVRMS(S_IRUGO,
>>> +static IIO_DEV_ATTR_CVRMS(0444,
>>> ade7758_read_24bit,
>>> NULL,
>>> ADE7758_CVRMS);
>>> -static IIO_DEV_ATTR_AIRMSOS(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_AIRMSOS(0644,
>>> ade7758_read_16bit,
>>> ade7758_write_16bit,
>>> ADE7758_AIRMSOS);
>>> -static IIO_DEV_ATTR_BIRMSOS(S_IWUSR | S_IRUGO,
>>> +static IIO_DEV_ATTR_BIRMSOS(0644,
>>>  

Re: [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions.

2017-05-14 Thread harinath Nampally
Jonathan,

Thank you for letting me know. In future I will work on 'togreg' branch
of iio.git tree to send my patches.

Thanks,
Harinath

On Sun, May 14, 2017 at 11:29 AM, Jonathan Cameron  wrote:
> On 10/05/17 00:41, Harinath Nampally wrote:
>>
>> This patch fixes below kind of warnings:
>> WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.
>>
>> Below errors are false positives:
>> ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
>> ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions
>>
>> Signed-off-by: Harinath Nampally 
>
> I've already taken a patch for this.
>
> For IIO patches (including for drivers in staging) please also
> check the iio.git tree and in particularly base the on the togreg branch
> of that unless you know something you need is in the testing branch
> (usually more recent) in which case use that.  This stuff all gets
> batched up every few weeks and sent as a pull request to Greg.
> Right now we have just ended a merge window so it's the longest gap
> that typically occurs in these going to Greg.
>
> Thanks,
>
> Jonathan
>
>> ---
>> Changes in v2:
>>   - None because only [PATCH v2 1/3] has improvement
>>
>>   drivers/staging/iio/meter/ade7753.c | 46
>> ++---
>>   1 file changed, 23 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/staging/iio/meter/ade7753.c
>> b/drivers/staging/iio/meter/ade7753.c
>> index 5d45a68..2534bd0 100644
>> --- a/drivers/staging/iio/meter/ade7753.c
>> +++ b/drivers/staging/iio/meter/ade7753.c
>> @@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit,
>> ADE7753_AENERGY);
>>   static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
>>   static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
>>   static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
>> -static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CFDEN(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_CFDEN);
>> -static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CFNUM(0644,
>> ade7753_read_8bit,
>> ade7753_write_8bit,
>> ADE7753_CFNUM);
>>   static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
>> -static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_PHCAL(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_PHCAL);
>> -static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_APOS(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_APOS);
>> -static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_SAGCYC(0644,
>> ade7753_read_8bit,
>> ade7753_write_8bit,
>> ADE7753_SAGCYC);
>> -static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_SAGLVL(0644,
>> ade7753_read_8bit,
>> ade7753_write_8bit,
>> ADE7753_SAGLVL);
>> -static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_LINECYC(0644,
>> ade7753_read_8bit,
>> ade7753_write_8bit,
>> ADE7753_LINECYC);
>> -static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_WDIV(0644,
>> ade7753_read_8bit,
>> ade7753_write_8bit,
>> ADE7753_WDIV);
>> -static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IRMS(0644,
>> ade7753_read_24bit,
>> NULL,
>> ADE7753_IRMS);
>> -static IIO_DEV_ATTR_VRMS(S_IRUGO,
>> +static IIO_DEV_ATTR_VRMS(0444,
>> ade7753_read_24bit,
>> NULL,
>> ADE7753_VRMS);
>> -static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IRMSOS(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_IRMSOS);
>> -static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_VRMSOS(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_VRMSOS);
>> -static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_WGAIN(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_WGAIN);
>> -static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_VAGAIN(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_VAGAIN);
>> -static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_PGA_GAIN(0644,
>> ade7753_read_16bit,
>> ade7753_write_16bit,
>> ADE7753_GAIN);
>> -static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IPKLVL(0644,
>> 

[PATCH] staging: fsl-mc: Fix code alignment style issues

2017-05-14 Thread Brett Hitchcock
Fixing recommendation from checkpatch.pl:
"CHECK: Alignment should match open parenthesis"

Signed-off-by: Brett Hitchcock 
---
 drivers/staging/fsl-mc/bus/dprc-driver.c | 4 ++--
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c  | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c 
b/drivers/staging/fsl-mc/bus/dprc-driver.c
index e4b0341..d723c69 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -681,8 +681,8 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
}
 
if (major_ver < DPRC_MIN_VER_MAJOR ||
-  (major_ver == DPRC_MIN_VER_MAJOR &&
-   minor_ver < DPRC_MIN_VER_MINOR)) {
+   (major_ver == DPRC_MIN_VER_MAJOR &&
+minor_ver < DPRC_MIN_VER_MINOR)) {
dev_err(&mc_dev->dev,
"ERROR: DPRC version %d.%d not supported\n",
major_ver, minor_ver);
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c 
b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
index 3be5f25..50eb415 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
@@ -644,10 +644,10 @@ static int get_mc_addr_translation_ranges(struct device 
*dev,
const __be32 *cell;
 
ret = parse_mc_ranges(dev,
-   &paddr_cells,
-   &mc_addr_cells,
-   &mc_size_cells,
-   &ranges_start);
+ &paddr_cells,
+ &mc_addr_cells,
+ &mc_size_cells,
+ &ranges_start);
if (ret < 0)
return ret;
 
-- 
2.7.4

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


linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966: cart before the horse ?

2017-05-14 Thread David Binderman
Hello there,

linux-4.12-rc1/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c:2966]: (style) 
Array index 'i' is used before limits check.

Source code is

while (szLine[i] != '{' && i < strlen(szLine))
i++;

Regards

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


linux-4.12-rc1/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h:76: cart before the horse ?

2017-05-14 Thread David Binderman
Hello there,

linux-4.12-rc1/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h:76]:
 (style) Array index 'ix' is used before limits check.

Source code is

for (ix=0;
((src_str[ix] != '\0') && (ix< max_len));
++ix) /*Nothing else to do*/;

Regards

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


[PATCH] drivers/staging: refactor dgnc tty registration.

2017-05-14 Thread Haim Daniel
-remove duplicate tty allocation code for serial and printer drivers.
-fix sparse warning: too long initializer-string for array of char.

Signed-off-by: Haim Daniel 
---
 drivers/staging/dgnc/dgnc_driver.h |  13 
 drivers/staging/dgnc/dgnc_tty.c| 137 ++---
 2 files changed, 50 insertions(+), 100 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 980410f..764d6fe 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -52,19 +52,6 @@
 
 #define dgnc_jiffies_from_ms(a) (((a) * HZ) / 1000)
 
-/*
- * Define a local default termios struct. All ports will be created
- * with this termios initially.  This is the same structure that is defined
- * as the default in tty_io.c with the same settings overridden as in serial.c
- *
- * In short, this should match the internal serial ports' defaults.
- */
-#defineDEFAULT_IFLAGS  (ICRNL | IXON)
-#defineDEFAULT_OFLAGS  (OPOST | ONLCR)
-#defineDEFAULT_CFLAGS  (B9600 | CS8 | CREAD | HUPCL | CLOCAL)
-#defineDEFAULT_LFLAGS  (ISIG | ICANON | ECHO | ECHOE | ECHOK | \
-   ECHOCTL | ECHOKE | IEXTEN)
-
 #ifndef _POSIX_VDISABLE
 #define   _POSIX_VDISABLE '\0'
 #endif
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 9e98781..87af304 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -51,22 +51,6 @@
.digi_term ="ansi"  /* default terminal type */
 };
 
-/*
- * Define a local default termios struct. All ports will be created
- * with this termios initially.
- *
- * This defines a raw port at 9600 baud, 8 data bits, no parity,
- * 1 stop bit.
- */
-static const struct ktermios default_termios = {
-   .c_iflag =  (DEFAULT_IFLAGS),
-   .c_oflag =  (DEFAULT_OFLAGS),
-   .c_cflag =  (DEFAULT_CFLAGS),
-   .c_lflag =  (DEFAULT_LFLAGS),
-   .c_cc = INIT_C_CC,
-   .c_line =   0,
-};
-
 static int dgnc_tty_open(struct tty_struct *tty, struct file *file);
 static void dgnc_tty_close(struct tty_struct *tty, struct file *file);
 static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file,
@@ -129,6 +113,41 @@ static void dgnc_tty_set_termios(struct tty_struct *tty,
 
 /* TTY Initialization/Cleanup Functions */
 
+static struct tty_driver *__dgnc_tty_register(char *serial_name, uint maxports,
+ int major, int minor)
+{
+   int rc;
+   struct tty_driver *drv = tty_alloc_driver(maxports,
+ TTY_DRIVER_REAL_RAW |
+ TTY_DRIVER_DYNAMIC_DEV |
+ TTY_DRIVER_HARDWARE_BREAK);
+   if (IS_ERR(drv))
+   return drv;
+
+   drv->name = serial_name;
+   drv->name_base = 0;
+   drv->major = major;
+   drv->minor_start = minor;
+   drv->type = TTY_DRIVER_TYPE_SERIAL;
+   drv->subtype = SERIAL_TYPE_NORMAL;
+   drv->init_termios = tty_std_termios;
+   drv->init_termios.c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL);
+   drv->init_termios.c_ispeed = 9600;
+   drv->init_termios.c_ospeed = 9600;
+   drv->driver_name = DRVSTR;
+   /*
+* Entry points for driver.  Called by the kernel from
+* tty_io.c and n_tty.c.
+*/
+   tty_set_operations(drv, &dgnc_tty_ops);
+   rc = tty_register_driver(drv);
+   if (rc < 0) {
+   put_tty_driver(drv);
+   return ERR_PTR(rc);
+   }
+   return drv;
+}
+
 /**
  * dgnc_tty_register() - Init the tty subsystem for this board.
  */
@@ -136,87 +155,31 @@ int dgnc_tty_register(struct dgnc_board *brd)
 {
int rc;
 
-   brd->serial_driver = tty_alloc_driver(brd->maxports,
- TTY_DRIVER_REAL_RAW |
- TTY_DRIVER_DYNAMIC_DEV |
- TTY_DRIVER_HARDWARE_BREAK);
-   if (IS_ERR(brd->serial_driver))
-   return PTR_ERR(brd->serial_driver);
-
snprintf(brd->serial_name, MAXTTYNAMELEN, "tty_dgnc_%d_",
 brd->boardnum);
 
-   brd->serial_driver->name = brd->serial_name;
-   brd->serial_driver->name_base = 0;
-   brd->serial_driver->major = 0;
-   brd->serial_driver->minor_start = 0;
-   brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
-   brd->serial_driver->subtype = SERIAL_TYPE_NORMAL;
-   brd->serial_driver->init_termios = default_termios;
-   brd->serial_driver->driver_name = DRVSTR;
-
-   /*
-* Entry points for driver.  Called by the kernel from
-* tty_io.c and n_tty.c.
-*/
-   tty_set_operations(brd->serial_driver, &dgnc_tty_ops);
-
-   rc = tty_register_driver(brd->serial_driver);
-   if (rc < 0) {
-   

Re: [PATCH] staging: iio: meter: ade7854: Fix symbolic permissions to octal permissions

2017-05-14 Thread Jonathan Cameron

On 08/05/17 21:10, eddi1983 wrote:

From: Christoph Fanelsa 

Fixed the checkpatch warnings (task #10 of eudyptula challenge) of prefered
octal permissions over symbolic ones

Signed-off-by: Christoph Fanelsa 
Cc: Michael Hennerich 
Cc: Jonathan Cameron 
Cc: Hartmut Knaack 
Cc: Peter Meerwald-Stadler 
Cc: Greg Kroah-Hartman 
Cc: linux-...@vger.kernel.org
Cc: de...@driverdev.osuosl.org
Cc: linux-ker...@vger.kernel.org

Already have a patch applied to do this.

Note that IIO patches take a slightly less direct route to Greg's
staging tree than most other staging patches.  They go through the
IIO tree first which can be found at:

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/

Of particular interest is the togreg branch and the testing branch
which can also let you see more recent stuff.

Jonathan



  drivers/staging/iio/meter/ade7854.c | 88 ++---
  1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7854.c 
b/drivers/staging/iio/meter/ade7854.c
index c6cffc11b0ba..70612da64a8b 100644
--- a/drivers/staging/iio/meter/ade7854.c
+++ b/drivers/staging/iio/meter/ade7854.c
@@ -186,127 +186,127 @@ static int ade7854_reset(struct device *dev)
return st->write_reg_16(dev, ADE7854_CONFIG, val);
  }
  
-static IIO_DEV_ATTR_AIGAIN(S_IWUSR | S_IRUGO,

+static IIO_DEV_ATTR_AIGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AIGAIN);
-static IIO_DEV_ATTR_BIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BIGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_BIGAIN);
-static IIO_DEV_ATTR_CIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CIGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_CIGAIN);
-static IIO_DEV_ATTR_NIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_NIGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_NIGAIN);
-static IIO_DEV_ATTR_AVGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_AVGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AVGAIN);
-static IIO_DEV_ATTR_BVGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BVGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_BVGAIN);
-static IIO_DEV_ATTR_CVGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CVGAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_CVGAIN);
-static IIO_DEV_ATTR_APPARENT_POWER_A_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APPARENT_POWER_A_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AVAGAIN);
-static IIO_DEV_ATTR_APPARENT_POWER_B_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APPARENT_POWER_B_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_BVAGAIN);
-static IIO_DEV_ATTR_APPARENT_POWER_C_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APPARENT_POWER_C_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_CVAGAIN);
-static IIO_DEV_ATTR_ACTIVE_POWER_A_OFFSET(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_ACTIVE_POWER_A_OFFSET(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AWATTOS);
-static IIO_DEV_ATTR_ACTIVE_POWER_B_OFFSET(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_ACTIVE_POWER_B_OFFSET(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_BWATTOS);
-static IIO_DEV_ATTR_ACTIVE_POWER_C_OFFSET(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_ACTIVE_POWER_C_OFFSET(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_CWATTOS);
-static IIO_DEV_ATTR_REACTIVE_POWER_A_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_REACTIVE_POWER_A_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AVARGAIN);
-static IIO_DEV_ATTR_REACTIVE_POWER_B_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_REACTIVE_POWER_B_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_BVARGAIN);
-static IIO_DEV_ATTR_REACTIVE_POWER_C_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_REACTIVE_POWER_C_GAIN(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_CVARGAIN);
-static IIO_DEV_ATTR_REACTIVE_POWER_A_OFFSET(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_REACTIVE_POWER_A_OFFSET(0644,
ade7854_read_24bit,
ade7854_write_24bit,
ADE7854_AVAROS);
-static IIO_DEV_ATTR_REACTIVE_POWER_B_OFFSET(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_REACTIVE_POWER_B_OFFSET(0644,
ade7854_read_24bit,
ade7854_write_24bit,
   

Re: [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions.

2017-05-14 Thread Jonathan Cameron

On 10/05/17 00:41, Harinath Nampally wrote:

This patch fixes below kind of warnings:
WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.

Below errors are false positives:
ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions

Signed-off-by: Harinath Nampally 

I've already taken a patch for this.

For IIO patches (including for drivers in staging) please also
check the iio.git tree and in particularly base the on the togreg branch
of that unless you know something you need is in the testing branch
(usually more recent) in which case use that.  This stuff all gets
batched up every few weeks and sent as a pull request to Greg.
Right now we have just ended a merge window so it's the longest gap
that typically occurs in these going to Greg.

Thanks,

Jonathan

---
Changes in v2:
  - None because only [PATCH v2 1/3] has improvement

  drivers/staging/iio/meter/ade7753.c | 46 ++---
  1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c 
b/drivers/staging/iio/meter/ade7753.c
index 5d45a68..2534bd0 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit, 
ADE7753_AENERGY);
  static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
  static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
  static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
-static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFDEN(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_CFDEN);
-static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFNUM(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_CFNUM);
  static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
-static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PHCAL(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_PHCAL);
-static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APOS(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_APOS);
-static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGCYC(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_SAGCYC);
-static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGLVL(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_SAGLVL);
-static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_LINECYC(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_LINECYC);
-static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WDIV(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_WDIV);
-static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMS(0644,
ade7753_read_24bit,
NULL,
ADE7753_IRMS);
-static IIO_DEV_ATTR_VRMS(S_IRUGO,
+static IIO_DEV_ATTR_VRMS(0444,
ade7753_read_24bit,
NULL,
ADE7753_VRMS);
-static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMSOS(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_IRMSOS);
-static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VRMSOS(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_VRMSOS);
-static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WGAIN(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_WGAIN);
-static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VAGAIN(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_VAGAIN);
-static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PGA_GAIN(0644,
ade7753_read_16bit,
ade7753_write_16bit,
ADE7753_GAIN);
-static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IPKLVL(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_IPKLVL);
-static IIO_DEV_ATTR_VPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VPKLVL(0644,
ade7753_read_8bit,
ade7753_write_8bit,
ADE7753_VPKLVL);
-static IIO_DEV_ATTR_IPEAK(S_IRUGO,
+static IIO_DEV_ATTR_IPEAK(0444,
ade7753_read_24bit,
NULL,
ADE7753_IPEAK);
-static IIO_DEV_ATTR_VPEAK(S_IRUGO,
+static IIO_DEV_ATTR_VPEAK(0444,
ade7753_read_

Re: [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments.

2017-05-14 Thread Jonathan Cameron

On 10/05/17 00:41, Harinath Nampally wrote:

This patch fixes below checkpatch.pl kind of warnings:
CHECK: Alignment should match open parenthesis

Signed-off-by: Harinath Nampally 

Good patch and well described.

Applied this one (without patch 1) to the togreg branch of
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/
which is initially pushed out as testing for the autobuilders
to see if we've missed anything.

Thanks,

Jonathan

---
Changes in v2:
  - None because only [PATCH v2 1/3] has improvement

  drivers/staging/iio/meter/ade7753.c | 55 ++---
  1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c 
b/drivers/staging/iio/meter/ade7753.c
index cffe6bf..5d45a68 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -108,9 +108,8 @@ static int ade7753_spi_write_reg_8(struct device *dev,
return ret;
  }
  
-static int ade7753_spi_write_reg_16(struct device *dev,

-   u8 reg_address,
-   u16 value)
+static int ade7753_spi_write_reg_16(struct device *dev, u8 reg_address,
+   u16 value)
  {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -127,8 +126,8 @@ static int ade7753_spi_write_reg_16(struct device *dev,
  }
  
  static int ade7753_spi_read_reg_8(struct device *dev,

-   u8 reg_address,
-   u8 *val)
+ u8 reg_address,
+ u8 *val)
  {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7753_state *st = iio_priv(indio_dev);
@@ -137,7 +136,7 @@ static int ade7753_spi_read_reg_8(struct device *dev,
ret = spi_w8r8(st->us, ADE7753_READ_REG(reg_address));
if (ret < 0) {
dev_err(&st->us->dev, "problem when reading 8 bit register 
0x%02X",
-   reg_address);
+   reg_address);
return ret;
}
*val = ret;
@@ -146,8 +145,8 @@ static int ade7753_spi_read_reg_8(struct device *dev,
  }
  
  static int ade7753_spi_read_reg_16(struct device *dev,

-   u8 reg_address,
-   u16 *val)
+  u8 reg_address,
+  u16 *val)
  {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7753_state *st = iio_priv(indio_dev);
@@ -166,8 +165,8 @@ static int ade7753_spi_read_reg_16(struct device *dev,
  }
  
  static int ade7753_spi_read_reg_24(struct device *dev,

-   u8 reg_address,
-   u32 *val)
+  u8 reg_address,
+  u32 *val)
  {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7753_state *st = iio_priv(indio_dev);
@@ -190,7 +189,7 @@ static int ade7753_spi_read_reg_24(struct device *dev,
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
if (ret) {
dev_err(&st->us->dev, "problem when reading 24 bit register 
0x%02X",
-   reg_address);
+   reg_address);
goto error_ret;
}
*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
@@ -201,8 +200,8 @@ static int ade7753_spi_read_reg_24(struct device *dev,
  }
  
  static ssize_t ade7753_read_8bit(struct device *dev,

-   struct device_attribute *attr,
-   char *buf)
+struct device_attribute *attr,
+char *buf)
  {
int ret;
u8 val;
@@ -216,8 +215,8 @@ static ssize_t ade7753_read_8bit(struct device *dev,
  }
  
  static ssize_t ade7753_read_16bit(struct device *dev,

-   struct device_attribute *attr,
-   char *buf)
+ struct device_attribute *attr,
+ char *buf)
  {
int ret;
u16 val;
@@ -231,8 +230,8 @@ static ssize_t ade7753_read_16bit(struct device *dev,
  }
  
  static ssize_t ade7753_read_24bit(struct device *dev,

-   struct device_attribute *attr,
-   char *buf)
+ struct device_attribute *attr,
+ char *buf)
  {
int ret;
u32 val;
@@ -246,9 +245,9 @@ static ssize_t ade7753_read_24bit(struct device *dev,
  }
  
  static ssize_t ade7753_write_8bit(struct device *dev,

-   struct device_attribute *attr,
-   const char *buf,
-   size_t len)
+ struct device_attribute *attr,
+ const char *buf,
+ size_t len)
  {
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
int ret;
@@ -264,9 +263,9 @@ static ssize_t ade7753_write_8bit(struct device *dev,
  }
  
  static ssize_t 

Re: [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition.

2017-05-14 Thread Jonathan Cameron

On 10/05/17 00:41, Harinath Nampally wrote:

This patch fixes below checkpatch.pl warning:
CHECK: struct mutex definition without comment

Signed-off-by: Harinath Nampally 

They description is no longer correct. This moves a comment
rather than adding one.

J

---
Changes in v2:
  - Removed the extra comment for mutex in the struct.

  drivers/staging/iio/meter/ade7753.c | 3 ++-
  1 file changed, 1 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/meter/ade7753.c 
b/drivers/staging/iio/meter/ade7753.c
index b71fbd3..cffe6bf 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -78,12 +78,13 @@
  /**
   * struct ade7753_state - device instance specific data
   * @us: actual spi_device
+ * @buf_lock:   mutex to protect tx and rx
   * @tx: transmit buffer
   * @rx: receive buffer
- * @buf_lock:   mutex to protect tx and rx
   **/
  struct ade7753_state {
struct spi_device   *us;
struct mutexbuf_lock;
u8  tx[ADE7753_MAX_TX] cacheline_aligned;
u8  rx[ADE7753_MAX_RX];



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


Re: [PATCH v2 0/3] coding style warnings fixes

2017-05-14 Thread Jonathan Cameron

On 10/05/17 00:41, Harinath Nampally wrote:

This revised patchset is for improvement in [PATCH v2 1/3]
as per the code review comment from Dan Carpenter.

Other two patches [PATCH v2 2/3] and [PATCH v2 3/3] are unchanged,
so they are same as [PATCH 2/3] and [PATCH 3/3] respectively.

Please find the following related patches:
[PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition
[PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments
[PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal 
permissions

Harinath Nampally (3):
   staging: iio: meter: Add the comment for mutex definition
   staging: iio: meter: Fix the identations for proper alignments
   staging: iio: meter: Replace symbolic permissions with octal
 permissions

  drivers/staging/iio/meter/ade7753.c | 104 ++--
  1 file changed, 51 insertions(+), 52 deletions(-)


Please don't post new versions of a patch series as a reply to earlier versions.
It very rapidly leads to deep and unmanageable threads!

Jonathan




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


Re: [PATCH] staging: iio: meter: Replace symbolic permissions with octal permissions

2017-05-14 Thread Jonathan Cameron

On 12/05/17 22:19, Harinath Nampally wrote:

This patch fixes below kind of warnings:
WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.

Issue found and fixed by checkpatch.pl

Signed-off-by: Harinath Nampally 

Already done by Quentin Swain  last month...

For IIO related patches, stuff gets queued up in iio.git on
kernel.org before it gets sent on to Greg.  This is relatively
unusual for staging, but does lead to lots of repeats of
patches like this unfortunately.

Jonathan

---
  drivers/staging/iio/meter/ade7758_core.c | 50 
  1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7758_core.c 
b/drivers/staging/iio/meter/ade7758_core.c
index 99c89e6..40498af 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -301,103 +301,103 @@ static int ade7758_reset(struct device *dev)
return ret;
  }
  
-static IIO_DEV_ATTR_VPEAK(S_IWUSR | S_IRUGO,

+static IIO_DEV_ATTR_VPEAK(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_VPEAK);
-static IIO_DEV_ATTR_IPEAK(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IPEAK(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_VPEAK);
-static IIO_DEV_ATTR_APHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APHCAL(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_APHCAL);
-static IIO_DEV_ATTR_BPHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BPHCAL(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_BPHCAL);
-static IIO_DEV_ATTR_CPHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CPHCAL(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_CPHCAL);
-static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WDIV(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_WDIV);
-static IIO_DEV_ATTR_VADIV(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VADIV(0644,
ade7758_read_8bit,
ade7758_write_8bit,
ADE7758_VADIV);
-static IIO_DEV_ATTR_AIRMS(S_IRUGO,
+static IIO_DEV_ATTR_AIRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_AIRMS);
-static IIO_DEV_ATTR_BIRMS(S_IRUGO,
+static IIO_DEV_ATTR_BIRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_BIRMS);
-static IIO_DEV_ATTR_CIRMS(S_IRUGO,
+static IIO_DEV_ATTR_CIRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_CIRMS);
-static IIO_DEV_ATTR_AVRMS(S_IRUGO,
+static IIO_DEV_ATTR_AVRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_AVRMS);
-static IIO_DEV_ATTR_BVRMS(S_IRUGO,
+static IIO_DEV_ATTR_BVRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_BVRMS);
-static IIO_DEV_ATTR_CVRMS(S_IRUGO,
+static IIO_DEV_ATTR_CVRMS(0444,
ade7758_read_24bit,
NULL,
ADE7758_CVRMS);
-static IIO_DEV_ATTR_AIRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_AIRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_AIRMSOS);
-static IIO_DEV_ATTR_BIRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BIRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_BIRMSOS);
-static IIO_DEV_ATTR_CIRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CIRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_CIRMSOS);
-static IIO_DEV_ATTR_AVRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_AVRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_AVRMSOS);
-static IIO_DEV_ATTR_BVRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BVRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_BVRMSOS);
-static IIO_DEV_ATTR_CVRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CVRMSOS(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_CVRMSOS);
-static IIO_DEV_ATTR_AIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_AIGAIN(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_AIGAIN);
-static IIO_DEV_ATTR_BIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_BIGAIN(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_BIGAIN);
-static IIO_DEV_ATTR_CIGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CIGAIN(0644,
ade7758_read_16bit,
ade7758_write_16bit,
ADE7758_CIGAIN);
-static IIO_DEV_ATTR_AVRMSGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_AVRMSGAIN(0644,
ade7

Re: [PATCH 12622/12622] Staging: ccree: ssi_cipher: fix brace coding style issue

2017-05-14 Thread Greg KH
On Sat, May 13, 2017 at 02:45:03PM +0300, Ammly Fredrick wrote:
> Fixed some coding style issues after running scripts/checkpatch.pl
> 
> Fixed spelling in ssi_blkcipher_complete(), should be counter not couter.
> 
> Signed-off-by: Ammly Fredrick 

I don't see the 12621 other patches in this series, did you really make
that many changes in this driver?  :)

You are doing a lot of different things all in the same patch, which
isn't allowed.  Please fix up and only do one type of thing at a time.

thanks,

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