From patchwork Fri May 10 13:10:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10938785 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 971A3112C for ; Fri, 10 May 2019 13:10:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86ABA28BB3 for ; Fri, 10 May 2019 13:10:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79CE828BB6; Fri, 10 May 2019 13:10:45 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 EE46D28B89 for ; Fri, 10 May 2019 13:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727568AbfEJNKo (ORCPT ); Fri, 10 May 2019 09:10:44 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:42980 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727465AbfEJNKo (ORCPT ); Fri, 10 May 2019 09:10:44 -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 1hP5IO-0005L9-As; Fri, 10 May 2019 13:10:40 +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: logitech-dj: make const array template static Date: Fri, 10 May 2019 14:10:39 +0100 Message-Id: <20190510131039.4675-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.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 the array template on the stack but instead make it static. Makes the object code smaller by 10 bytes. Also reformat the declaration. Before: text data bss dec hex filename 29376 9360 128 38864 97d0 drivers/hid/hid-logitech-dj.o After: text data bss dec hex filename 29270 9456 128 38854 97c6 drivers/hid/hid-logitech-dj.o (gcc version 8.3.0, amd64) Signed-off-by: Colin Ian King --- drivers/hid/hid-logitech-dj.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index b1e894618eed..72d0ab05401f 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1111,12 +1111,14 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev, static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev) { - const u8 template[] = {REPORT_ID_HIDPP_SHORT, - HIDPP_RECEIVER_INDEX, - HIDPP_SET_REGISTER, - HIDPP_REG_CONNECTION_STATE, - HIDPP_FAKE_DEVICE_ARRIVAL, - 0x00, 0x00}; + static const u8 template[] = { + REPORT_ID_HIDPP_SHORT, + HIDPP_RECEIVER_INDEX, + HIDPP_SET_REGISTER, + HIDPP_REG_CONNECTION_STATE, + HIDPP_FAKE_DEVICE_ARRIVAL, + 0x00, 0x00 + }; u8 *hidpp_report; int retval;