Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2323598ybe; Tue, 3 Sep 2019 11:07:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEn5rZHjBXpBLDQ3q2AF6k3ZTDffZm6V1LtcIRoSO8wJW1Dn0eZj4sUDzvbu3Wo2lmFSMH X-Received: by 2002:a17:902:ab86:: with SMTP id f6mr17197197plr.15.1567534075029; Tue, 03 Sep 2019 11:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567534075; cv=none; d=google.com; s=arc-20160816; b=Pa9V2iK3fskfEIbS5CEZTLJ0UiHvN5nsdXrXO1L5aGRMyF/cbs21p/z3CsSH2Osk05 16Y23ky/vQd/bRMnPtBFdjI2GqV3hB7Vy6jJoJzrg782Esj8F7FGiFAL8GjWPd3WRl8P RLkwYs0Hiv4PvUTtFptXem6+UkVZn1MaFvhH2uHqp6KADOzB74bGP4m7bBk0FpJ0Qz3M 6LjXurodMQ16e21Yb+ZtDV7AVoMBhRW9d1sDIJgLwc0/g93Az54r/QObutts99vxeDWc +X41DVN4gteABeRZcnzEnezk2I6fK4jSsvaP47mqnkXx2tm2lnLgsbj0kAcfAVHfuHpn s9Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DBNyBaCBYG9TDGEcg8ueDvWPALVu223oxZxW50cqkZI=; b=ph3uGxaA7k5F+3k7cD7Y2J/CyUU92/yvOYXwAVIECpNEgg0F3nFdem31ypt+XX528c uGZS2kAA/HmUTCufBisvcFilz1zjQlngGRGQWpCTifMJVq58or19uQDxi12UrajGbh9e tNXwbI/NUhIqBuWhd9O5jWvc+b/arjribWvXGn7zPs6bgMGIetcAkjUzRBOT3ipGBLPt k94FIKGOTqkXhYkL4XHIOb/4k5CjiiSdhXwPpfdw62CoHtTJaLw3nMdiOTAy8jgiS6dD /b1uUJKrMgxivMqdNIA1A3zqfMqQwKhVHh0gqNNZwUSNIUFfCCtGGEEK/nh1EIvtgMgX rrkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si15503664pli.149.2019.09.03.11.07.39; Tue, 03 Sep 2019 11:07:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730118AbfICSFy (ORCPT + 99 others); Tue, 3 Sep 2019 14:05:54 -0400 Received: from sauhun.de ([88.99.104.3]:56744 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbfICSFy (ORCPT ); Tue, 3 Sep 2019 14:05:54 -0400 Received: from localhost (p54B3348D.dip0.t-ipconnect.de [84.179.52.141]) by pokefinder.org (Postfix) with ESMTPSA id 98A132C4F2F; Tue, 3 Sep 2019 20:05:52 +0200 (CEST) Date: Tue, 3 Sep 2019 20:05:52 +0200 From: Wolfram Sang To: Nishka Dasgupta Cc: pierre-yves.mordret@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-i2c@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: stm32f7: Make structure stm32f7_i2c_algo constant Message-ID: <20190903180552.GI2171@ninjato> References: <20190815055857.1944-1-nishkadg.linux@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jQIvE3yXcK9X9HBh" Content-Disposition: inline In-Reply-To: <20190815055857.1944-1-nishkadg.linux@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jQIvE3yXcK9X9HBh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 15, 2019 at 11:28:57AM +0530, Nishka Dasgupta wrote: > Static structure stm32f7_i2c_algo, of type i2c_algorithm, is used only > when it is assigned to constant field algo of a variable having type > i2c_adapter. As stm32f7_i2c_algo is therefore never modified, make it > const as well to protect it from unintended modification. > Issue found with Coccinelle. >=20 > Signed-off-by: Nishka Dasgupta > --- Are you guys okay with this patch? > drivers/i2c/busses/i2c-stm32f7.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-st= m32f7.c > index 266d1c269b83..d36cf08461f7 100644 > --- a/drivers/i2c/busses/i2c-stm32f7.c > +++ b/drivers/i2c/busses/i2c-stm32f7.c > @@ -1809,7 +1809,7 @@ static u32 stm32f7_i2c_func(struct i2c_adapter *ada= p) > I2C_FUNC_SMBUS_I2C_BLOCK; > } > =20 > -static struct i2c_algorithm stm32f7_i2c_algo =3D { > +static const struct i2c_algorithm stm32f7_i2c_algo =3D { > .master_xfer =3D stm32f7_i2c_xfer, > .smbus_xfer =3D stm32f7_i2c_smbus_xfer, > .functionality =3D stm32f7_i2c_func, > --=20 > 2.19.1 >=20 --jQIvE3yXcK9X9HBh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl1uq4AACgkQFA3kzBSg Kbb8bA/7Bzcu4H+4vy+pN5u7/6dvt9U1m+nVCt4vcisCCui7/eCm99H3yyDexyt0 XfsNaP3kRsliO6VzsxJYKLmKwuoFhmweI+nDH+fTBzVproQhzrlGjcr1N+ZF3uvp vYMOCk84pZZ8h7eAeQIxtw8FJKLX+1EOJJcG2w7APhQ+0YoJibSkz5yVasT1arNZ t9wOQQki7S2HLK09QRYP1urT7dIbRvkcaFM9HQMBZdcsOCSa3SdnL52YjLTbgA3K HAIt1QpAmbHanMgBOEM+FTDWSSWuZyea4t1oGBK21mHksjLP/+cmR8dUiRVkpEcU HuJRmRE2STSo0GE8c06fiYIhNPNHUPy7M2B5LmAvEbmj9uEjElbJuzCXmY6sh2ka NkQypuukYn9S3EdP6+zPCVgvdB3UxnuxhxX4exQiagOa4TsrXoPv/M85wQjU6h+k SebrMybbLsyr57zYG77zUQxQPUGopl3gAmQrXk4C0AGDgGrGZHn5rgOIi0CqkR8Y n2bgrd5sG04fLP0XrhFUeQFjXKBVAfAStse3VzHzt0GdXZ3FIbhyqn39982sM2xk MhLO4UCcFyc3ebtcqHIZIkM23QwO/FGhSiGmwVci8EPS174rlH7G9hMvXfuMWrgc uFx3t0vfZmx62RXhspKEEjsxe+/pGbtGOsJsRsEi4o96NRElfDw= =fdQf -----END PGP SIGNATURE----- --jQIvE3yXcK9X9HBh--