From patchwork Mon Nov 6 13:15:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10043417 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 3DD0A60247 for ; Mon, 6 Nov 2017 13:16:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3124C29C64 for ; Mon, 6 Nov 2017 13:16:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2640C29C67; Mon, 6 Nov 2017 13:16:06 +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=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 D14B629C68 for ; Mon, 6 Nov 2017 13:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717AbdKFNPv (ORCPT ); Mon, 6 Nov 2017 08:15:51 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:48531 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752814AbdKFNPs (ORCPT ); Mon, 6 Nov 2017 08:15:48 -0500 Received: by mail-wm0-f68.google.com with SMTP id p75so13719254wmg.3; Mon, 06 Nov 2017 05:15:48 -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:in-reply-to:references; bh=L4SHumLoj8VJ11hZpN23NoXEWbk2tQp4353xOX7zRsM=; b=MP/6IHVK17g/f82slw+21HPUYDChnXaF24UreZLmBJLELa/GW6n5tfrEqJG5GF0Kk2 FRyos7IJQAtKPZBdwrStU4HmuH94hdOqfdQmPyRgKb2D+EzzGmfBDWpgsP80d4oKSCmG EqmLwUM3fn4HZirlacOK4I5Ys/JAIAPzblex29tWD5zdaJjBZPqQZ892G6vVGqllBUt2 7y6qTfxuKCbAiyWuPuVk7PlL4ZvJ6uKii/4IUrifcVbGSbPGh5bB2bF4iDCNRCGIkImD mRtQsU7JRbH8S45sBhyB8GgS3ct1LRde+U6kyS3OUchQYukLbLPyXECjCvVxMHIJaal8 eGMw== 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=L4SHumLoj8VJ11hZpN23NoXEWbk2tQp4353xOX7zRsM=; b=tw1mW/gdBAPYlGIfyswEAUiiXhy8+h8td9jj4+7rpIk8amA2c9NTtzX+5c95a4at0r 46X/YD2/zJNWd3uetMX/ddccluGbeS+p3A+JFS8j3u7fmsIwhYb/Ywk5WHXaJoA74u/e mqpBO3Wuq6EjMQ1HQHC3JdEBcATYj8fjYZWdzZFMlM8VYeLGWeBtcpTPJGd8O9ddbvk2 JNdt10UkRuOcncDZHL/PMGJnxst724s0MejpEC3Vgj2ODa/Gn2Eeka+8nRTbinR9fAiZ /86Lnv2E2AVSypvV7+1UnLgD5W8ukSwFaHzT+pu/yLf6GJzuyXBStTLdWGdQkEL+gnjC uZPQ== X-Gm-Message-State: AJaThX4SClxAdVDkUV7+EUEBoBOAGy/P5YwnVQ5XzmO2Y3+mn+XgbzGk fAhMhLDQ3Niu4zYhyYM86x0= X-Google-Smtp-Source: ABhQp+TzM+nkEYqkN3vngJiMtqIr78yp31axsg63jsSVEm/NOu58TJU7zTllykKETfGp8CXu9OKn2Q== X-Received: by 10.28.109.23 with SMTP id i23mr4992021wmc.32.1509974147246; Mon, 06 Nov 2017 05:15:47 -0800 (PST) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id g4sm4655582wrh.19.2017.11.06.05.15.45 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 06 Nov 2017 05:15:46 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Mon, 06 Nov 2017 14:15:46 +0100 From: Bhumika Goyal To: julia.lawall@lip6.fr, tony@atomide.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH 1/2] ARM: OMAP2+: CM: make some pointers and function arguments as const Date: Mon, 6 Nov 2017 14:15:39 +0100 Message-Id: <1509974140-10860-2-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509974140-10860-1-git-send-email-bhumirks@gmail.com> References: <1509974140-10860-1-git-send-email-bhumirks@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make the pointer cm_ll_data of type cm_ll_data as const as it does not modify the fields of the structure it points too. After this change, make the argument of cm_register function as const as it is used to initialise cm_ll_data or used inside an if condition. Make the pointer argument of cm_unregister function as const as it is only used inside an if condition. Add const to the function prototypes too. Signed-off-by: Bhumika Goyal --- arch/arm/mach-omap2/cm.h | 4 ++-- arch/arm/mach-omap2/cm_common.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h index e833984..7b66e17 100644 --- a/arch/arm/mach-omap2/cm.h +++ b/arch/arm/mach-omap2/cm.h @@ -72,8 +72,8 @@ int omap_cm_wait_module_idle(u8 part, s16 prcm_mod, u16 idlest_reg, u8 idlest_shift); int omap_cm_module_enable(u8 mode, u8 part, u16 inst, u16 clkctrl_offs); int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs); -extern int cm_register(struct cm_ll_data *cld); -extern int cm_unregister(struct cm_ll_data *cld); +extern int cm_register(const struct cm_ll_data *cld); +extern int cm_unregister(const struct cm_ll_data *cld); int omap_cm_init(void); int omap2_cm_base_init(void); diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c index 83c6fa7..adf8858 100644 --- a/arch/arm/mach-omap2/cm_common.c +++ b/arch/arm/mach-omap2/cm_common.c @@ -29,7 +29,7 @@ * common CM functions */ static struct cm_ll_data null_cm_ll_data; -static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; +static const struct cm_ll_data *cm_ll_data = &null_cm_ll_data; /* cm_base: base virtual address of the CM IP block */ struct omap_domain_base cm_base; @@ -189,7 +189,7 @@ int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs) * is NULL, or -EEXIST if cm_register() has already been called * without an intervening cm_unregister(). */ -int cm_register(struct cm_ll_data *cld) +int cm_register(const struct cm_ll_data *cld) { if (!cld) return -EINVAL; @@ -213,7 +213,7 @@ int cm_register(struct cm_ll_data *cld) * -EINVAL if @cld is NULL or if @cld does not match the struct * cm_ll_data * previously registered by cm_register(). */ -int cm_unregister(struct cm_ll_data *cld) +int cm_unregister(const struct cm_ll_data *cld) { if (!cld || cm_ll_data != cld) return -EINVAL;