OSDN Git Service

PCI: rcar: Replace (8 * n) with (BITS_PER_BYTE * n)
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Mon, 25 Mar 2019 11:40:59 +0000 (12:40 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 4 Apr 2019 10:48:58 +0000 (11:48 +0100)
Replace (8 * n) with (BITS_PER_BYTE * n) to make bit shift operations
consistent. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
drivers/pci/controller/pcie-rcar.c

index 6699211..9621076 100644 (file)
@@ -170,7 +170,7 @@ enum {
 
 static void rcar_rmw32(struct rcar_pcie *pcie, int where, u32 mask, u32 data)
 {
-       unsigned int shift = 8 * (where & 3);
+       unsigned int shift = BITS_PER_BYTE * (where & 3);
        u32 val = rcar_pci_read_reg(pcie, where & ~3);
 
        val &= ~(mask << shift);
@@ -180,7 +180,7 @@ static void rcar_rmw32(struct rcar_pcie *pcie, int where, u32 mask, u32 data)
 
 static u32 rcar_read_conf(struct rcar_pcie *pcie, int where)
 {
-       unsigned int shift = 8 * (where & 3);
+       unsigned int shift = BITS_PER_BYTE * (where & 3);
        u32 val = rcar_pci_read_reg(pcie, where & ~3);
 
        return val >> shift;
@@ -280,9 +280,9 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
        }
 
        if (size == 1)
-               *val = (*val >> (8 * (where & 3))) & 0xff;
+               *val = (*val >> (BITS_PER_BYTE * (where & 3))) & 0xff;
        else if (size == 2)
-               *val = (*val >> (8 * (where & 2))) & 0xffff;
+               *val = (*val >> (BITS_PER_BYTE * (where & 2))) & 0xffff;
 
        dev_dbg(&bus->dev, "pcie-config-read: bus=%3d devfn=0x%04x where=0x%04x size=%d val=0x%08lx\n",
                bus->number, devfn, where, size, (unsigned long)*val);
@@ -308,11 +308,11 @@ static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
                bus->number, devfn, where, size, (unsigned long)val);
 
        if (size == 1) {
-               shift = 8 * (where & 3);
+               shift = BITS_PER_BYTE * (where & 3);
                data &= ~(0xff << shift);
                data |= ((val & 0xff) << shift);
        } else if (size == 2) {
-               shift = 8 * (where & 2);
+               shift = BITS_PER_BYTE * (where & 2);
                data &= ~(0xffff << shift);
                data |= ((val & 0xffff) << shift);
        } else