From patchwork Fri Jan 13 18:48:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9516235 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 ED42C601E5 for ; Fri, 13 Jan 2017 18:51:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCC3428587 for ; Fri, 13 Jan 2017 18:51:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1D292876B; Fri, 13 Jan 2017 18:51:32 +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 845B228587 for ; Fri, 13 Jan 2017 18:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750968AbdAMSvS (ORCPT ); Fri, 13 Jan 2017 13:51:18 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35567 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdAMSvR (ORCPT ); Fri, 13 Jan 2017 13:51:17 -0500 Received: by mail-pf0-f194.google.com with SMTP id f144so9445327pfa.2; Fri, 13 Jan 2017 10:51:17 -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=lUDFA+ElKgdBCawn3yfpSdiTY6hc7MCxDPesVNzRsKs=; b=QHkybAOFOBmR0OhhU1KiWB8a0Xp3j/YuSkXZBeN6YECE63V+ul/wWE+IrxGNmKzaW5 DuJ/7el7Bv0KQ04Id/yhGnjV4RJLLHDt5UC+CbObj8589UHmgbDDdQSxNiZb+F5BZN8C MFkSstxl1aE1Q63NDAH9V7mEruZymnUOSGLAY3sqy3sMTCeCYrfw1v5iWLsWfBxPfn7g 2LiBUAPRppUlIUAD+EhCT0SXQhvTSE2ftsRWSstLtAk5LURA1lk3+3GfCs/WuNq9N7VV 85r2rShpcoVYfctVV8tyCDhg0wwMK83GTJRBV53RaXUepE/yLRDZcdcaWdzZK7i+ENje 3C/Q== 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=lUDFA+ElKgdBCawn3yfpSdiTY6hc7MCxDPesVNzRsKs=; b=MTwBC8slgmToJ5Mnb1z2B30YA15VEopSwCuj4ElbQ1tgqiKovXpGl2Ig3sM8rzVozw uuyO6jeCPRC7od2XABDbsCKoYBu2tTvyX+fTPvJhpIBh6hPoYIoqk0GdPoE8/NxDYaBy o+/ry+pgDH1CjvX7Ow+VZ8Y0vNc7ixUt9U/7Obbws0vQWJiXP3EgO8bdtKWigQeit1VW NVk064iXsUWzEnQqMf7xiaT41YaWTNCl3lCl25qmPbrfAQHvW9J+ESM4pb8ADsghzvMv 3D3Xfz8avwJusi9Z5qkJfDIYnlEkOfZtFbDJvstrPyHfwYsV3wuVAbzobbEYbuPCiFKa BtAA== X-Gm-Message-State: AIkVDXJQmCvAbILT4ja5D7zX0OvttgdfUw8gve4NcGEpoKz+WVUs9gZlejVsVq8yxJ5ySg== X-Received: by 10.84.236.2 with SMTP id q2mr31834284plk.148.1484333476889; Fri, 13 Jan 2017 10:51:16 -0800 (PST) Received: from gmail.com ([157.49.93.230]) by smtp.gmail.com with ESMTPSA id h4sm16469280pfk.96.2017.01.13.10.51.10 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 13 Jan 2017 10:51:15 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sat, 14 Jan 2017 00:19:00 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, schwidefsky@de.ibm.com, linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] s390: virtio: constify virtio_config_ops structures Date: Sat, 14 Jan 2017 00:18:56 +0530 Message-Id: <1484333336-13443-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Declare virtio_config_ops structure as const as it is only stored in the config field of a virtio_device structure. This field is of type const, so virtio_config_ops structures having this property can be declared const. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct virtio_config_ops i@p={...}; @ok1@ identifier r1.i; position p; struct virtio_ccw_device x; @@ x.vdev.config=&i@p @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct virtio_config_ops i; File size before and after applying the patch remains the same. text data bss dec hex filename 9235 296 32928 42459 a5db drivers/s390/virtio/virtio_ccw.o Signed-off-by: Bhumika Goyal --- drivers/s390/virtio/virtio_ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 639ed4e..6508bf4 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -920,7 +920,7 @@ static void virtio_ccw_set_status(struct virtio_device *vdev, u8 status) kfree(ccw); } -static struct virtio_config_ops virtio_ccw_config_ops = { +static const struct virtio_config_ops virtio_ccw_config_ops = { .get_features = virtio_ccw_get_features, .finalize_features = virtio_ccw_finalize_features, .get = virtio_ccw_get_config,