From patchwork Sat Dec 23 19:19:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 183004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1832154dyi; Sat, 23 Dec 2023 11:20:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHw4KB6U3Inwf/sh4LWnD7KnkeRNg5UGp/60RoCMHo0pp9qJAd9lME5IgAL2pyLYyW6svHr X-Received: by 2002:a05:6a20:8407:b0:194:eeec:dd82 with SMTP id c7-20020a056a20840700b00194eeecdd82mr3864730pzd.57.1703359217280; Sat, 23 Dec 2023 11:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703359217; cv=none; d=google.com; s=arc-20160816; b=r/6RgCcXwV749tLO+1rpEt6yGx8Uvzj1sADFM6vwNQbdHeaEn9MNSwmXmuTYN2CJq7 UP+PhgAXggEiIhB9Y0mqKZbOOplSZFpa6tq9T+C2PQB3pVbxtBRzWZX1+RegdUxNIS3l u2NMqYn7cgilWAO3lYcL76VE38OmQJTzWo495ahsgyxfFmrAmO5rwOWManyCjzL7kwBF ds2r3XZ4mP1wMmua1IwcicVXgq7/r/Mk7Grx8786FeFCS5I5WTHxhAE37vC4agGab71B 8ivkfy0BGWSNrQm1LemKcy48ujKVfKsxoo5tzdKXSYp1JJBD+C4ef7qLk6HD/I4tLdtm tHLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=dl+++DRdm00PXx9jJ+9cB6WjPEZdIF4coFJBY+INy5g=; fh=VTTLm5iX+TgTRpe7v682Hh7Pu+c4rAJLVB17hA5Ge0k=; b=Dy60XHq+b11HHYzEIsZS6zKRqZSGkCP/FF4+Xf1vdXPJtnRHIVkixsqb8GQQ2fAg1o GdlsNq07XInVXl8lrS+Lv/dAmU7qC1g6T/U+9i/MhzWxEkJ0PvMqs7IKAZB9B/A1+w+c 26HzkWzGf3PK4v+tO7OYmWZcepeLRRMVTwFNqRDo7Y/XATMmslRoDfNWQAyK+IfSpNNr 5SBdiPWm1Kqbp8+/5MIIGz129i95ZInc+Po28BU3SQ8KZW3yQ5TnIErWuzStJJTsT7LW E5SdRWAH5DGlmmKmifWhexjDNd7QQLD0WJ35atbevQkG5POvk991pX05dKnXoxXQ5J7m Bd9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gH582sO3; spf=pass (google.com: domain of linux-kernel+bounces-10562-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j12-20020a63e74c000000b00578b487825asi5259230pgk.208.2023.12.23.11.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 11:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10562-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gH582sO3; spf=pass (google.com: domain of linux-kernel+bounces-10562-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3AE00B21442 for ; Sat, 23 Dec 2023 19:19:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F28515EB7; Sat, 23 Dec 2023 19:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gH582sO3" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5D8A1401B for ; Sat, 23 Dec 2023 19:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a1915034144so346792966b.0 for ; Sat, 23 Dec 2023 11:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703359145; x=1703963945; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=dl+++DRdm00PXx9jJ+9cB6WjPEZdIF4coFJBY+INy5g=; b=gH582sO3vvVGnFqahMl7hOz6g6iud0pu0gXIXakkJCQbwX+oXD/uuKt6ZmokPVpTaX Vkp44aWlEGPwPrhQ8VavKUaDZ7vRMExPSLIDU2CSBa5mGFZ4bbaVOxvZ1BOybHUtxLbP c4JIyU/Ev+JK0RDmWmw6iVRo8xUfk9uWugxlSR+2gbGV4LdLo9TkOJM2nD5KP2ibZcdA Sr5Yspfcr69UxE607bDNJuL7UAG0VhFTqe6Ry0FeodVyk03tluTQjj9YfTay363BXrPc ebbsgM8k9j1F0GBvLHjdHNwumYjMlVKXBZbyUA7b8cr3oZlX3fED95vpZhQIc8Ln2Pga psKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703359145; x=1703963945; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dl+++DRdm00PXx9jJ+9cB6WjPEZdIF4coFJBY+INy5g=; b=AsgnTgMgdhovoZ86bSdlekGcxi6IKO6ZK1ZwusP7BEyLIZt+wQ0OS4kDRT3XQ32Pt/ VLxT1koMip8kQnAIMkeK6iN4UE4J/6caZxoNpZVoAMDlJv+iDWIYPZBU6lx/8XGuu5E3 Ar4dR6ZLpV+y9Y7N94SMm/KtpNk5ZMUjsW/Sh4J49b+KPjejAJxb/wWbVOPO9DRvJf5I /Rw3BE4UKcvguVS7xoar5smEYn1bpqTUQemBj/E6UMUYSP2VKXkbU9BgUwQhz2aGv/yE +rVqsZoLvj2U8ouSH8FIyBupKWUZEMfdaulHwl3x6yiexvsQyMLp7BLOFu/rQ4I6VEhZ Ot5Q== X-Gm-Message-State: AOJu0YzOTVYS7cPSYdqDVfmIxLAeBtxRKfybcZe4Fl0bmg0sbadpUZ9V K6Jph6Sku+A5ScKGuM/aB3y1jR4o55jmqg== X-Received: by 2002:a17:906:364d:b0:a23:3399:31c4 with SMTP id r13-20020a170906364d00b00a23339931c4mr1621067ejb.120.1703359145101; Sat, 23 Dec 2023 11:19:05 -0800 (PST) Received: from krzk-bin.. ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id cl2-20020a170906c4c200b00a19afc16d23sm3278613ejb.104.2023.12.23.11.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 11:19:04 -0800 (PST) From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Alim Akhtar , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: samsung: constify iomem pointers Date: Sat, 23 Dec 2023 20:19:02 +0100 Message-Id: <20231223191902.22857-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786101594981740764 X-GMAIL-MSGID: 1786101594981740764 Constify few pointers to iomem, where the destination memory is not modified, for code safety and readability. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Linus Walleij --- drivers/pinctrl/samsung/pinctrl-exynos.c | 4 ++-- drivers/pinctrl/samsung/pinctrl-samsung.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index d3d4b5d036c8..871c1eb46ddf 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -693,7 +693,7 @@ static void exynos_pinctrl_suspend_bank( struct samsung_pin_bank *bank) { struct exynos_eint_gpio_save *save = bank->soc_priv; - void __iomem *regs = bank->eint_base; + const void __iomem *regs = bank->eint_base; save->eint_con = readl(regs + EXYNOS_GPIO_ECON_OFFSET + bank->eint_offset); @@ -714,7 +714,7 @@ static void exynosauto_pinctrl_suspend_bank(struct samsung_pinctrl_drv_data *drv struct samsung_pin_bank *bank) { struct exynos_eint_gpio_save *save = bank->soc_priv; - void __iomem *regs = bank->eint_base; + const void __iomem *regs = bank->eint_base; save->eint_con = readl(regs + bank->pctl_offset + bank->eint_con_offset); save->eint_mask = readl(regs + bank->pctl_offset + bank->eint_mask_offset); diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index dbf38767f15f..ed07e23e0912 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -565,7 +565,7 @@ static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value) /* gpiolib gpio_get callback function */ static int samsung_gpio_get(struct gpio_chip *gc, unsigned offset) { - void __iomem *reg; + const void __iomem *reg; u32 data; struct samsung_pin_bank *bank = gpiochip_get_data(gc); const struct samsung_pin_bank_type *type = bank->type; @@ -1204,7 +1204,7 @@ static int __maybe_unused samsung_pinctrl_suspend(struct device *dev) for (i = 0; i < drvdata->nr_banks; i++) { struct samsung_pin_bank *bank = &drvdata->pin_banks[i]; - void __iomem *reg = bank->pctl_base + bank->pctl_offset; + const void __iomem *reg = bank->pctl_base + bank->pctl_offset; const u8 *offs = bank->type->reg_offset; const u8 *widths = bank->type->fld_width; enum pincfg_type type;