From patchwork Thu Oct 19 10:59:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10016421 X-Patchwork-Delegate: rjw@sisk.pl 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 3D105603FF for ; Thu, 19 Oct 2017 10:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2964928CC4 for ; Thu, 19 Oct 2017 10:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E40828CCB; Thu, 19 Oct 2017 10:59:50 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 CA55A28CD2 for ; Thu, 19 Oct 2017 10:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbdJSK7e (ORCPT ); Thu, 19 Oct 2017 06:59:34 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:51388 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130AbdJSK71 (ORCPT ); Thu, 19 Oct 2017 06:59:27 -0400 Received: by mail-wr0-f194.google.com with SMTP id j14so7878395wre.8; Thu, 19 Oct 2017 03:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a9MQVHqlUYzoE8FX8VQmaH3jB2Lj05fJp7EMjo2Q7zI=; b=u0tefs7aX+Yki0sR5J8P2thnL0kubWyibDB6XQy2foaHq1+lRmwxZj900T9IDz7xTZ 4YVt/8gYctrD6gm7xtZJVNgx50BOLG3gVCC00mNHL/0UP+xoobm5EmsR/Sg6e5HCff2g WYqgHOKo+sLKcHW3b9RzeR4I1rT4WV9ALO54nRtMTtq0PEYFsVOc/JmYyclxIzTI6FP/ DiGaOKMBz4Xha2psXnWdrFQOwMnqeTW6req8g2bEX1EfwgJutK/vLHTUoKrubU4EkcrT Sw9MOgH7ew2n8T5nopTnBB5GKVRDiiCmcYZ/X5FPXdLTc8e+W1d6dj0v0FCtJMeAorbF NydQ== 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:in-reply-to :references; bh=a9MQVHqlUYzoE8FX8VQmaH3jB2Lj05fJp7EMjo2Q7zI=; b=tYEDLOITHjDKBcwmrP3lN2Q5d2ezR2RdcCAH3IhV1O5wWyOtP5WM5/kM3B0xFzTOj0 bBW8lRpDIpJGYBhzz2X8MzW9pRDv4uVMrPglUdfznqhDQ82s0Q5nppUnywUohTMxkeHN goptvQTrrdbr4sak89o63XvpNjFd+8XQo9T0/g6oAsXiklgnUEhZxrkU9MPS6NKA/1E6 VHysxuFXaLSj73jn0IlBpLvDBDPO7TgMp3WUVCTiUjozRR6D+KHe+RLa1OcpxDgt9Ma6 ntxGXfoTpssouUpSTuAwQ3H4KU3G7+rP8C+otSz+mVncDRdzG0rXVERDskFp3h7jfu0/ pXlQ== X-Gm-Message-State: AMCzsaXBDpKTNsfG/eJhba5gXK/S+hglYXIzmnii2rpPC9BwJGcFH3Mv MHLKPeiFWB9tqgXvvuhKJEU= X-Google-Smtp-Source: ABhQp+R/wBvp2K8D+WxvHcrufCtmzP8EqIk8ZJZ1H2QGIq28HfnlgAZZbj0GAAv7aOCKaIFeLJ/gWA== X-Received: by 10.223.156.139 with SMTP id d11mr1230380wre.214.1508410766093; Thu, 19 Oct 2017 03:59:26 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id f84sm683822wme.44.2017.10.19.03.59.23 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 Oct 2017 03:59:25 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Thu, 19 Oct 2017 12:59:23 +0200 From: Bhumika Goyal To: julia.lawall@lip6.fr, viresh.kumar@linaro.org, sudeep.holla@arm.com, rjw@rjwysocki.net, liviu.dudau@arm.com, lorenzo.pieralisi@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Bhumika Goyal Subject: [PATCH 1/2] cpufreq: arm_big_little: make function arguments and structure pointer const Date: Thu, 19 Oct 2017 12:59:14 +0200 Message-Id: <1508410755-13666-2-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508410755-13666-1-git-send-email-bhumirks@gmail.com> References: <1508410755-13666-1-git-send-email-bhumirks@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make the arguments of functions bL_cpufreq_{register/unregister} as const as the ops pointer does not modify the fields of the cpufreq_arm_bL_ops structure it points to. The pointer arm_bL_ops is also getting initialized with ops but the pointer does not modify the fields. So, make the function argument and the structure pointer const. Add const to function prototypes too. Signed-off-by: Bhumika Goyal --- drivers/cpufreq/arm_big_little.c | 6 +++--- drivers/cpufreq/arm_big_little.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 0c41ab3..65ec5f0 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -57,7 +57,7 @@ #define VIRT_FREQ(cluster, freq) ((cluster == A7_CLUSTER) ? freq >> 1 : freq) static struct thermal_cooling_device *cdev[MAX_CLUSTERS]; -static struct cpufreq_arm_bL_ops *arm_bL_ops; +static const struct cpufreq_arm_bL_ops *arm_bL_ops; static struct clk *clk[MAX_CLUSTERS]; static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1]; static atomic_t cluster_usage[MAX_CLUSTERS + 1]; @@ -617,7 +617,7 @@ static int __bLs_unregister_notifier(void) static int __bLs_unregister_notifier(void) { return 0; } #endif -int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) +int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops) { int ret, i; @@ -661,7 +661,7 @@ int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops) } EXPORT_SYMBOL_GPL(bL_cpufreq_register); -void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops) +void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops) { if (arm_bL_ops != ops) { pr_err("%s: Registered with: %s, can't unregister, exiting\n", diff --git a/drivers/cpufreq/arm_big_little.h b/drivers/cpufreq/arm_big_little.h index 184d7c3..88a176e 100644 --- a/drivers/cpufreq/arm_big_little.h +++ b/drivers/cpufreq/arm_big_little.h @@ -37,7 +37,7 @@ struct cpufreq_arm_bL_ops { void (*free_opp_table)(const struct cpumask *cpumask); }; -int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); -void bL_cpufreq_unregister(struct cpufreq_arm_bL_ops *ops); +int bL_cpufreq_register(const struct cpufreq_arm_bL_ops *ops); +void bL_cpufreq_unregister(const struct cpufreq_arm_bL_ops *ops); #endif /* CPUFREQ_ARM_BIG_LITTLE_H */