Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp445589rdd; Tue, 9 Jan 2024 08:49:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPMq0nI61UInrogs7ZHilQOPe5WkYe8xrCUCE+va6VFzt71QYj1nczCTAhzOhVJxPmgAeo X-Received: by 2002:a17:907:7e9b:b0:a28:cf39:bf68 with SMTP id qb27-20020a1709077e9b00b00a28cf39bf68mr903231ejc.115.1704818960779; Tue, 09 Jan 2024 08:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704818960; cv=none; d=google.com; s=arc-20160816; b=ZD/pm4HnqnuSzbyBEs3ye6TbUNnVeOw+G+bePTygvdx4avfbAQ6XHzt7x0QGXr6JBw BUKtPenOHEAB4fCBymq8lWr4KYJlmnsxt/DXzlow0tOBPiKFAn1k2BvgiFvaAsH9rPVL rzBCcTTTF9IyPxxlqIiN9jOTMGyATkMuj6Q7WM9jJYnzzIgsciJDymWOiFHmnHeVuOD+ 3AS0wyiB0GKx1De3BccyQ6udMcblZkDQe6YX6W7EbN27xBOrrV8NDcU86UPM/r5uxuFo RfiK7OVJGUVb+gAt+Brq75huKNyXcMB7R8FXoE0QpsRh1mwSc0+9Yp1MgcNZgBMjo+dQ vhXw== 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=d9Xs5xtblyEY0iOT2dKqitn2mkNDXq6AEKH5kJMtGvY=; fh=Ta6s8fnpyEYRYHUSZY73Y8u8Y61SN8ZtFCHovVzIbMQ=; b=iNdll4DrxeDkF8A1t7s0JwfSzqTHMqlvyvCO/kl8gJNbeCGhUainr8ainhyV8vavKS drsnUaHvNBHvvbfyueq65pHWmtcGn4Df0PJkTfDxIyyQ5Q42nUmvAe2SP8ev3T8R9V0Y Vg7srsVfvBski+u48lwEhby2mCqt33el8PDid9c8i9iEew9ecsvokA4hw4Uoccr428NB meihc3P/O+Va+icf5pJvtlnX9pqsIh+/2JNQspRTLaTfmQta3sYZZ9XTkthLTKcccSOX krHp4wgwD6eGzikUIV6vl5Lz+TJgaQyKd2OM882Z54iUH9fpVWYpTyBHs4LBk/ozQEVd fbOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a8-20020a1709062b0800b00a2a48b751a1si915139ejg.1022.2024.01.09.08.49.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:49:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21131-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 83FEC1F26171 for ; Tue, 9 Jan 2024 16:49:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA8923A8DB; Tue, 9 Jan 2024 16:49:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3331438DF8 for ; Tue, 9 Jan 2024 16:49:00 +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 EF633DA7; Tue, 9 Jan 2024 08:49:44 -0800 (PST) Received: from [192.168.1.100] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 394023F5A1; Tue, 9 Jan 2024 08:48:58 -0800 (PST) Message-ID: Date: Tue, 9 Jan 2024 16:48:57 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 8/8] coresight: Remove unused stubs Content-Language: en-US To: Suzuki K Poulose , 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-9-james.clark@arm.com> <01c15dbe-57d3-4aa1-9d68-81a01ec2a3a7@arm.com> From: James Clark In-Reply-To: <01c15dbe-57d3-4aa1-9d68-81a01ec2a3a7@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 09/01/2024 10:38, Suzuki K Poulose wrote: > Hi James > > On 12/12/2023 15:54, James Clark wrote: >> These are a bit annoying to keep up to date when the function signatures >> change. But if CONFIG_CORESIGHT isn't enabled, then they're not used >> anyway so just delete them. >> > > Have you tried building an arm32 kernel with this change in ? Looks like > arch/arm/kernel/hw_breakpoint.c includes linux/coresight.h and a build > with CONFIG_CORSIGHT=n might break the build ? So is arm32 and CONFIG_CORESIGHT=n works because hw_breakpoint.c doesn't use any of those symbols, only #defines that were outside the #if IS_ENABLED(CONFIG_CORESIGHT), specifically CORESIGHT_UNLOCK. > drivers/accel/habanalabs/common/habanalabs.h. Now, I am not sure if they habanalabs is interesting, it depends on X86_64, but CONFIG_CORESIGHT depends on ARM || ARM64, so I think we can assume it's also only looking for #defines and inlines, and not actual code. Either way I can't find any build config that actually ever built this, meaning it's always been dead code. I would have expected some build robot to have flagged an error by now as I've seen that on other coresight patches. > really need it (even if they do, we may be able to remove the dependency > on the header file. > They do really need it, also for the CORESIGHT_UNLOCK definition, but not any functions. > Suzuki > >> Signed-off-by: James Clark >> --- >>   include/linux/coresight.h | 79 --------------------------------------- >>   1 file changed, 79 deletions(-) >> >> diff --git a/include/linux/coresight.h b/include/linux/coresight.h >> index 4400d554a16b..c5be46d7f85c 100644 >> --- a/include/linux/coresight.h >> +++ b/include/linux/coresight.h >> @@ -391,8 +391,6 @@ struct coresight_ops { >>       const struct coresight_ops_helper *helper_ops; >>   }; >>   -#if IS_ENABLED(CONFIG_CORESIGHT) >> - >>   static inline u32 csdev_access_relaxed_read32(struct csdev_access *csa, >>                             u32 offset) >>   { >> @@ -611,83 +609,6 @@ void coresight_relaxed_write64(struct >> coresight_device *csdev, >>                      u64 val, u32 offset); >>   void coresight_write64(struct coresight_device *csdev, u64 val, u32 >> offset); >>   -#else >> -static inline struct coresight_device * >> -coresight_register(struct coresight_desc *desc) { return NULL; } >> -static inline void coresight_unregister(struct coresight_device >> *csdev) {} >> -static inline int >> -coresight_enable_sysfs(struct coresight_device *csdev) { return >> -ENOSYS; } >> -static inline void coresight_disable_sysfs(struct coresight_device >> *csdev) {} >> - >> -static inline int coresight_timeout(struct csdev_access *csa, u32 >> offset, >> -                    int position, int value) >> -{ >> -    return 1; >> -} >> - >> -static inline int coresight_claim_device_unlocked(struct >> coresight_device *csdev) >> -{ >> -    return -EINVAL; >> -} >> - >> -static inline int coresight_claim_device(struct coresight_device *csdev) >> -{ >> -    return -EINVAL; >> -} >> - >> -static inline void coresight_disclaim_device(struct coresight_device >> *csdev) {} >> -static inline void coresight_disclaim_device_unlocked(struct >> coresight_device *csdev) {} >> - >> -static inline bool coresight_loses_context_with_cpu(struct device *dev) >> -{ >> -    return false; >> -} >> - >> -static inline u32 coresight_relaxed_read32(struct coresight_device >> *csdev, u32 offset) >> -{ >> -    WARN_ON_ONCE(1); >> -    return 0; >> -} >> - >> -static inline u32 coresight_read32(struct coresight_device *csdev, >> u32 offset) >> -{ >> -    WARN_ON_ONCE(1); >> -    return 0; >> -} >> - >> -static inline void coresight_write32(struct coresight_device *csdev, >> u32 val, u32 offset) >> -{ >> -} >> - >> -static inline void coresight_relaxed_write32(struct coresight_device >> *csdev, >> -                         u32 val, u32 offset) >> -{ >> -} >> - >> -static inline u64 coresight_relaxed_read64(struct coresight_device >> *csdev, >> -                       u32 offset) >> -{ >> -    WARN_ON_ONCE(1); >> -    return 0; >> -} >> - >> -static inline u64 coresight_read64(struct coresight_device *csdev, >> u32 offset) >> -{ >> -    WARN_ON_ONCE(1); >> -    return 0; >> -} >> - >> -static inline void coresight_relaxed_write64(struct coresight_device >> *csdev, >> -                         u64 val, u32 offset) >> -{ >> -} >> - >> -static inline void coresight_write64(struct coresight_device *csdev, >> u64 val, u32 offset) >> -{ >> -} >> - >> -#endif        /* IS_ENABLED(CONFIG_CORESIGHT) */ >> - >>   extern int coresight_get_cpu(struct device *dev); >>     struct coresight_platform_data *coresight_get_platform_data(struct >> device *dev); >