diff mbox series

[v2,7/7] PCI/sysfs: Update code to match the preferred style

Message ID 20210910202623.2293708-8-kw@linux.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Convert dynamic PCI resources sysfs objects into static | expand

Commit Message

Krzysztof Wilczyński Sept. 10, 2021, 8:26 p.m. UTC
Update code to match the preferred style while making the bitwise
operations less ambiguous with added extra parentheses surrounding the
expression.

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/pci-sysfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 17535f4028af..fdfe4aa70875 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1013,7 +1013,7 @@  int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma,
 	unsigned long nr, start, size;
 	resource_size_t pci_start = 0, pci_end;
 
-	if (pci_resource_len(pdev, resno) == 0)
+	if (!pci_resource_len(pdev, resno))
 		return 0;
 	nr = vma_pages(vma);
 	start = vma->vm_pgoff;
@@ -1055,13 +1055,13 @@  static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr,
 	    ((res->flags & IORESOURCE_IO) && arch_can_pci_mmap_io())))
 		return -EIO;
 
-	if (res->flags & IORESOURCE_MEM && iomem_is_exclusive(res->start))
+	if ((res->flags & IORESOURCE_MEM) && iomem_is_exclusive(res->start))
 		return -EINVAL;
 
 	if (!pci_mmap_fits(pdev, bar, vma, PCI_MMAP_SYSFS))
 		return -EINVAL;
 
-	mmap_type = res->flags & IORESOURCE_MEM ? pci_mmap_mem : pci_mmap_io;
+	mmap_type = (res->flags & IORESOURCE_MEM) ? pci_mmap_mem : pci_mmap_io;
 
 	return pci_mmap_resource_range(pdev, bar, vma, mmap_type, write_combine);
 }