From patchwork Fri Jun 30 05:09:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9818427 X-Patchwork-Delegate: andy.shevchenko@gmail.com 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 BFA66603F2 for ; Fri, 30 Jun 2017 05:10:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8F52285A3 for ; Fri, 30 Jun 2017 05:10:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88450285CB; Fri, 30 Jun 2017 05:10:00 +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 1D103285A3 for ; Fri, 30 Jun 2017 05:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751494AbdF3FJ6 (ORCPT ); Fri, 30 Jun 2017 01:09:58 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36056 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbdF3FJ6 (ORCPT ); Fri, 30 Jun 2017 01:09:58 -0400 Received: by mail-pf0-f193.google.com with SMTP id z6so15654821pfk.3; Thu, 29 Jun 2017 22:09:57 -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=afGjLQM8RFnwuKH4ryp/mtc2svLDzyDyImzjjJtX8ts=; b=QRb8lS/OMKbOqUPNCjS9V4iVOEHoMrhNf9G48DhA/vNwT4z8umnOy1M1VHZF7bGv/K HaGyb/NB54iTeygYCoRZXLJAQeZm7xgXYnHzAV3WKlvAbebEs0aj3SDCmG2P9Ji7cQbK wFryH0P+SaojkGlwagK2kQydELn5wSnHFiDaYDH6Zgzh4Uyjte+vuE+LffxAUiCjm3vZ Dm9sr+0wjsPgMgajJ5VVvjpVvp9hAda4BfTg254dglRsB6HzsDUEJaaAMHWYt9JhKPn3 GJmg+xtMG1YTW8kYg0KbRQZXrLJhRPkzHq2XYkymfldPqUzCEw363RL1capiWUOQNCRC jVfA== 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=afGjLQM8RFnwuKH4ryp/mtc2svLDzyDyImzjjJtX8ts=; b=Btf9cK2eGpj56cuAgyzM+6Ob2Dgf5alRevmfa73d3ZGTp8U9AYHEIwPs2fn4jaakL/ 20AT5mTlijcGwWVWiX2V/hUPwbSI6e7bvvMy6317UsuodZ1qwmHfHObaizv6OwEPLiW1 e9A6YM+xywA8Dxa48IRRaO8sFGSQENvBlEeb3CTkv+1ejhLg7ALQRXLwrdQ6+US+0lMM twfSK+gSnvtCF7gd5TSqUmpgHLvFcjC8XUknF22/9gXyLIavPEWQf9iZTmFtKY62d8l5 8nBJ4RjxCk6kvJ7oR5kiVns3zsZHqNt1Q9e2QPlWRfqpiawVLn00C40SSUKDolG/X3JZ 4/Mg== X-Gm-Message-State: AKS2vOyL3JgnOy49x8yqJm+VbzSYMLRirtrcPxqjmjh6O+Um1pRd4nwo bOQuy3AvjhIaGg== X-Received: by 10.84.232.5 with SMTP id h5mr22870594plk.261.1498799397321; Thu, 29 Jun 2017 22:09:57 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id t83sm16195460pfg.91.2017.06.29.22.09.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jun 2017 22:09:56 -0700 (PDT) From: Arvind Yadav To: malattia@linux.it, dvhart@infradead.org, andy@infradead.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] sony-laptop: constify spic_attribute_group and sony_laptop_input_index. Date: Fri, 30 Jun 2017 10:39:47 +0530 Message-Id: <8d970553e4374fa42576306c2da1fc359a04aad5.1498799085.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 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 31273 5176 372 36821 8fd5 drivers/platform/x86/sony-laptop.o File size After adding 'const': text data bss dec hex filename 31337 5112 372 36821 8fd5 drivers/platform/x86/sony-laptop.o Signed-off-by: Arvind Yadav --- Changes in v2: Resolve warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers] key_dev->keycode = &sony_laptop_input_keycode_map; drivers/platform/x86/sony-laptop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index aa2ee51..bfae795 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -222,7 +222,7 @@ struct sony_laptop_keypress { /* Correspondance table between sonypi events * and input layer indexes in the keymap */ -static int sony_laptop_input_index[] = { +static const int sony_laptop_input_index[] = { -1, /* 0 no event */ -1, /* 1 SONYPI_EVENT_JOGDIAL_DOWN */ -1, /* 2 SONYPI_EVENT_JOGDIAL_UP */ @@ -4032,7 +4032,7 @@ struct device_attribute spic_attr_##_name = __ATTR(_name, \ NULL }; -static struct attribute_group spic_attribute_group = { +static const struct attribute_group spic_attribute_group = { .attrs = spic_attributes };