Skip to content

Commit

Permalink
pata_artop: Fix device ID parity check
Browse files Browse the repository at this point in the history
x % 1 always evaluates to 0, which clearly isn't the intent. The
author probably had "% 2" or "& 1" in mind, and mispelled it.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Jean Delvare authored and Jeff Garzik committed Sep 9, 2010
1 parent d56557a commit 673424c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/pata_artop.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline)
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

/* Odd numbered device ids are the units with enable bits (the -R cards) */
if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
if ((pdev->device & 1) &&
!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
return -ENOENT;

return ata_sff_prereset(link, deadline);
Expand Down

0 comments on commit 673424c

Please sign in to comment.