RE: [PATCH 00/42] staging: comedi: ni_660x: big driver cleanup

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

 



On Monday, March 21, 2016 8:39 AM, Ian Abbott wrote:
> On 18/03/16 19:38, H Hartley Sweeten wrote:
>> This driver has a lot of checkpatch.pl issues:
>> total: 0 errors, 71 warnings, 27 checks, 1222 lines checked
>>
>> There is also a lot of cruft that bloats the driver and makes it harder
>> to follow.
>>
>> This series fixes all the checkpatch.pl issues:
>> total: 0 errors, 0 warnings, 0 checks, 944 lines checked
>>
>> And, even better, removes the cruft:
>>
>>     text    data     bss     dec     hex filename
>>    10249     344       0   10593    2961 ni_660x.o.original
>>     4719     344       0    5063    13c7 ni_660x.o
>>

<snip>

> It all looks fine, apart from some breakage in patches 30 and 31 related 
> to the calls to ni_gpct_device_destroy().

Gah... Your correct.

I think ni_gpct_device_destroy() should be changed to:

void ni_gpct_device_destroy(struct ni_gpct_device *counter_dev)
{
-	if (!counter_dev->counters)
+	if (!counter_dev)
		return;
	kfree(counter_dev->counters);
	kfree(counter_dev);
}

Then the NULL checks can be removed from the drivers.

> I'm not entirely sure what  the memory barrier moved by patch 27 is
> for - it's probably redundant.

I'm not sure either. But having is after the spin_lock_irqsave() didn't
make any sense. 

ni_mio_common.c: ni_E_interrupt() has similar smp_mb() with a
comment so I made it the same here.

If you don't think they are necessary I don't have any issues with
removing them.

Hartley

_______________________________________________
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