From patchwork Sat Mar 23 01:53:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 10866709 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 225EC1515 for ; Sat, 23 Mar 2019 01:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A9832A528 for ; Sat, 23 Mar 2019 01:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E93232A551; Sat, 23 Mar 2019 01:54:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 877D32A503 for ; Sat, 23 Mar 2019 01:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728240AbfCWByS (ORCPT ); Fri, 22 Mar 2019 21:54:18 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38231 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728208AbfCWByR (ORCPT ); Fri, 22 Mar 2019 21:54:17 -0400 Received: by mail-wr1-f67.google.com with SMTP id g12so4205834wrm.5; Fri, 22 Mar 2019 18:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hHRXoXedoFz32Oq9DJvcczdt4Z6N3+3d7M9GXrlyl8Y=; b=MAc9PHecybfIfu+F2guxsZemYhXIfaDQ3l/E/5IaeACvqQbxP+meJlsZwSq18mG9an sQw0mY1i40fDyO1Hv2e5488/s3mSnTezG4fKjMlPxYBzqOgAYg7PlZoUUlUH5REZMb8N CgxAG9dleiPZItyFLIDJ5JtlUMaSmMCpLLS0ZxCxU/yQqOo7Ry/QoCWb0wxK+WtOnEye 6QtYi+t8xKEC/BaVtUc6FxCn3wNbKn2tIWG5rfvgsMbgLjE9LOVPZcp+JK7Scl13am2g 00cRlolV1UAthkOZybym/j25CsHLv1+HAYOEGHFHJyxsz6gkkPx7vCii5pUGaLt/4kwk h0YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hHRXoXedoFz32Oq9DJvcczdt4Z6N3+3d7M9GXrlyl8Y=; b=XQm5lIK047mNqFqTT/rGVrsZPN8xoiL0I7XG5qLOPPFjLes9h24edrjkTseKuvjsJc Fm7TH1lqQd8sDRerjWUWkI10WBTQusJwYfWMAI9lMo6gLhvCrFJ3VKLdxZ/HEhj/EU8S Fm/u9MyQKynTYP0CF+tZBnKw4Wyt/TwKOTg+YJcEASHystbZ1vM5rUzN2ciZqaTmvJHk IST4brioZWxg/IHKtaIR5uWIejnYTOefb8/XRvfrZgf/7L62KgO/95I/nnRM1RPkJOgr Ld/KqcbAK9Ap/ZrpxVYX+kyN46ZQb4UyqydtOf45zyWgzoh+N0GMJlExvvuW6f15OCA/ DEjw== X-Gm-Message-State: APjAAAWkG8qUkSlFVGC9yMkUPulK0pQOi8XPUjNttZMYG8jAOM+kO+Ah wPTgi7yxzHB1G1afADqsOCFyg+wi X-Google-Smtp-Source: APXvYqwZrYb+gU+aKbINElN/4hRcNKDcVEKjHPHSe6FGdCdzCtu0PM05rniKxw+kc0qauMEmsrlEYQ== X-Received: by 2002:a5d:4a87:: with SMTP id o7mr3826776wrq.306.1553306055524; Fri, 22 Mar 2019 18:54:15 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-110-70.net.upcbroadband.cz. [86.49.110.70]) by smtp.gmail.com with ESMTPSA id y192sm25433050wmc.6.2019.03.22.18.54.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Mar 2019 18:54:14 -0700 (PDT) From: marek.vasut@gmail.com To: linux-pci@vger.kernel.org Cc: Marek Vasut , Geert Uytterhoeven , Phil Edworthy , Simon Horman , Wolfram Sang , linux-renesas-soc@vger.kernel.org, Wolfram Sang Subject: [PATCH V3 4/6] PCI: rcar: Replace (8 * n) with (n << 3) Date: Sat, 23 Mar 2019 02:53:57 +0100 Message-Id: <20190323015359.7231-4-marek.vasut@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190323015359.7231-1-marek.vasut@gmail.com> References: <20190323015359.7231-1-marek.vasut@gmail.com> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marek Vasut Replace (8 * n) with (n << 3) to make bit shift operations consistent. No functional change. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Phil Edworthy Cc: Simon Horman Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org To: linux-pci@vger.kernel.org Reviewed-by: Wolfram Sang --- V2: Bundle this patch with other cleanups before resending V3: Add Wolfram's R-B --- drivers/pci/controller/pcie-rcar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c index a2d3855b15ea..f835e4341590 100644 --- a/drivers/pci/controller/pcie-rcar.c +++ b/drivers/pci/controller/pcie-rcar.c @@ -169,7 +169,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 = (where & 3) << 3; u32 val = rcar_pci_read_reg(pcie, where & ~3); val &= ~(mask << shift); @@ -179,7 +179,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 = (where & 3) << 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 >> ((where & 3) << 3)) & 0xff; else if (size == 2) - *val = (*val >> (8 * (where & 2))) & 0xffff; + *val = (*val >> ((where & 2) << 3)) & 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 = (where & 3) << 3; data &= ~(0xff << shift); data |= ((val & 0xff) << shift); } else if (size == 2) { - shift = 8 * (where & 2); + shift = (where & 2) << 3; data &= ~(0xffff << shift); data |= ((val & 0xffff) << shift); } else