From patchwork Fri Nov 13 18:41:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 7613821 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BDA5E9F2E2 for ; Fri, 13 Nov 2015 18:53:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF579206B8 for ; Fri, 13 Nov 2015 18:53:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1180020698 for ; Fri, 13 Nov 2015 18:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754295AbbKMSxQ (ORCPT ); Fri, 13 Nov 2015 13:53:16 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:27690 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932557AbbKMSxP (ORCPT ); Fri, 13 Nov 2015 13:53:15 -0500 X-IronPort-AV: E=Sophos;i="5.20,288,1444687200"; d="scan'208";a="153764649" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 13 Nov 2015 19:53:12 +0100 From: Julia Lawall To: Sebastian Reichel Cc: kernel-janitors@vger.kernel.org, Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ds2782_battery: constify ds278x_battery_ops structure Date: Fri, 13 Nov 2015 19:41:34 +0100 Message-Id: <1447440094-10105-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ds278x_battery_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/power/ds2782_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c index ed4d756..a1b7e05 100644 --- a/drivers/power/ds2782_battery.c +++ b/drivers/power/ds2782_battery.c @@ -59,7 +59,7 @@ struct ds278x_info { struct i2c_client *client; struct power_supply *battery; struct power_supply_desc battery_desc; - struct ds278x_battery_ops *ops; + const struct ds278x_battery_ops *ops; struct delayed_work bat_work; int id; int rsns; @@ -361,7 +361,7 @@ enum ds278x_num_id { DS2786, }; -static struct ds278x_battery_ops ds278x_ops[] = { +static const struct ds278x_battery_ops ds278x_ops[] = { [DS2782] = { .get_battery_current = ds2782_get_current, .get_battery_voltage = ds2782_get_voltage,