{"id":814919,"url":"http://patchwork.ozlabs.org/api/1.2/patches/814919/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/patch/20170918133140.31220-1-colin.king@canonical.com/","project":{"id":13,"url":"http://patchwork.ozlabs.org/api/1.2/projects/13/?format=json","name":"Linux IDE development","link_name":"linux-ide","list_id":"linux-ide.vger.kernel.org","list_email":"linux-ide@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170918133140.31220-1-colin.king@canonical.com>","list_archive_url":null,"date":"2017-09-18T13:31:40","name":"libata: make static arrays const, reduces object code size","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"c55964ee53d752ae4a544dfaa2178c09a371477d","submitter":{"id":2900,"url":"http://patchwork.ozlabs.org/api/1.2/people/2900/?format=json","name":"Colin Ian King","email":"colin.king@canonical.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/linux-ide/patch/20170918133140.31220-1-colin.king@canonical.com/mbox/","series":[{"id":3645,"url":"http://patchwork.ozlabs.org/api/1.2/series/3645/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/list/?series=3645","date":"2017-09-18T13:31:40","name":"libata: make static arrays const, reduces object code size","version":1,"mbox":"http://patchwork.ozlabs.org/series/3645/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814919/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814919/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-ide-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ide-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwn3s4xfNz9s3w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 23:32:09 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932525AbdIRNbx (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tMon, 18 Sep 2017 09:31:53 -0400","from youngberry.canonical.com ([91.189.89.112]:38431 \"EHLO\n\tyoungberry.canonical.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932520AbdIRNbv (ORCPT\n\t<rfc822; linux-ide@vger.kernel.org>); Mon, 18 Sep 2017 09:31:51 -0400","from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76)\n\t(envelope-from <colin.king@canonical.com>)\n\tid 1dtw9E-0001i0-LP; Mon, 18 Sep 2017 13:31:40 +0000"],"From":"Colin King <colin.king@canonical.com>","To":"Tejun Heo <tj@kernel.org>, Mark Fasheh <mfasheh@versity.com>,\n\tJoel Becker <jlbec@evilplan.org>,\n\tAndrew Morton <akpm@linux-foundation.org>,\n\tpiaojun <piaojun@huawei.com>, linux-ide@vger.kernel.org,\n\tocfs2-devel@oss.oracle.com","Cc":"kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org","Subject":"[PATCH] libata: make static arrays const, reduces object code size","Date":"Mon, 18 Sep 2017 14:31:40 +0100","Message-Id":"<20170918133140.31220-1-colin.king@canonical.com>","X-Mailer":"git-send-email 2.14.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"8bit","Sender":"linux-ide-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ide.vger.kernel.org>","X-Mailing-List":"linux-ide@vger.kernel.org"},"content":"From: Colin Ian King <colin.king@canonical.com>\n\nDon't populate const arrayis on the stack, instead make them static.\nMakes the object code smaller by over 260 bytes:\n\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n drivers/ata/libata-scsi.c  | 10 +++++-----\n fs/ocfs2/dlm/dlmrecovery.c |  1 -\n 2 files changed, 5 insertions(+), 6 deletions(-)","diff":"diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c\nindex 44ba292f2cd7..c3c483fc2145 100644\n--- a/drivers/ata/libata-scsi.c\n+++ b/drivers/ata/libata-scsi.c\n@@ -2145,7 +2145,7 @@ static void ata_scsi_rbuf_fill(struct ata_scsi_args *args,\n  */\n static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)\n {\n-\tconst u8 versions[] = {\n+\tstatic const u8 versions[] = {\n \t\t0x00,\n \t\t0x60,\t/* SAM-3 (no version claimed) */\n \n@@ -2155,7 +2155,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)\n \t\t0x03,\n \t\t0x00\t/* SPC-3 (no version claimed) */\n \t};\n-\tconst u8 versions_zbc[] = {\n+\tstatic const u8 versions_zbc[] = {\n \t\t0x00,\n \t\t0xA0,\t/* SAM-5 (no version claimed) */\n \n@@ -2227,7 +2227,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)\n static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)\n {\n \tint num_pages;\n-\tconst u8 pages[] = {\n+\tstatic const u8 pages[] = {\n \t\t0x00,\t/* page 0x00, this page */\n \t\t0x80,\t/* page 0x80, unit serial no page */\n \t\t0x83,\t/* page 0x83, device ident page */\n@@ -2258,7 +2258,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)\n  */\n static unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf)\n {\n-\tconst u8 hdr[] = {\n+\tstatic const u8 hdr[] = {\n \t\t0,\n \t\t0x80,\t\t\t/* this page code */\n \t\t0,\n@@ -2580,7 +2580,7 @@ static unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf)\n {\n \tstruct ata_device *dev = args->dev;\n \tu8 *scsicmd = args->cmd->cmnd, *p = rbuf;\n-\tconst u8 sat_blk_desc[] = {\n+\tstatic const u8 sat_blk_desc[] = {\n \t\t0, 0, 0, 0,\t/* number of blocks: sat unspecified */\n \t\t0,\n \t\t0, 0x2, 0x0\t/* block length: 512 bytes */\ndiff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c\nindex 74407c6dd592..31a61e8e0152 100644\n--- a/fs/ocfs2/dlm/dlmrecovery.c\n+++ b/fs/ocfs2/dlm/dlmrecovery.c\n@@ -1129,7 +1129,6 @@ static int dlm_send_mig_lockres_msg(struct dlm_ctxt *dlm,\n \t\t(mres->num_locks * sizeof(struct dlm_migratable_lock));\n \n \t/* add an all-done flag if we reached the last lock */\n-\torig_flags = mres->flags;\n \tBUG_ON(total_locks > mres_total_locks);\n \tif (total_locks == mres_total_locks)\n \t\tmres->flags |= DLM_MRES_ALL_DONE;\n","prefixes":[]}