Bug 80401

Summary: ata/pata_ep93xx.c:929: poor error checking ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: normal CC: andrey_utkin
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.16-rc5 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-07-16 20:24:02 UTC
[linux-3.16-rc5/drivers/ata/pata_ep93xx.c:929]: (style) Checking if unsigned variable 'irq' is less than zero.

Source code is

    irq = platform_get_irq(pdev, 0);
    if (irq < 0) {

but

    unsigned int irq;

$ fgrep platform_get_irq `find . -name \*.h -print`
./include/linux/platform_device.h:extern int platform_get_irq(struct platform_device *, unsigned int);

Suggest read return value from platform_get_irq into
a signed variable and test that.
Comment 1 Andrey Utkin 2014-07-17 12:20:27 UTC
Thanks, patch submitted: https://patchwork.kernel.org/patch/4574831/