Re: [PATCH] staging: nvec: Fixed 12 code style checks and changed udelay() to usleep_range() on 2 lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
As per the previous email, I understand that some patches were unnecessary(For example the fix for the spaces ). But it was a bit confusing. Can someone please let me know which patches are needed and which are not?
Regards,
Parth Sane
> On 29-Feb-2016, at 5:00 PM, Marc Dietrich <marvin24@xxxxxx> wrote:
> 
> Hi Parth,
> 
> please also cc devel@xxxxxxxxxxxxxxxxxxxxxx next time.
> 
> Some comments below.
> 
> Am Freitag, 26. Februar 2016, 15:24:21 CET schrieb Parth Sane:
>> 1)Null comparison
>> 2)Extra Line after curly braces
>> 3)Changed udelay to udelay_range
>> 4)BUG_ON to WARN_ON to avoid crashing kernel
>> 5)Removed copyright notice as recommended by checkpatch script
>> 
>> Signed-off-by: Parth Sane <laerdevstudios@xxxxxxxxx>
>> ---
>> drivers/staging/nvec/nvec-keytable.h | 13 -------------
>> drivers/staging/nvec/nvec.c          | 18 +++++++++---------
>> drivers/staging/nvec/nvec_paz00.c    |  1 -
>> 3 files changed, 9 insertions(+), 23 deletions(-)
>> 
>> diff --git a/drivers/staging/nvec/nvec-keytable.h
>> b/drivers/staging/nvec/nvec-keytable.h index 1dc22cb..9f369d5 100644
>> --- a/drivers/staging/nvec/nvec-keytable.h
>> +++ b/drivers/staging/nvec/nvec-keytable.h
>> @@ -6,19 +6,6 @@
>>  *
>>  * Copyright (c) 2009, NVIDIA Corporation.
>>  *
>> - * This program is free software; you can redistribute it and/or modify
>> - * it under the terms of the GNU General Public License as published by
>> - * the Free Software Foundation; either version 2 of the License, or
>> - * (at your option) any later version.
>> - *
>> - * 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, write to the Free Software Foundation, Inc.,
>> - * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
>>  */
>> 
>> static unsigned short code_tab_102us[] = {
>> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
>> index c335ae2..03dbc09 100644
>> --- a/drivers/staging/nvec/nvec.c
>> +++ b/drivers/staging/nvec/nvec.c
>> @@ -1,4 +1,4 @@
>> -/*
>> +2/*
> 
> stray "2"
> 
>>  * NVEC: NVIDIA compliant embedded controller interface
>>  *
>>  * Copyright (C) 2011 The AC100 Kernel Team <ac100@xxxxxxxxxxxxxxxxxx>
>> @@ -264,7 +264,7 @@ int nvec_write_async(struct nvec_chip *nvec, const
>> unsigned char *data,
>> 
>> 	msg = nvec_msg_alloc(nvec, NVEC_MSG_TX);
>> 
>> -	if (msg == NULL)
>> +	if (!msg)
>> 		return -ENOMEM;
>> 
>> 	msg->data[0] = size;
>> @@ -620,7 +620,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>> 		} else {I had sent a patch for the staging nvec driver. It had some
> checkpatch
> 
>> 			nvec->rx = nvec_msg_alloc(nvec, NVEC_MSG_RX);
>> 			/* Should not happen in a normal world */
>> -			if (unlikely(nvec->rx == NULL)) {
>> +			if (unlikely(!nvec->rx)) {
>> 				nvec->state = 0;
>> 				break;
>> 			}
>> @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>> 		break;
>> 	case 2:		/* first byte after command */
>> 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
>> -			udelay(33);
>> +			usleep_range(32, 33);
>> 			if (nvec->rx->data[0] != 0x01) {
>> 				dev_err(nvec->dev,
>> 					"Read without prior read command\n");
>> @@ -641,11 +641,11 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>> 			nvec_msg_free(nvec, nvec->rx);
>> 			nvec->state = 3;
>> 			nvec_tx_set(nvec);
>> -			BUG_ON(nvec->tx->size < 1);
>> +			WARN_ON(nvec->tx->size < 1);
>> 			to_send = nvec->tx->data[0];
>> 			nvec->tx->pos = 1;
>> 		} else if (status == (I2C_SL_IRQ)) {
>> -			BUG_ON(nvec->rx == NULL);
>> +			WARN_ON(!nvec->rx);
>> 			nvec->rx->data[1] = received;
>> 			nvec->rx->pos = 2;
>> 			nvec->state = 4;
> 
> 
> Laura Garcia Liebana <nevola@xxxxxxxxx> sent a a fix for this a few days ago.
> So please remove this hunk.
> 
>> @@ -663,8 +663,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>> 		} else {
>> 			dev_err(nvec->dev, "tx buffer underflow on %p (%u > %u)\n",
>> 				nvec->tx,
>> -				(uint) (nvec->tx ? nvec->tx->pos : 0),
>> -				(uint) (nvec->tx ? nvec->tx->size : 0));
>> +				(uint)(nvec->tx ? nvec->tx->pos : 0),
>> +				(uint)(nvec->tx ? nvec->tx->size : 0));
>> 			nvec->state = 0;
>> 		}
>> 		break;
>> @@ -719,7 +719,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>> 	 * We experience less incomplete messages with this delay than without
>> 	 * it, but we don't know why. Help is appreciated.
>> 	 */
>> -	udelay(100);
>> +	usleep_range(99, 100);
>> 
>> 	return IRQ_HANDLED;
>> }
>> diff --git a/drivers/staging/nvec/nvec_paz00.c
>> b/drivers/staging/nvec/nvec_paz00.c index cddbfd2..51dbeeb 100644
>> --- a/drivers/staging/nvec/nvec_paz00.c
>> +++ b/drivers/staging/nvec/nvec_paz00.c
>> @@ -41,7 +41,6 @@ static void nvec_led_brightness_set(struct led_classdev
>> *led_cdev, nvec_write_async(led->nvec, buf, sizeof(buf));
>> 
>> 	led->cdev.brightness = value;
>> -
>> }
>> 
>> static int nvec_paz00_probe(struct platform_device *pdev)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux