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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 918CBCDB474 for ; Mon, 23 Oct 2023 09:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wP4YzOXJnVn45XMwGI1/1rABT3IsYLeycnRNWyVsFRo=; b=FJF7SfEgW9+5Kv KMX08ZLCw1xOqMQJUhTzAw0fES3cx+/vRGXFOd5tVQ6M5fdTDUYUudEjF2+HCk/10MlzES7P/dlFz vHu1IjGhutJ/we55guPZkkGdJp+C+BPp4CMbqUtX+ymp7GSbATXfp28k4LQTAT1ZqEickQjCaPfku 2QYjrUm+Tb4SxCjMIwiSCrTFNHm+As00QQsgwbZW+FoCdckX0ikEsEfO5IFL2rnPmNnskBsP9IehE ItrTQGm9ByP9sy2CxxOhC0qvZcgch9s+FzmYbfuEJ64pKzpXL/NG2gvZ28xOMJLPRUHJ4DFj9CMfw TOraKQG6xOL202HzzpJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quqtH-006qll-2i; Mon, 23 Oct 2023 09:06:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quqtF-006qkS-1q for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 09:06:27 +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 55B532F4; Mon, 23 Oct 2023 02:07:02 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.70.183]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2BDBD3F64C; Mon, 23 Oct 2023 02:06:20 -0700 (PDT) Date: Mon, 23 Oct 2023 10:06:17 +0100 From: Mark Rutland To: Ilkka Koskinen Cc: Robin Murphy , will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, renyu.zj@linux.alibaba.com Subject: Re: [PATCH 2/3] perf/arm-cmn: Rework DTC counters (again) Message-ID: References: <5f6ade76b47f033836d7a36c03555da896dfb4a3.1697824215.git.robin.murphy@arm.com> <8e179525-bba-c577-85cf-4aa0a7af436@os.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8e179525-bba-c577-85cf-4aa0a7af436@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_020625_654334_2F5ED5BE X-CRM114-Status: GOOD ( 10.58 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 20, 2023 at 03:50:30PM -0700, Ilkka Koskinen wrote: > Hi Robin, > > I have one comment, otherwise the patch looks good to me. > > +/* @i is the DTC number, @idx is the counter index on that DTC */ > > +#define for_each_hw_dtc_idx(hw, i, idx) \ > > + for (int i = 0, idx; i < CMN_MAX_DTCS; i++) if ((idx = hw->dtc_idx[i]) >= 0) > > Isn't that "idx" unnecessary in the initialization? That creates the 'idx' variable that's assigned to by `idx = hw->dtc_idx[i]`, so that is necessary. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel