From patchwork Tue Jul 11 10:48:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9834427 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 C3BF760318 for ; Tue, 11 Jul 2017 10:50:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B62F726861 for ; Tue, 11 Jul 2017 10:50:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AACBD2842B; Tue, 11 Jul 2017 10:50:15 +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=unavailable 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 51CE026861 for ; Tue, 11 Jul 2017 10:50:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932559AbdGKKtL (ORCPT ); Tue, 11 Jul 2017 06:49:11 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33695 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbdGKKtI (ORCPT ); Tue, 11 Jul 2017 06:49:08 -0400 Received: by mail-pf0-f196.google.com with SMTP id e199so18500652pfh.0; Tue, 11 Jul 2017 03:49:08 -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=ISRKxDW6uTPsa+q8N8Kn85WM1VxaB/biizQDt+4g/j0=; b=f0+XXHQ0NYpTkQiJnCRLJzfrxYVprHHrAs5aZGfQObJHKtlPrVun6pnHH9unxkbPl9 5BMPVD6Z3jF/uRxf19PIDOD7c5vOO+5g89ltCNAIp4tEnThaoqoyLHEmLmiDdcEPWJbv HlqtSPfAUYiJnJigwYz1CiiFJd4onjv1sHYLGvJsb/K4gaZICzYXyCu2sJdnxjctX1GV iTpqAdkQ4ds9Ro00kaQ14gKRp16sGMXOZW63aPgrNW4o/NZ2+ajPAxZ60YMtEoqli9go x6iyVoSnpQOUq4j8GX2/OmymfnY9x984Qt88XmS5kLpna/5FgB59B2D+HFsKv02k3LOS 0Aug== 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=ISRKxDW6uTPsa+q8N8Kn85WM1VxaB/biizQDt+4g/j0=; b=jHdUM0mUWQIZNimVTwHi+d62Esk3jl43wUeYVMt+yxMWT/oi8/p/1ADKsNeocPkjZ0 ZE94/NAo4MdSTzC3f0UiMDoxgAWqVIc/p7q/L0PcLQu4vdulGnUW4ifmbVKpNCgcm5bl FzyoczPvoytN0bhs5y6u6WWa/r0BbRhk3Oakiyd+h5i0InwvZmGlzB0ZDtFZ9239DMZm 2Ls56X6SK2OGERRQBFhtOGjzAyB24H+TJ39Wlv/vTWFexhpIWFRj2ktYpa83y0mgu7Ai hyiF4F0vW2+DkPlY2Hywo4d+KEuP7L6pXab3orWoTrSaw7v1qisOfb/oRCYSdpxW/IyX th3g== X-Gm-Message-State: AIVw112Qr84tXD+U32lxj7h02ORyveACAtw9R3t1oC8r364BuqjhaFKP WzJtuGqWdvYumQ== X-Received: by 10.99.171.66 with SMTP id k2mr19696204pgp.248.1499770143140; Tue, 11 Jul 2017 03:49:03 -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.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 03:49:02 -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 4/7] platform/x86: alienware-wmi: constify attribute_group structures. Date: Tue, 11 Jul 2017 16:18:17 +0530 Message-Id: <1499770100-18632-5-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 6932 1016 48 7996 1f3c drivers/platform/x86/alienware-wmi.o File size After adding 'const': text data bss dec hex filename 7060 888 48 7996 1f64 drivers/platform/x86/alienware-wmi.o Signed-off-by: Arvind Yadav --- drivers/platform/x86/alienware-wmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c index 9866fec..0831b42 100644 --- a/drivers/platform/x86/alienware-wmi.c +++ b/drivers/platform/x86/alienware-wmi.c @@ -604,7 +604,7 @@ static DEVICE_ATTR(source, S_IRUGO | S_IWUSR, show_hdmi_source, NULL, }; -static struct attribute_group hdmi_attribute_group = { +static const struct attribute_group hdmi_attribute_group = { .name = "hdmi", .attrs = hdmi_attrs, }; @@ -660,7 +660,7 @@ static ssize_t show_amplifier_status(struct device *dev, NULL, }; -static struct attribute_group amplifier_attribute_group = { +static const struct attribute_group amplifier_attribute_group = { .name = "amplifier", .attrs = amplifier_attrs, }; @@ -741,7 +741,7 @@ static ssize_t toggle_deepsleep(struct device *dev, NULL, }; -static struct attribute_group deepsleep_attribute_group = { +static const struct attribute_group deepsleep_attribute_group = { .name = "deepsleep", .attrs = deepsleep_attrs, };