Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841AbdF3Ew3 (ORCPT ); Fri, 30 Jun 2017 00:52:29 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34439 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbdF3Ew2 (ORCPT ); Fri, 30 Jun 2017 00:52:28 -0400 From: Arvind Yadav To: rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, rafael.j.wysocki@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / sleep: constify attribute_group structures. Date: Fri, 30 Jun 2017 10:22:14 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 32 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. File size before: text data bss dec hex filename 3802 624 32 4458 116a kernel/power/main.o File size After adding 'const': text data bss dec hex filename 3866 560 32 4458 116a kernel/power/main.o Signed-off-by: Arvind Yadav --- kernel/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, }; -static struct attribute_group attr_group = { +static const struct attribute_group attr_group = { .attrs = g, }; -- 1.9.1