From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032520AbdAIRRs (ORCPT ); Mon, 9 Jan 2017 12:17:48 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33724 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934191AbdAIRRr (ORCPT ); Mon, 9 Jan 2017 12:17:47 -0500 From: Bhumika Goyal To: julia.lawall@lip6.fr, baohua@kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] ARM: prima2: constify reset_control_ops structures Date: Mon, 9 Jan 2017 22:47:32 +0530 Message-Id: <1483982252-5027-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Declare reset_control_ops structures as const as they are only stored in the ops field of a reset_controller_dev structure. This field is of type const struct reset_control_ops *, so reset_control_ops structures having this property can be declared as const. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct reset_control_ops i@p={...}; @ok1@ identifier r1.i; position p; struct reset_controller_dev x; @@ x.ops=&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 reset_control_ops i; File size before: arch/arm/mach-prima2/rstc.o text data bss dec hex filename 992 236 4 1232 4d0 arch/arm/mach-prima2/rstc.o File size after: arch/arm/mach-prima2/rstc.o text data bss dec hex filename 1008 220 4 1232 4d0 arch/arm/mach-prima2/rstc.o Signed-off-by: Bhumika Goyal --- arch/arm/mach-prima2/rstc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 7c251eb..1cdb616 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -54,7 +54,7 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev, return 0; } -static struct reset_control_ops sirfsoc_rstc_ops = { +static const struct reset_control_ops sirfsoc_rstc_ops = { .reset = sirfsoc_reset_module, }; -- 1.9.1