From patchwork Thu Feb 5 15:45:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 5785331 Return-Path: X-Original-To: patchwork-linux-omap@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 D4AD79F336 for ; Thu, 5 Feb 2015 15:45:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E018720270 for ; Thu, 5 Feb 2015 15:45:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90E3320221 for ; Thu, 5 Feb 2015 15:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757600AbbBEPpH (ORCPT ); Thu, 5 Feb 2015 10:45:07 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:49614 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753601AbbBEPpG (ORCPT ); Thu, 5 Feb 2015 10:45:06 -0500 Received: by mail-wi0-f172.google.com with SMTP id h11so39801054wiw.5; Thu, 05 Feb 2015 07:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=lpW/LI3zYQNdv8ztnOmICgGpZkEgsW51sklqNqmY0z8=; b=GsFTXyClEVWpSuh+y7x9QL/r5p3EQ8cMLg0elyORFsyjB5C9A6zJ+0od5DPdKD+PVM zWtBSJG5h/UQj93txYS3ywkpPcwuwrT9RIBXCKC+d31Cl6uwNDe20SOLQTaVtIox0F2B r2CQQVClq5SGx1ghHRB8JberQzCw8I1rW84NIkCb4EkY8b3EnGQU+8u7/KcaIdnfyVsa FcyFNCHkVdrms61pTE3SfRZKlfO5gkiJ9Xxd+Lsj2Ik3Arxtz02rZhzbCb/7RfvXhj1Z yOykSo/4UlzDZjp4qACLrFlwHkVYaIXxyrFBeTHa5LCGcwrOAXeWFSriRqASTka2MCC9 wiUg== X-Received: by 10.194.192.167 with SMTP id hh7mr8864815wjc.151.1423151104130; Thu, 05 Feb 2015 07:45:04 -0800 (PST) Received: from [132.227.76.76] (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by mx.google.com with ESMTPSA id k20sm13659560wie.14.2015.02.05.07.45.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 07:45:03 -0800 (PST) Message-ID: <54D3900A.9060200@gmail.com> Date: Thu, 05 Feb 2015 16:45:14 +0100 From: Quentin Lambert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stephen Boyd , Mike Turquette , Julia Lawall CC: Paul Walmsley , Tomeu Vizoso , Tony Lindgren , linux-kernel@vger.kernel.org, t-kristo@ti.com, linux-omap@vger.kernel.org, cocci@systeme.lip6.fr, linux-arm-kernel@lists.infradead.org Subject: Re: [Cocci] [PATCH v13 3/6] clk: Make clk API return per-user struct clk instances References: <1422011024-32283-1-git-send-email-tomeu.vizoso@collabora.com> <1422011024-32283-4-git-send-email-tomeu.vizoso@collabora.com> <20150201212432.22722.70917@quantum> <54CFE1FE.7040404@codeaurora.org> <54CFFBCF.90706@codeaurora.org> <20150202225036.421.43421@quantum> <54D0F179.1040906@gmail.com> <54D2AA9B.7010800@codeaurora.org> In-Reply-To: <54D2AA9B.7010800@codeaurora.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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 On 05/02/2015 00:26, Stephen Boyd wrote: >> If you want me to I can enlarge the search to other directories. > Yes please do. And if you could share the coccinelle patch that would be > great. Thanks. > structclk.cocci is the coccinelle patch structclk-arm.patch is the result I got when applying it to the arch/arm directory Is there anything else I can do to help? /// Find any attempt to compare or dereference struct clk pointers. /// // Confidence: High // Copyright: (C) 2015 Quentin Lambert, INRIA/LiP6. GPLv2 // URL: http://coccinelle.lip6.fr/ // Options: --recursive-includes --relax-include-path // Options: --include-headers-for-types virtual context virtual org virtual report // ---------------------------------------------------------------------------- @comparison_dereference depends on context || org || report@ struct clk *x1, x2; position j0; @@ ( * x1@j0 == x2 | * x1@j0 != x2 | * *x1@j0 ) // ---------------------------------------------------------------------------- @script:python comparison_dereference_org depends on org@ j0 << comparison_dereference.j0; @@ msg = "WARNING trying to compare or dereference struct clk pointers." coccilib.org.print_todo(j0[0], msg) // ---------------------------------------------------------------------------- @script:python comparison_dereference_report depends on report@ j0 << comparison_dereference.j0; @@ msg = "WARNING trying to compare or dereference struct clk pointers." coccilib.report.print_report(j0[0], msg) diff -u -p ./arch/arm/mach-imx/mach-imx6q.c /tmp/nothing/mach-imx/mach-imx6q.c --- ./arch/arm/mach-imx/mach-imx6q.c +++ /tmp/nothing/mach-imx/mach-imx6q.c @@ -211,7 +211,6 @@ static void __init imx6q_1588_init(void) * set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad * (external OSC), and we need to clear the bit. */ - clksel = ptp_clk == enet_ref ? IMX6Q_GPR1_ENET_CLK_SEL_ANATOP : IMX6Q_GPR1_ENET_CLK_SEL_PAD; gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); if (!IS_ERR(gpr)) diff -u -p ./arch/arm/mach-shmobile/clock-r8a73a4.c /tmp/nothing/mach-shmobile/clock-r8a73a4.c --- ./arch/arm/mach-shmobile/clock-r8a73a4.c +++ /tmp/nothing/mach-shmobile/clock-r8a73a4.c @@ -139,7 +139,6 @@ static int pll_set_parent(struct clk *cl /* Search the parent */ for (i = 0; i < clk->parent_num; i++) - if (clk->parent_table[i] == parent) break; if (i == clk->parent_num) diff -u -p ./arch/arm/mach-shmobile/clock-sh7372.c /tmp/nothing/mach-shmobile/clock-sh7372.c --- ./arch/arm/mach-shmobile/clock-sh7372.c +++ /tmp/nothing/mach-shmobile/clock-sh7372.c @@ -223,7 +223,6 @@ static int pllc2_set_parent(struct clk * /* Search the parent */ for (i = 0; i < clk->parent_num; i++) - if (clk->parent_table[i] == parent) break; if (i == clk->parent_num) diff -u -p ./arch/arm/mach-shmobile/clock-r8a7740.c /tmp/nothing/mach-shmobile/clock-r8a7740.c --- ./arch/arm/mach-shmobile/clock-r8a7740.c +++ /tmp/nothing/mach-shmobile/clock-r8a7740.c @@ -195,7 +195,6 @@ static int usb24s_set_parent(struct clk /* Search the parent */ for (i = 0; i < clk->parent_num; i++) - if (clk->parent_table[i] == parent) break; if (i == clk->parent_num) diff -u -p ./arch/arm/mach-omap2/clkt_clksel.c /tmp/nothing/mach-omap2/clkt_clksel.c --- ./arch/arm/mach-omap2/clkt_clksel.c +++ /tmp/nothing/mach-omap2/clkt_clksel.c @@ -67,7 +67,6 @@ static const struct clksel *_get_clksel_ return NULL; for (clks = clk->clksel; clks->parent; clks++) - if (clks->parent == src_clk) break; /* Found the requested parent */ if (!clks->parent) { diff -u -p ./arch/arm/mach-omap2/timer.c /tmp/nothing/mach-omap2/timer.c --- ./arch/arm/mach-omap2/timer.c +++ /tmp/nothing/mach-omap2/timer.c @@ -298,7 +298,6 @@ static int __init omap_dm_timer_init_one if (IS_ERR(src)) return PTR_ERR(src); - if (clk_get_parent(timer->fclk) != src) { r = clk_set_parent(timer->fclk, src); if (r < 0) { pr_warn("%s: %s cannot set source\n", __func__,