Skip to content

Commit

Permalink
ata: libata-sff: make ata_resources_present() return 'bool'
Browse files Browse the repository at this point in the history
ata_resources_present() returns 1 if the primary/secondary channel's PCI
resources are present,  0 if not -- the 'bool' type fits somewhat better
here than 'int'...

Use the *= operator, while at it...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
  • Loading branch information
Sergey Shtylyov authored and Damien Le Moal committed Feb 19, 2022
1 parent 25d83f9 commit b51aa53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,18 +2174,18 @@ EXPORT_SYMBOL_GPL(ata_sff_std_ports);

#ifdef CONFIG_PCI

static int ata_resources_present(struct pci_dev *pdev, int port)
static bool ata_resources_present(struct pci_dev *pdev, int port)
{
int i;

/* Check the PCI resources for this channel are enabled */
port = port * 2;
port *= 2;
for (i = 0; i < 2; i++) {
if (pci_resource_start(pdev, port + i) == 0 ||
pci_resource_len(pdev, port + i) == 0)
return 0;
return false;
}
return 1;
return true;
}

/**
Expand Down

0 comments on commit b51aa53

Please sign in to comment.