From patchwork Tue Nov 28 18:12:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10080861 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 D6FE6602DC for ; Tue, 28 Nov 2017 18:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0687292EA for ; Tue, 28 Nov 2017 18:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C57A0294DC; Tue, 28 Nov 2017 18:12:53 +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=unavailable 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 4B87A292EA for ; Tue, 28 Nov 2017 18:12:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbdK1SMj (ORCPT ); Tue, 28 Nov 2017 13:12:39 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:60582 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbdK1SMj (ORCPT ); Tue, 28 Nov 2017 13:12:39 -0500 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 1eJkN1-00038C-8I; Tue, 28 Nov 2017 18:12:35 +0000 From: Colin King To: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: wd719x: make card_types static const, shrinks object size Date: Tue, 28 Nov 2017 18:12:34 +0000 Message-Id: <20171128181234.24330-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Don't populate the read-only array card_types on the stack but instead make it static and constify it. Makes the object code smaller by over 110 bytes: Before: text data bss dec hex filename 25625 5752 0 31377 7a91 drivers/scsi/wd719x.o After: text data bss dec hex filename 25447 5816 0 31263 7a1f drivers/scsi/wd719x.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King --- drivers/scsi/wd719x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c index 2a9da2e0ea6b..2ba2b7b47f41 100644 --- a/drivers/scsi/wd719x.c +++ b/drivers/scsi/wd719x.c @@ -803,7 +803,9 @@ static enum wd719x_card_type wd719x_detect_type(struct wd719x *wd) static int wd719x_board_found(struct Scsi_Host *sh) { struct wd719x *wd = shost_priv(sh); - char *card_types[] = { "Unknown card", "WD7193", "WD7197", "WD7296" }; + static const char * const card_types[] = { + "Unknown card", "WD7193", "WD7197", "WD7296" + }; int ret; INIT_LIST_HEAD(&wd->active_scbs);