From patchwork Wed Jul 5 10:46:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9826331 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 C696560237 for ; Wed, 5 Jul 2017 10:47:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A828E2844B for ; Wed, 5 Jul 2017 10:47:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95B3622A68; Wed, 5 Jul 2017 10:47:06 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 305FA28433 for ; Wed, 5 Jul 2017 10:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751743AbdGEKrF (ORCPT ); Wed, 5 Jul 2017 06:47:05 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34885 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbdGEKrE (ORCPT ); Wed, 5 Jul 2017 06:47:04 -0400 Received: by mail-pg0-f65.google.com with SMTP id d193so12941234pgc.2; Wed, 05 Jul 2017 03:47:03 -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; bh=WjakJ+sBmX4omgV2sLPo82b5yn36QiJlHuLbTMSGy6c=; b=uFPscO1bAgd41VErdfocaJjIWE5786bCGPs86C7OsCxTcHhy9K06T2yYiWGkV1Zunk pgYqnqqH2/G2hgKdymDx1Q3CSmMUx1k1jUu1go5TAePjAQySE9VLCd7lKQdxFpOrqqBO Si8X6CdBlYaYMw4b9C9owqODiXleJnuyhtCMGgfpyQIkxOnaxSflyFxmxIUdyUoG7aDT ZayGbvtfrlLgmhkDYIInuIODNcYPzBOOONpOmFljYDzSYUXwEisYJnVR1ZThoo4Zwa1S 7MAmZNprxQOPuB9Ey6gXkXW+m/5KnoOpOGWMfl2uJTlhd7yarjvA3vqVGujZQitZ6GKF /bBA== 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; bh=WjakJ+sBmX4omgV2sLPo82b5yn36QiJlHuLbTMSGy6c=; b=YQu8L/1/r5kHBuPPkewo3JE3Wlj0DtnP/gStFtXMJKzbTYENDPSH1nPWA78zTld6Ng zdBgkJL2z2n5VpGFGUA3oQJBqrsg+rt/KfDb/1K4fA0sUBgC6WUpy0VuZ+OEfNqi/Reg FPEsdCHgS8n9lrD4htKiCmDiYSq9hLKGFEAQrAfEQmS54QjCLcomDHVLuTWb7boTL8Uj yDhBIHG3JlXWGKLwDEG0vIiVy4KhzvcqSXGCy5PhKwWWV0IVslKqeBEBPN3zdxOv+IcZ h2OnhJfgLwLiPD1c4Lkh68PW3TKPYDWSVca7yBZ36oC6mqiO8vuL5au4UErNk1AvtIlG T/MQ== X-Gm-Message-State: AIVw110i/HQf5Ja5gRXzvCnGv1vZWfpR9YivM4zv7dkNyp5u6WG0YSHa zPzlxwNmJb9J0g== X-Received: by 10.99.177.78 with SMTP id g14mr20807942pgp.131.1499251623484; Wed, 05 Jul 2017 03:47:03 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id p11sm43429190pfk.128.2017.07.05.03.47.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Jul 2017 03:47:02 -0700 (PDT) From: Arvind Yadav To: dmitry.torokhov@gmail.com, geert+renesas@glider.be, linus.walleij@linaro.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input: keyboard: constify attribute_group structures. Date: Wed, 5 Jul 2017 16:16:46 +0530 Message-Id: <5c9063817d021c487f3429a4fee60fa84e0e93d6.1499251467.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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 5693 464 0 6157 180d drivers/input/keyboard/gpio_keys.o File size After adding 'const': text data bss dec hex filename 5749 400 0 6149 1805 drivers/input/keyboard/gpio_keys.o Signed-off-by: Arvind Yadav Acked-by: Linus Walleij --- drivers/input/keyboard/gpio_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index da3d362..55cf8aa 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -352,7 +352,7 @@ static DEVICE_ATTR(disabled_switches, S_IWUSR | S_IRUGO, NULL, }; -static struct attribute_group gpio_keys_attr_group = { +static const struct attribute_group gpio_keys_attr_group = { .attrs = gpio_keys_attrs, };