Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp755247rwe; Wed, 31 Aug 2022 10:21:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ohvA+NsRPOHqToXy1jNeAjjT6KNZ+lScB/Lq8q+H8v4XdPxKWkxO1qv1d4QRUlL26KgcS X-Received: by 2002:a17:902:f64a:b0:172:7576:2124 with SMTP id m10-20020a170902f64a00b0017275762124mr26073959plg.155.1661966500531; Wed, 31 Aug 2022 10:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661966500; cv=none; d=google.com; s=arc-20160816; b=C2ClICU6BbRQ3D1JWxO4/aaPnP77m/lAOOsvo3tJftebDjmITsqBtZ7P1fsheTLTVD U7pR4CWTrq7K5XunmGawm6IFtuhTn9ryYA+qNGO3nPyKEowJwhSmleO3zodjzNRGiqtP +hNKnmCELIELU/GkI91+UMXto1bCS44EMKDKqDHSzeaiD4S41yTyotvAJ6hsmDIPSqiG rcGKJXlM3+c/BF4KJGEkV2YRZEyLCHW3NEmJ88Z5o+ixYJcYDxbH+FvvBDElzU1JlILT 0cJNF9xWdzIp5AhQu2DGhttOXTSIf/dpYjFD1PIvEh0RdFmZ9fjXpMpwJLJS5V/kWV7i 2HuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TupKKvR6dZz/3iGpRAyOcguuOG/Q6iuwOMieQ0bzyVU=; b=qCspcAfb/w+cJqrsvUuheZXm7T+68/PVaYH6yb/R9e/WBU0Le4JFmko86iHA0SVy3W 0a4SX2Wpoj2Cd/bT6Nc3Q2P64LOUx28AfnUz3wGopiSukilQTrkB/RQE58KF0IuKcVxU EL5CvOvEkvZJ+rfiNk39ufzTORNI9S3THO34t0HTRWCWyJzNbjWFnDiY4rWc/JaJ5c6m qFntB82iAsnmGjE2i2rQa3QgyHiPnghUFNFM6/4b7jFWId9+IsrRnyHnwF7M5Ypl2u51 qI9mnpTMfR7f4w2uEhuIAjPbG8MuLB3shi7g53EOENrPOoOFSuMukFHBnQzc2WcIn233 3L7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uSF2CEdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw17-20020a17090b4d1100b001f5902550c5si2516344pjb.155.2022.08.31.10.21.02; Wed, 31 Aug 2022 10:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uSF2CEdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbiHaQ7y (ORCPT + 99 others); Wed, 31 Aug 2022 12:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbiHaQ7X (ORCPT ); Wed, 31 Aug 2022 12:59:23 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8AFE0960 for ; Wed, 31 Aug 2022 09:58:28 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id fa2so7020296pjb.2 for ; Wed, 31 Aug 2022 09:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=TupKKvR6dZz/3iGpRAyOcguuOG/Q6iuwOMieQ0bzyVU=; b=uSF2CEdt7dbN626BZ+yeyXPs6NUKow3AXH68ik8oWTc9KRrPdpTHY0tvt4iy05cXPo Gjf098D8/sguiFHNa5vvueI29pc24OwxK9+oZLZHGj40yyewW47G7GEUu1nZr1HJvsgR Vx7uhEjIqSLjUdpTvFnC/Y+8sbJZhb2biBPPm+R8vc8zAiIat69QzHj2M4lRPFWMu2nR 2sg+Ak8gYSSbZXxEAYFBHTmJuPxQJkTmcjUGgc5GVn5zxukfragxRf9Rw7gEhoSjyNm1 ghvd5lGDw882s+erKsZyb+B+U8/31I96vFEjc383BYQPVJMtPuZEcgPycgx6i39+8yvp 9Hjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=TupKKvR6dZz/3iGpRAyOcguuOG/Q6iuwOMieQ0bzyVU=; b=hZMXMinMG+RD9akXC9VfrgjE49SGLcr0p7V4nKBHj13+vgrgNH8lg5UCuYNg5JbHIL krVY3acvdQBbohYpvO0DmP7S6a89ljzyrL2PpQ1mCQ9nuVpUeSLVDRUI54eSmWF0/j38 qhTIipvYtmBw65c+U4ErghF8rHk+ugN9P18JOyZfFegBBVwlm+NU5WX83eqkPS7fF8ta DqsSOWrRhW6OE54o+76OJEFfLSVnXMMc/FtJbtj02Kh/gScZud8w9wtpKOvJg3rF2fmw Dij6iTFZ9wq8LTyksbwTvY72LBXej5Q4G/fYXhBkuBMDL7fKKy+Y7E+w8f5MbOnr2OR4 VO7A== X-Gm-Message-State: ACgBeo0sSNEAD+kPbADI0K7QE6l4ah7PZAmXWQxsqNYyVCO7yCjSoKBP T3X+Z4JOU3/AqkreYa8e0eLjM0xj2O54DQ== X-Received: by 2002:a17:902:d509:b0:16f:1e1:2067 with SMTP id b9-20020a170902d50900b0016f01e12067mr26137455plg.140.1661965107344; Wed, 31 Aug 2022 09:58:27 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id p12-20020a635b0c000000b0042a713dd68csm3590306pgb.53.2022.08.31.09.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 09:58:26 -0700 (PDT) Date: Wed, 31 Aug 2022 10:58:23 -0600 From: Mathieu Poirier To: James Clark Cc: suzuki.poulose@arm.com, coresight@lists.linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org, german.gomez@arm.com, Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v2 0/5] coresight: Reduce duplicated sysfs accessors Message-ID: <20220831165823.GB217472@p14s> References: <20220830172614.340962-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830172614.340962-1-james.clark@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I have applied this set. Thanks, Mathieu On Tue, Aug 30, 2022 at 06:26:08PM +0100, James Clark wrote: > Changes since v1: > > * Keep existing signed offset value types until the very last commit > and then remove them all at once > > * Also split out usages of read_pair() and read32() into separate > functions in the last commit > > * Whitespace fixes > > * Replaced any touched scnprintf() with sysfs_emit() > > ====== > > The intent of this change is to reduce the large number identical of > functions created by macros for sysfs accessors. It's possible to re-use > the same function but pass in the register to access as an argument. > This reduces the size of the coresight modules folder by 244KB. > > The first two patches are refactors to simplify and remove some dead > code, and the second two are the changes to use a shared function. > > Testing > ======= > > No changes in any of the outputs: > > cat /sys/bus/coresight/devices/*/mgmt/* > before.txt > cat /sys/bus/coresight/devices/*/mgmt/* > after.txt > diff before.txt after.txt > > With the following modules loaded: > > ls /sys/bus/coresight/devices/ > etm0 etm2 funnel0 funnel2 replicator0 tmc_etf0 tmc_etf2 tpiu0 > etm1 etm3 funnel1 funnel3 stm0 tmc_etf1 tmc_etr0 > > > James Clark (5): > coresight: Remove unused function parameter > coresight: Simplify sysfs accessors by using csdev_access abstraction > coresight: Re-use same function for similar sysfs register accessors > coresight: cti-sysfs: Re-use same functions for similar sysfs register > accessors > coresight: Make new csdev_access offsets unsigned > > drivers/hwtracing/coresight/coresight-catu.c | 27 +-- > drivers/hwtracing/coresight/coresight-catu.h | 8 +- > drivers/hwtracing/coresight/coresight-core.c | 28 +++ > .../hwtracing/coresight/coresight-cti-sysfs.c | 213 +++++++----------- > drivers/hwtracing/coresight/coresight-etb10.c | 28 +-- > .../coresight/coresight-etm3x-sysfs.c | 34 +-- > drivers/hwtracing/coresight/coresight-priv.h | 74 +++--- > .../coresight/coresight-replicator.c | 10 +- > drivers/hwtracing/coresight/coresight-stm.c | 40 +--- > .../hwtracing/coresight/coresight-tmc-core.c | 48 ++-- > drivers/hwtracing/coresight/coresight-tmc.h | 4 +- > include/linux/coresight.h | 23 ++ > 12 files changed, 227 insertions(+), 310 deletions(-) > > -- > 2.28.0 >