From patchwork Fri Jan 5 12:33:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 185381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6189186dyb; Fri, 5 Jan 2024 04:33:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdE2jfReE//at96q0JkC8OIIH/1kDbyqDSUDalISqwthpTUnNfGxxK+D0xoIEN2koin4vd X-Received: by 2002:a17:902:d2cb:b0:1d3:b3b7:5db0 with SMTP id n11-20020a170902d2cb00b001d3b3b75db0mr2200802plc.4.1704458031641; Fri, 05 Jan 2024 04:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704458031; cv=none; d=google.com; s=arc-20160816; b=mD0CIFBu5ZizSGrMORIz302H2chkAFjeFp129WldTCef2iTNOzAAwBUfoQLwTPMzRO 6MZQyhgygaf48/2jCJY2uAaNKGNorKcHqupGyFz9NFr7AW/k+OMslsmWlcA2VFosz9pA xh2/OULFGzJZDfRUAqjC74pBTyKjF/H/VggRiuAeKYeEKHWWG4t8KcaU9W+QuwG2sC7h 1aPast/q0yuNGjj+QqAFfxpAT/Bjfrqwd+kZ/Ok/mUVhD60ysSY3TzzjrDd0CGIe7Dk2 NmMKs/Injx1CI9Z5Xt+qhs6GxhxilfVqzEMKeUJtT0ZJZGw7oPF3PVnr/FDARSiccx0t mdzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ZjRWT2DI8vGkPYbQrvBWB+cjIDt1hc8Jp1Jt+w+pbsY=; fh=TvkxjC+L7Jwn6f1lKNjkHAv80WBjATGt7ioyQlljCk4=; b=Oc+LI7B1wJhRikjQ5oXsdE0oDY18Kb4YKrzNjooyDpzcD6efdJSn0BUPunqTHj6Fc3 iKH7lCOG8OTH1LMSAeMk1HzwmBs1enXaO5MuNcVGoJY/baVIlELoUVQQrwR6tfg04qvl QdMrTOHOUzrxGMeZgzVm46RkpARzzwEKzZcwow54zUEj9asCDGLKIxEPPYCXKsRkT1w2 S+ZGPjLVc8qnkT1PImn2pcvRobeiQOTu1raOOiNuf1rIcEygpjw53zj4d9/fqE9OIYQ2 meoBB7mV08ReUNhALYppm/mrk0s0ylsV0wpktQjUNn2kDgs5sV5zU8jKCl0gEbtjyolL L5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CTf4U0Qp; spf=pass (google.com: domain of linux-kernel+bounces-17832-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17832-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jd2-20020a170903260200b001d4af764023si1138208plb.368.2024.01.05.04.33.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17832-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CTf4U0Qp; spf=pass (google.com: domain of linux-kernel+bounces-17832-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17832-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 67CCE2864BD for ; Fri, 5 Jan 2024 12:33:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD4C12D611; Fri, 5 Jan 2024 12:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CTf4U0Qp" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 170D72D602 for ; Fri, 5 Jan 2024 12:33:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BE7DC433C7; Fri, 5 Jan 2024 12:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704458016; bh=Tyh7Z/guTSNA99TOFNxVkN5Bd/C6PszkdiWF0BBoAEA=; h=From:To:Cc:Subject:Date:From; b=CTf4U0QpP32A3rDra6b0HkUE0k4EoPr1rDFnEFRVYD5psD31yheYu2gfdHrPsicSu RnDjeBbaUsmWcxMGAd/1CXmW0to/3nF88dk1gzpCY/Y4f/hnY5KrHdLPXUfv3DQDKX gGbQl9L+xm38tIw1TUFA/70OxFA8aCfT2HxklFmE= From: Greg Kroah-Hartman To: coresight@lists.linaro.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , Alexander Shishkin , linux-arm-kernel@lists.infradead.org Subject: [PATCH] coresight: make coresight_bustype const Date: Fri, 5 Jan 2024 13:33:32 +0100 Message-ID: <2024010531-tinfoil-avert-4a57@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 45 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Tyh7Z/guTSNA99TOFNxVkN5Bd/C6PszkdiWF0BBoAEA=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnTv0vrHt6h7lFywvcia+X1LYL2J1OZI543dq+9IcGin RB3Q+B/RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzksAbDgn3FYtYusywm7Yhw va6/sMv5p+bnOIYF16NW9tdJK3FlOyWK/09RSJzBZaABAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787253785454998976 X-GMAIL-MSGID: 1787253785454998976 Now that the driver core can properly handle constant struct bus_type, move the coresight_bustype variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Suzuki K Poulose Cc: Mike Leach Cc: James Clark Cc: Leo Yan Cc: Alexander Shishkin Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-core.c | 2 +- include/linux/coresight.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 9fabe00a40d6..24c49e581737 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1796,7 +1796,7 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict, } EXPORT_SYMBOL_GPL(coresight_alloc_device_name); -struct bus_type coresight_bustype = { +const struct bus_type coresight_bustype = { .name = "coresight", }; diff --git a/include/linux/coresight.h b/include/linux/coresight.h index a269fffaf991..8fe75a0d7693 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -35,7 +35,7 @@ #define CORESIGHT_UNLOCK 0xc5acce55 -extern struct bus_type coresight_bustype; +extern const struct bus_type coresight_bustype; enum coresight_dev_type { CORESIGHT_DEV_TYPE_SINK,