Skip to content

Commit

Permalink
IDE: Deletion of an unnecessary check before the function call "modul…
Browse files Browse the repository at this point in the history
…e_put"

The module_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
elfring authored and davem330 committed Dec 12, 2014
1 parent 6ce4436 commit 1746fbe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ void ide_device_put(ide_drive_t *drive)
struct device *host_dev = drive->hwif->host->dev[0];
struct module *module = host_dev ? host_dev->driver->owner : NULL;

if (module)
module_put(module);
module_put(module);
#endif
put_device(&drive->gendev);
}
Expand Down

0 comments on commit 1746fbe

Please sign in to comment.