From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ED1FC433C1 for ; Thu, 25 Mar 2021 12:32:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 008C361A13 for ; Thu, 25 Mar 2021 12:32:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 008C361A13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t1kkpkSmdxGiOxOz3dem1a3F6LmqGuBY6+vQAR9P13A=; b=LVcWDI1ik8/xXBASeGWpELytV +yI9UA5Z92sdekzUmP3PWOFpnOo3H6pOhscanCfV9VHlSF0c4TiWvXcCgRChw2/q/b0IvrJ3uudxo ncaaIucDQOdqo2/VSqHeiz7hS8/dYiCin3zcgedP6yVHeLCS1jxnMg730Nr99lWaFV5D93iWz1bS9 BADJIkUWZ2nI8W4YaY2qzR9RrlKfL4CnEGyUVOjfB1021FZI1HPj5D1PD1MpKf2bwV8hKECcRZ+C+ LiKKyiOZDeb4lDiToguV8J87pVyEZZ9xKiwsJMTJPD+rt7Sbdi+XZbIdnWnwfHAFAnIQ7M2aEmloO LKOvo3vJw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPP8N-001O1f-Sh; Thu, 25 Mar 2021 12:30:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPP8G-001O0J-E6 for linux-arm-kernel@lists.infradead.org; Thu, 25 Mar 2021 12:30:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC72A1474; Thu, 25 Mar 2021 05:30:34 -0700 (PDT) Received: from [10.57.50.37] (unknown [10.57.50.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 23AFC3F792; Thu, 25 Mar 2021 05:30:34 -0700 (PDT) Subject: Re: [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues To: Tian Tao , will@kernel.org, mark.rutland@arm.com Cc: linux-arm-kernel@lists.infradead.org References: <1616656584-22658-1-git-send-email-tiantao6@hisilicon.com> <1616656584-22658-5-git-send-email-tiantao6@hisilicon.com> From: Robin Murphy Message-ID: <7d90b0dc-15db-c967-4ba9-3da728d6133b@arm.com> Date: Thu, 25 Mar 2021 12:30:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1616656584-22658-5-git-send-email-tiantao6@hisilicon.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210325_123036_922324_8FAE7B60 X-CRM114-Status: GOOD ( 17.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-03-25 07:16, Tian Tao wrote: > no functional changes. > > Fix checkpatch error: > ERROR: do not use assignment in if condition > #210: FILE: arm_pmu_platform.c:210: > + if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) { > > Signed-off-by: Tian Tao > Signed-off-by: Junhao He > Signed-off-by: Qi Liu > --- > drivers/perf/arm_pmu_platform.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c > index 933bd84..11b47c6 100644 > --- a/drivers/perf/arm_pmu_platform.c > +++ b/drivers/perf/arm_pmu_platform.c > @@ -191,7 +191,7 @@ int arm_pmu_device_probe(struct platform_device *pdev, > const struct of_device_id *of_table, > const struct pmu_probe_info *probe_table) > { > - const struct of_device_id *of_id; > + const struct of_device_id *of_id = NULL; > armpmu_init_fn init_fn; > struct device_node *node = pdev->dev.of_node; > struct arm_pmu *pmu; > @@ -207,11 +207,13 @@ int arm_pmu_device_probe(struct platform_device *pdev, > if (ret) > goto out_free; > > - if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) { > + if (node) > + of_id = of_match_node(of_table, node); Looks like you could probably refactor the whole thing to use of_device_get_match_data() and make it even cleaner. Robin. > + > + if (of_id) { > init_fn = of_id->data; > > - pmu->secure_access = of_property_read_bool(pdev->dev.of_node, > - "secure-reg-access"); > + pmu->secure_access = of_property_read_bool(node, "secure-reg-access"); > > /* arm64 systems boot only as non-secure */ > if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) { > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel