Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbdF3Ghj (ORCPT ); Fri, 30 Jun 2017 02:37:39 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39149 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbdF3Ghi (ORCPT ); Fri, 30 Jun 2017 02:37:38 -0400 Date: Fri, 30 Jun 2017 08:37:36 +0200 From: Pavel Machek To: Arvind Yadav Cc: rjw@rjwysocki.net, len.brown@intel.com, rafael.j.wysocki@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / sleep: constify attribute_group structures. Message-ID: <20170630063736.GA2675@amd> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1728 Lines: 60 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2017-06-30 10:22:14, Arvind Yadav wrote: > attribute_groups are not supposed to change at runtime. All functions > working with attribute_groups provided by work with const > attribute_group. So mark the non-const structs as const. >=20 > File size before: > text data bss dec hex filename > 3802 624 32 4458 116a kernel/power/main.o >=20 > File size After adding 'const': > text data bss dec hex filename > 3866 560 32 4458 116a kernel/power/main.o >=20 > Signed-off-by: Arvind Yadav Acked-by: Pavel Machek > --- > kernel/power/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/kernel/power/main.c b/kernel/power/main.c > index d401c21..42bd800 100644 > --- a/kernel/power/main.c > +++ b/kernel/power/main.c > @@ -705,7 +705,7 @@ static ssize_t pm_freeze_timeout_store(struct kobject= *kobj, > NULL, > }; > =20 > -static struct attribute_group attr_group =3D { > +static const struct attribute_group attr_group =3D { > .attrs =3D g, > }; > =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAllV8bAACgkQMOfwapXb+vLjhgCfalwxu8zlfvHUqAW4DVB4uJii d1oAn1LGHXHcnVHwED+T3qrFBI1ZI2Au =A7e2 -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--