From patchwork Wed Jul 5 10:15:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9826263 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 0D68B60317 for ; Wed, 5 Jul 2017 10:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2BEE27F7F for ; Wed, 5 Jul 2017 10:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E60AE2808F; Wed, 5 Jul 2017 10:15:47 +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 9673A27F7F for ; Wed, 5 Jul 2017 10:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbdGEKPq (ORCPT ); Wed, 5 Jul 2017 06:15:46 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33308 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772AbdGEKPp (ORCPT ); Wed, 5 Jul 2017 06:15:45 -0400 Received: by mail-pf0-f196.google.com with SMTP id e199so34747618pfh.0; Wed, 05 Jul 2017 03:15:45 -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=xfTFytdKYgOZt9/m4PLf1HpSJQGPgcjtfliaBLuPy34=; b=QAT3c4gfl/kQAWQRPB7BSGhMh0yZOKCVZUbdm2ia3CEDl7cXnfG5jX5XyvPkUcYNmr wexevNykXN5OndITs3JG0VQrtkxJU5VrGz2f47svdbe8yPDPz2cnhQ2MpmdzQpDHPbPR 5xaDyfwC9S0R6U0PxmG99Qkqeif5KO8zBoWYDjlQSE20ijPu8QXTUCbQoaPPAYlijT+7 EYBw/7d9pNZsWLhH2rah5rwo9RKNTRh94ODG5McicMThKeOv0XvSaUHD2oCjPKAW9maV NbLMSGgSNudzQcyZ8VrmmS6MihtdKmTJ+xsvnSYiI6scTkEKozGzr1JwZCSc/bk1ntjt Rwmw== 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=xfTFytdKYgOZt9/m4PLf1HpSJQGPgcjtfliaBLuPy34=; b=lGEd1jCyyT1RCQ6tc9FtKQAc2A2jUBKjXsF3A8LaltdJ7HptU/FmOciXbIxB7MWsT5 WVxQ/eqY1d8xogV47GH4EbZBiLKV7A6ofdTCKwJ3ANaZJrNThCeqVxqW2k4FeRX9POJf rd71YKmNsKl/k8g9G7oHysC9+Mdf0YODVkcxuI6cYgA3puw1tuq/SKF0Qlq7JqSG9KEL M4q/nCnOpB1zcbyGBmkiVzfGjCUT3/c8NH9AjtrePIBUGcGT7rdGoO5X3IrB3bEFFXdE oaa8tmI8R3sJixlREhFIucp8fJXAyNoMXafnEaNiG0Bv7Ev+7PHmcYjxhFC9ApIO+hPV 8Lzg== X-Gm-Message-State: AIVw110BuHH/dYGM+7FLUJm5exmTNz4XSDOvHaiAspTT19BhgKiKF1Kc /xAUMJ7fo1FX6A== X-Received: by 10.84.217.150 with SMTP id p22mr21226804pli.270.1499249744765; Wed, 05 Jul 2017 03:15:44 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id p28sm47035238pfl.102.2017.07.05.03.15.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Jul 2017 03:15:44 -0700 (PDT) From: Arvind Yadav To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input: constify attribute_group structures. Date: Wed, 5 Jul 2017 15:45:25 +0530 Message-Id: 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 17755 1312 16 19083 4a8b drivers/input/input.o File size After adding 'const': text data bss dec hex filename 17947 1120 16 19083 4a8b drivers/input/input.o Signed-off-by: Arvind Yadav --- drivers/input/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 067d648..4b5fa22 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1398,7 +1398,7 @@ static ssize_t input_dev_show_properties(struct device *dev, NULL }; -static struct attribute_group input_dev_attr_group = { +static const struct attribute_group input_dev_attr_group = { .attrs = input_dev_attrs, }; @@ -1425,7 +1425,7 @@ static DEVICE_ATTR(name, S_IRUGO, input_dev_show_id_##name, NULL) NULL }; -static struct attribute_group input_dev_id_attr_group = { +static const struct attribute_group input_dev_id_attr_group = { .name = "id", .attrs = input_dev_id_attrs, }; @@ -1495,7 +1495,7 @@ static DEVICE_ATTR(bm, S_IRUGO, input_dev_show_cap_##bm, NULL) NULL }; -static struct attribute_group input_dev_caps_attr_group = { +static const struct attribute_group input_dev_caps_attr_group = { .name = "capabilities", .attrs = input_dev_caps_attrs, };