From patchwork Sun Jan 15 04:53:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9517301 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 6337A601D8 for ; Sun, 15 Jan 2017 04:54:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AB3928404 for ; Sun, 15 Jan 2017 04:54:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E68228446; Sun, 15 Jan 2017 04:54:03 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 BFD3D28404 for ; Sun, 15 Jan 2017 04:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750812AbdAOExk (ORCPT ); Sat, 14 Jan 2017 23:53:40 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35105 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbdAOExk (ORCPT ); Sat, 14 Jan 2017 23:53:40 -0500 Received: by mail-pf0-f196.google.com with SMTP id f144so12016574pfa.2; Sat, 14 Jan 2017 20:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=izR4vfy+euwZR051+9HbZe2l63iGujPSwDOmy7iyltM=; b=OYAsMfbUHSZ7FiV70sx/NXWihPKMlyI+KcAnHu69QhdqAtUHGJZstDD/gIgunQXq9F pWZCnbZL2/edgDZ9s+B9NHLU7dZDKPN5AA6M03UinO80bf44WE9H/Bctcg9kzEI/TtB5 ycoMLB6kdBxmIx6MLSnPQdH+b2EjYAEIaI47KAeIf4SBp4hvUoFn+wrdQxfYajadAP2g WiLXEKBg6OGNX47FBc5oqTMF5m/T2EIuRa9OIDdbSwgvoMN8mOLj0BQKA1F1sqCSc4/y Umuhvqv8iVExHF+d1ANQnBw4tarcRtykYSyBZg8dGE6OouwJr8ZlMI+5Sec/4eDkuPKY pQYw== 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=izR4vfy+euwZR051+9HbZe2l63iGujPSwDOmy7iyltM=; b=MsjELEHg/Zpr3vavL97RUNoRXjuogL3EI06HhMPfTdJvBIhPFr/dlUrDVvw4qa6guL 0zWIqZSCu2cKDgRZp3A0pqYI+pRNReZI+7Cz1QSHtCfk2OHGKp2L3/byTIn5LdeDYHAB IwdMTBW8jh4ftRzQlkSPRJQqmqUFvfmumjJt9HREu1KnUqmRX1kHDdXIh1ANCiyIlvz4 W8eKDYz0RDjbVZrzZEb6w6zKjJwH9qRMRgDJ6iYekeLala1MBhjpW2kdyKyv399noLER dpLLxqkGmMFGNDvZOtvEURivUX5X9mFWv83F3WsNsS2qYEl3sC0Dxycu92BiWdN/jq2p NBGg== X-Gm-Message-State: AIkVDXJWPtNpuNQ/o/gx1yNlFp5WsCPuhXhoB+NZold1wSq2rgsualxnC0Jcst7eSUVqgQ== X-Received: by 10.99.237.17 with SMTP id d17mr33024674pgi.82.1484456019212; Sat, 14 Jan 2017 20:53:39 -0800 (PST) Received: from gmail.com ([2405:204:5004:18ee:e4a1:7320:3c7c:3a1b]) by smtp.gmail.com with ESMTPSA id p1sm38514097pgc.29.2017.01.14.20.53.31 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 14 Jan 2017 20:53:37 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sun, 15 Jan 2017 10:23:28 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, tyreld@linux.vnet.ibm.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] scsi: ibmvscsi: constify dev_pm_ops structures Date: Sun, 15 Jan 2017 10:23:17 +0530 Message-Id: <1484455997-24400-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 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 Declare dev_pm_ops structures as const as they are only stored in the pm field of a vio_driver structure. This field is of type const, so dev_pm_ops structures having similar properties can be declared const. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct dev_pm_ops i@p={...}; @ok@ identifier r1.i; position p; struct vio_driver x; @@ x.pm=&i@p; @bad@ position p!={r1.p,ok.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct dev_pm_ops i; File sizes after cross compiling the .o files for powerpc architecture. File size before: text data bss dec hex filename 57893 5665 20 63578 f85a drivers/scsi/ibmvscsi/ibmvfc.o File size after: text data bss dec hex filename 58077 5481 20 63578 f85a drivers/scsi/ibmvscsi/ibmvfc.o File size before: text data bss dec hex filenam 20990 2816 80 23886 5d4e drivers/scsi/ibmvscsi/ibmvscsi.o File size after: text data bss dec hex filename 21174 2632 80 23886 5d4e drivers/scsi/ibmvscsi/ibmvscsi.o Signed-off-by: Bhumika Goyal --- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 78b72c2..1e1b343 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -4940,7 +4940,7 @@ static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev) }; MODULE_DEVICE_TABLE(vio, ibmvfc_device_table); -static struct dev_pm_ops ibmvfc_pm_ops = { +static const struct dev_pm_ops ibmvfc_pm_ops = { .resume = ibmvfc_resume }; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 50cd011..b94e7b1 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -2335,7 +2335,7 @@ static int ibmvscsi_resume(struct device *dev) }; MODULE_DEVICE_TABLE(vio, ibmvscsi_device_table); -static struct dev_pm_ops ibmvscsi_pm_ops = { +static const struct dev_pm_ops ibmvscsi_pm_ops = { .resume = ibmvscsi_resume };