Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp234068rdd; Tue, 9 Jan 2024 02:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuHTMZK64O9jwwO5quTdnJC5iAQawtdGzNYBOaCEPxQCQSXSTEU0Ail+TkG1hZh0yTTVgt X-Received: by 2002:ac8:5c0a:0:b0:429:9733:4d0e with SMTP id i10-20020ac85c0a000000b0042997334d0emr616093qti.64.1704795751200; Tue, 09 Jan 2024 02:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704795751; cv=none; d=google.com; s=arc-20160816; b=mkvh7Yr/eFD7MPfvkDqjvdLhFUeOTsAG/ARAKrUdWzTyNF73fOjCnyzhhTlTtCd+wb KL2uwUtsx2qE0lsZCe+EuHmGFDZfFpxQZp1fABd3QwrvlcuZFKWH1varFSlGlwrkqmVP 4WKTzB1JH6pfxzN81RcfjjifYVISL5nc/rQan7JO27xmyMzTk8kYo1IwCGWJLzlHb+bZ s69z3e6M/EYjaBk7atsq8qk7VN6C/Ph8FrKNjkOx7luiNUNoxOMpAZVnnUgGVbwKzt3K w5FO2bL1+07c9AN6vxXcNOQRgJ0vnPYUCFI+tAauXCams8TDKlJXUce5J29UWmnjbo0v mAGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=dKy3wOXyfcrH46XGjCZ2p1VTX1fnn0CI/wq3WSSfdAQ=; fh=TzxcpWgMr0ZHRVWWO//RG91rk/VEV7I73tOUOq+KfKQ=; b=LZdfL9gz5c+cHsdrdfa/bI3ubi4SmyJ9BIiBjaWQTA+oLAlgVxUUZuxNebsKzIXk4R F7fhfpPu2xTQw5Un5HIo1/m+F5hfNF2AZLQMfInyG1ZcBwD4ePjeZby2fIhI9ZxJPgzs 7WO43xkUBbpT36b0ClTE8HEnbW/7hiax0EFc+7+onnnrbYBLR+zp9QXz9B2QqytJ9UbL Fx5OyFdIXgYXi2NMpUODzC2WsKT34iZ5IlnXtYAM/B6T23m5K00fUsuaqLwMcCjmprgI XPUZVsr/9j3ywla14sdJu8OFfH+ezmfdfLvT1P+x7kzlPhXEdyKmseqbHPTDhQO8zeo2 UUug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e17-20020ac84e51000000b004299b001255si1793042qtw.18.2024.01.09.02.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 02:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EFE141C245E8 for ; Tue, 9 Jan 2024 10:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B173364AC; Tue, 9 Jan 2024 10:22:22 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E119364A3 for ; Tue, 9 Jan 2024 10:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 41BAFC15; Tue, 9 Jan 2024 02:23:04 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 211BC3F73F; Tue, 9 Jan 2024 02:22:16 -0800 (PST) Message-ID: <1dcfd28c-78d8-4790-8c99-27e15989ca40@arm.com> Date: Tue, 9 Jan 2024 10:22:15 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/8] coresight: Move all sysfs code to sysfs file Content-Language: en-US To: James Clark , coresight@lists.linaro.org Cc: Mike Leach , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20231212155407.1429121-1-james.clark@arm.com> <20231212155407.1429121-7-james.clark@arm.com> From: Suzuki K Poulose In-Reply-To: <20231212155407.1429121-7-james.clark@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/12/2023 15:54, James Clark wrote: > At the moment the core file contains both sysfs functionality and > core functionality, while the Perf mode is in a separate file in > coresight-etm-perf.c > > Many of the functions have ambiguous names like > coresight_enable_source() which actually only work in relation to the > sysfs mode. To avoid further confusion, move everything that isn't core > functionality into the sysfs file and append _sysfs to the ambiguous > functions. > > Signed-off-by: James Clark The changes look good to me. One minor comment below. .. > +struct device_type coresight_dev_type[] = { > + { > + .name = "sink", > + .groups = coresight_sink_groups, > + }, > + { > + .name = "link", > + }, > + { > + .name = "linksink", > + .groups = coresight_sink_groups, > + }, > + { > + .name = "source", > + .groups = coresight_source_groups, > + }, > + { > + .name = "helper", > + } > +}; > +/* Ensure the enum matches the names and groups */ > +static_assert(ARRAY_SIZE(coresight_dev_type) == CORESIGHT_DEV_TYPE_MAX); As a general cleanup, while you are at it, could we please replace this with explicit member initialisers as a follow up patch ? i.e., struct device_typ coresight_dev_type[CORESIGHT_DEV_TYPE_MAX] = { [CORESIGHT_DEV_TYPE_SINK] = { .name = "sink", .groups = coresight_sink_groups, }, [CORESIGHT_DEV_TYPE_LINK] = .. } Thanks Suzuki