From nobody Fri Sep 20 03:59:33 2024 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) (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 8CF0440848 for ; Sat, 29 Jun 2024 09:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719652852; cv=none; b=pgHkDuPfVD2HvqEaupehcUj9EYaays0Nda1oIGaikwbjrI/EY5kFn1uJL+GME85BYn4gpV6IHISIjsE/OzgUg+ry1RYvUOZA3ysBDuvxnVXfQtxgKD4BCHAstTb5JsGYgGU1kkX0csoItV12bTb3mfn/Vlbj9qoMhuiTlmG4ObQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719652852; c=relaxed/simple; bh=CTxytHPvfb/tbeM9qNcteLgnLzKj/8mD28sRHCoF43I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BBLWG9o7/G1NjvIlK45uKT7tBUzV5AfgBY0fsn0sNbd5EtAqHpl9ZKDXgHjR9+eCeuWvwKzZ+M/inuZjUXE0/70DxymUBK7RznhjE7vAAD4flVG69Oz4A6/MsNX9nFxL9pbX5fmy5x6wPP9BtP4vd/M1M3DvqVpyE7yO1SFyWvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=OH1Tl9Fy; arc=none smtp.client-ip=80.12.242.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="OH1Tl9Fy" Received: from fedora.home ([86.243.222.230]) by smtp.orange.fr with ESMTPA id NUF6sgiHDa7etNUFAs5cmx; Sat, 29 Jun 2024 11:19:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1719652781; bh=OIHS4bCoAp7XmybFd1o/p9MaqJ7r9GiTTKSXXLd53E0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OH1Tl9FyjuMMx4HmARLJfapnbS0a32MoPR7+1VKjwTwU/z6XOFxau1S89iYL0nNTG FBmWeDrhea0TeEX0Lu3xNN+0+z5QzKnFF3aBBNHRPrT/E00VFDlaW5O4ZXwzNbyEzq TyQP1fNOm9kdCMs8DIZ0layWZXx6TVXmXnO1mBiC7Za9+TXYpDgtRRjzd7bEgmz4XX NrSS1dMehyJOJil0dR+A+UvsYSQRVIHx19WOaEbgjoWuCKn8uVqx6s+2sDmXKye+Ol mPLW6ygkOlin0P//j7SV8OXiylbRcmevqxdEJDdFYLk+zzW6oxskgWmkU2OMgrZX3c hdk+E9mrdyNCQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 29 Jun 2024 11:19:41 +0200 X-ME-IP: 86.243.222.230 From: Christophe JAILLET To: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, fparent@baylibre.com, fchiby@baylibre.com, s.hauer@pengutronix.de Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/4] soc: mediatek: pwrap: Constify struct pmic_wrapper_type Date: Sat, 29 Jun 2024 11:19:30 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'struct pmic_wrapper_type' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 45336 8724 16 54076 d33c drivers/soc/mediatek/mtk-pmic-wrap.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 45528 8532 16 54076 d33c drivers/soc/mediatek/mtk-pmic-wrap.o Signed-off-by: Christophe JAILLET Reviewed-by: AngeloGioacchino Del Regno --- Compile tested-only --- drivers/soc/mediatek/mtk-pmic-wrap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mt= k-pmic-wrap.c index efd9cae212dc..0da0cdec5050 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2397,7 +2397,7 @@ static const struct pmic_wrapper_type pwrap_mt8183 = =3D { .init_soc_specific =3D pwrap_mt8183_init_soc_specific, }; =20 -static struct pmic_wrapper_type pwrap_mt8195 =3D { +static const struct pmic_wrapper_type pwrap_mt8195 =3D { .regs =3D mt8195_regs, .type =3D PWRAP_MT8195, .arb_en_all =3D 0x777f, /* NEED CONFIRM */ @@ -2423,7 +2423,7 @@ static const struct pmic_wrapper_type pwrap_mt8365 = =3D { .init_soc_specific =3D NULL, }; =20 -static struct pmic_wrapper_type pwrap_mt8516 =3D { +static const struct pmic_wrapper_type pwrap_mt8516 =3D { .regs =3D mt8516_regs, .type =3D PWRAP_MT8516, .arb_en_all =3D 0xff, @@ -2435,7 +2435,7 @@ static struct pmic_wrapper_type pwrap_mt8516 =3D { .init_soc_specific =3D NULL, }; =20 -static struct pmic_wrapper_type pwrap_mt8186 =3D { +static const struct pmic_wrapper_type pwrap_mt8186 =3D { .regs =3D mt8186_regs, .type =3D PWRAP_MT8186, .arb_en_all =3D 0xfb27f, --=20 2.45.2