From patchwork Tue Jul 11 10:48:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9834423 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A03DD60393 for ; Tue, 11 Jul 2017 10:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 912CB26861 for ; Tue, 11 Jul 2017 10:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85DD0283FD; Tue, 11 Jul 2017 10:49:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27C06283F9 for ; Tue, 11 Jul 2017 10:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932613AbdGKKtX (ORCPT ); Tue, 11 Jul 2017 06:49:23 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33726 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbdGKKtU (ORCPT ); Tue, 11 Jul 2017 06:49:20 -0400 Received: by mail-pf0-f196.google.com with SMTP id e199so18501038pfh.0; Tue, 11 Jul 2017 03:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t/NEPzm6USTZEw2vKnh6OuY/0rvZ9HXpkg/PL1NaQvc=; b=X01UV19oPDqQzdg2xICdgiJegFro8hd7z6mouASdRWr3ruR6YOHHl1CxIJOML73Vdg Lm1Qf04G1GNyI3WaC9O6Pmj3DvW8nv+DH1KjXAqXdoUgWyylcwGqgXC8IpaUjUrBj25I E91HtnG4eXYTCVh/kE3WRI7SR0lHG61gVvB+/ApcUQtbRDY50W5chOnnhDq4Iq3fFNHq 0WRYw5lplEq1XhXp1tAJuKYKU9BtSHBTFKPQt6t5mMRbHH79PK2rBV6nKYl9GJsnCoSf lVNYxWvor+TVvoogXptXTp30j3B64bhipIUc/hfURvmtjnEVzl++bphrrerlPreKFJaN uS1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t/NEPzm6USTZEw2vKnh6OuY/0rvZ9HXpkg/PL1NaQvc=; b=h9kL/F4eKTfNLf+hXY30kXnDfxqCZrmxiuWunwtOCLWUFAEbjqyGxy8mqagb8hhouc Dg3/MFgTyZ0CaNDXOAVnAevLTKx4okiRngxvWCby9p+F86hpr+AXaMPYJwwzy0/pX9SC IZ2/OIBpYHf1OhzS2opNgpd7SOOGF1kDOzLBCeWJwUP2fkhrD07rsynIUhnITnCOzyq1 7BnqDtm3LrVf5YTk1yEIVjMdE1ThUlCeiUCGEMOn5vRp2scOi4kU1m9jW4f4y0ymEq02 iEykXB8ljdJoD4osa03YDuJ0PqV8ExXEVMPa03OjkzftFMthI3a/e3MP3BMU/XFAVf7w GLiQ== X-Gm-Message-State: AIVw111/kM+xy2Q/EVGytUI4DCtpm3M2YPrSwPSz9JQUnN1R8nF7Iwiw 0JxIsqhps82v7g== X-Received: by 10.98.160.28 with SMTP id r28mr49783939pfe.86.1499770150137; Tue, 11 Jul 2017 03:49:10 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id r207sm29656163pfr.106.2017.07.11.03.49.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 03:49:09 -0700 (PDT) From: Arvind Yadav To: dvhart@infradead.org, andy@infradead.org, jwoithe@just42.net, cezary.jackiewicz@gmail.com, corentin.chary@gmail.com, laforge@gnumonks.org, coproscefalo@gmail.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] platform/x86: asus-wmi: constify attribute_group structures. Date: Tue, 11 Jul 2017 16:18:19 +0530 Message-Id: <1499770100-18632-7-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499770100-18632-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1499770100-18632-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 13140 840 1 13981 369d drivers/platform/x86/asus-wmi.o File size After adding 'const': text data bss dec hex filename 13268 712 1 13981 368d drivers/platform/x86/asus-wmi.o Signed-off-by: Arvind Yadav --- drivers/platform/x86/asus-wmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 6c7d860..709e3a6 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1433,7 +1433,7 @@ static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj, return ok ? attr->mode : 0; } -static struct attribute_group hwmon_attribute_group = { +static const struct attribute_group hwmon_attribute_group = { .is_visible = asus_hwmon_sysfs_is_visible, .attrs = hwmon_attributes }; @@ -1821,7 +1821,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, return ok ? attr->mode : 0; } -static struct attribute_group platform_attribute_group = { +static const struct attribute_group platform_attribute_group = { .is_visible = asus_sysfs_is_visible, .attrs = platform_attributes };