From patchwork Fri Aug 25 17:12:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9922545 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 25C33600C5 for ; Fri, 25 Aug 2017 17:13:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E36428419 for ; Fri, 25 Aug 2017 17:13:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02DEF2841D; Fri, 25 Aug 2017 17:13:11 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 B61FE28419 for ; Fri, 25 Aug 2017 17:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755956AbdHYRMz (ORCPT ); Fri, 25 Aug 2017 13:12:55 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39319 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755615AbdHYRMy (ORCPT ); Fri, 25 Aug 2017 13:12:54 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dlIA6-0003Ag-Kw; Fri, 25 Aug 2017 17:12:50 +0000 From: Colin King To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: hid-lg: make array cbuf static const to shink object code size Date: Fri, 25 Aug 2017 18:12:50 +0100 Message-Id: <20170825171250.23988-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 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 From: Colin Ian King Don't populate array cbuf on the stack, instead make it static. Makes the object code smaller by over 110 bytes: Before: text data bss dec hex filename 15096 3504 128 18728 4928 drivers/hid/hid-lg.o After: text data bss dec hex filename 14884 3600 128 18612 48b4 drivers/hid/hid-lg.o Signed-off-by: Colin Ian King --- drivers/hid/hid-lg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 52026dc94d5c..596227ddb6e0 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -756,7 +756,9 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) /* Setup wireless link with Logitech Wii wheel */ if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { - const unsigned char cbuf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + static const unsigned char cbuf[] = { + 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; u8 *buf = kmemdup(cbuf, sizeof(cbuf), GFP_KERNEL); if (!buf) {