Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2131717rdb; Tue, 20 Feb 2024 19:40:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV2shYHS24gAmJgG6XxiaNDnKe6RCRl6/Deii/jdQ9soOZiq8uFE9w0DEzgKPG7S/oim1Xx4gcI7WY64xNMGXgkrougcx63mDvSlXvZ8w== X-Google-Smtp-Source: AGHT+IEibgb/QTPJqTqtEMZvLJ48opcQV6g79GKm9nlTH+SRg02AqCNFhNYVSum1JcXTDL62XXvu X-Received: by 2002:aa7:c44d:0:b0:564:7bed:b866 with SMTP id n13-20020aa7c44d000000b005647bedb866mr5015444edr.23.1708486805602; Tue, 20 Feb 2024 19:40:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708486805; cv=pass; d=google.com; s=arc-20160816; b=KWt8wfbPGpRbt5C3xsewbt3t66Lvbf3ysf9O2f/3KBKE3DvJvtfaGf3P7YnjKiiaaP CMtLQ2x5s53WdOIJB/a1OxmA9QQVV5A6OY+r/W3nnAB1z20MdntXfkfznfD3N4ljasqZ B/f3kyg2Z8DjBN4G4L1SO+SYa2Wcg7V7yGqkLf+pyXU+3MsvMAe59SrN7LWcdooDaRwA wfc1lUepO5gB5Rpc8bDk0wfHvayuAqMCy2UDxDymDRsa5YTWqypUDkPqbNoVPBkSWBzZ 0sjwtR4X5i41uMWtEFs+mOEbiAc0jn56JcNEVp7B9ZiGZUufqP/D6x829nVQPO2kOwZW rGSg== ARC-Message-Signature: i=2; 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=n/83AB6kSlI2d9D4pznTZlS4/6RgTBZUwHHVykv1DhI=; fh=Yi3s0pgPG8BSArtdBL5UQeA4IECm2Kvb6kF2liOZ71I=; b=iOn43aQQOghneUxAQj8yI5ypxR7sApEDhDn7FekUSvBtiuXK3U8E7ON3+YTKva7I3Q kyTud7zQBwLjNxJov3yDL0FJsQYP7eizxJ+WdipVus32bSiHFa3dW1fQP4JKam/EsE8W /LUKlf0seTXhoPEYmLhlWbEngf/r9tRmwUowVwIfe1pCSsAXDq/iNMVxXBwxgi7o8qon WWiUPuSBAQKj86S3LtAZig/9Sq7iFHnM6aZ9gS3z5zs+DjlZ1p09ePC1KRfE2xy5xl2W mLIMVnKKrLmjdicHK+ZOYqbgU9EpbxRnhZZ20dWXKDGzfEMwFCNsgvoACEB9n2h/Y2Dy yUcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74004-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. [147.75.80.249]) by mx.google.com with ESMTPS id n22-20020a05640206d600b00564ab54f575si1647952edy.468.2024.02.20.19.40.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 19:40:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-74004-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74004-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 55DB91F253D2 for ; Wed, 21 Feb 2024 03:40:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CD9D38DCC; Wed, 21 Feb 2024 03:39:58 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 349DC23C9 for ; Wed, 21 Feb 2024 03:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708486798; cv=none; b=k8XMp87BdIX04uUTp4CgnEuFlNJSv3vRZLl9gt+R8jAYkJyF3BPhygmqPDXgM2uEGplMzCIGDPl3Z0lQ2N4G7E4YNv50ZI2hrffOa1k/FnJvRIhlVhG08nmoWKbVOOZKqN9rAa0bQp/FfjE27XqM/JpqPxMSjYf5XvTFtj9r044= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708486798; c=relaxed/simple; bh=aRGRT/EULKL0RNug/P+QJ3+WKZdIcrq2nA16Ay6NTmo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MnrSyRduMBaxYRdVjdHbpGeFujFllCoEXjIF4XAyQ+K6DgBGbrhgxcO/oBX57/5nfmZPiWuarGUtJ6k7tQJYonvlFTYh3nKhR4LNC7rvDtrwIOOoApniuh0M7j/ZWfIuBPFgSRi99uz0A3U5N7cWI7ga3s+n2S5rnvekV+VVzQ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 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 9DB411007; Tue, 20 Feb 2024 19:40:26 -0800 (PST) Received: from [10.163.46.138] (unknown [10.163.46.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 389DE3F766; Tue, 20 Feb 2024 19:39:44 -0800 (PST) Message-ID: <3b400f7d-f76c-4e54-92d9-7ece7f712ea8@arm.com> Date: Wed, 21 Feb 2024 09:09:41 +0530 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] coresight: constify the struct device_type usage Content-Language: en-US To: "Ricardo B. Marliere" , Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman References: <20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net> From: Anshuman Khandual In-Reply-To: <20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/19/24 19:13, Ricardo B. Marliere wrote: > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > core can properly handle constant struct device_type. Move the > coresight_dev_type variable to be a constant structure as well, placing it > into read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere > --- Reviewed-by: Anshuman Khandual > drivers/hwtracing/coresight/coresight-priv.h | 2 +- > drivers/hwtracing/coresight/coresight-sysfs.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h > index eb365236f9a9..ca3362cbdb70 100644 > --- a/drivers/hwtracing/coresight/coresight-priv.h > +++ b/drivers/hwtracing/coresight/coresight-priv.h > @@ -13,7 +13,7 @@ > #include > > extern struct mutex coresight_mutex; > -extern struct device_type coresight_dev_type[]; > +extern const struct device_type coresight_dev_type[]; > > /* > * Coresight management registers (0xf00-0xfcc) > diff --git a/drivers/hwtracing/coresight/coresight-sysfs.c b/drivers/hwtracing/coresight/coresight-sysfs.c > index f9444e2cb1d9..1e67cc7758d7 100644 > --- a/drivers/hwtracing/coresight/coresight-sysfs.c > +++ b/drivers/hwtracing/coresight/coresight-sysfs.c > @@ -377,7 +377,7 @@ static struct attribute *coresight_source_attrs[] = { > }; > ATTRIBUTE_GROUPS(coresight_source); > > -struct device_type coresight_dev_type[] = { > +const struct device_type coresight_dev_type[] = { > [CORESIGHT_DEV_TYPE_SINK] = { > .name = "sink", > .groups = coresight_sink_groups, > > --- > base-commit: c099fdd218a0fedfe87e0b88d2ba0667eab3b3c8 > change-id: 20240219-device_cleanup-coresight-00ba00fd5f21 > > Best regards,