Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1212895rdb; Mon, 19 Feb 2024 07:46:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxuYvI3XvoDocnNYKB5lbqauP+FVheFDg53+ZGDyP3ucB+fz53s8cU9qTTVmoqmrl682rHkZ3ZKiZ6dbKjSdPQ+QOQybY/U5ypmKqe3Q== X-Google-Smtp-Source: AGHT+IGvzxePrhVK0aG6t1DIxVC8CXWsqeZFsEww/GU+f4ayk13fK0qN7mxVukWLwT7ITc+SpXvp X-Received: by 2002:a05:6a00:987:b0:6e3:79ba:6eed with SMTP id u7-20020a056a00098700b006e379ba6eedmr8863835pfg.13.1708357618472; Mon, 19 Feb 2024 07:46:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708357618; cv=pass; d=google.com; s=arc-20160816; b=tyihqFAQAgn/rb+1g2ymqiC49lwo2sjt8nToBvF8Czy4j8wE/nPptfeRylXhY7q4pI tVF+UyZqxx7uCV82vBTLQoQdEFbu+Bfn4+iyKbfcWDKvdmkg6GLEK+t8eJSBXrGt47Et VgtMU7ufOKxXWNDBXiQSIA5V002S6mR6A1WmauAzj8qsew8n7AFtm59uJ1iUQrld/Im2 UyDlXy6PpSirJkYLK0q2rLF5FIzYTFv8pcKuJebYczPQqZUuMzoc2JI0gt57Y17R7m2o A6877VzWUKKvAy7QiMyNjdWy4w7myuYHL/Gn6GsUJpEEvzDLoM+dagq12eDe+EQirbRM NLww== 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=GiuZLRYEVwV3o5ZU13ULh9rd7MPamxD3qITqPsHLHmU=; fh=29dbGj8+3BfiF/9b2pb/+gXgcD5BroJWxY7wK289m6M=; b=HeGaUQPAnU9ToHWE/P4ZB06DeiDYZAuiYVp9MOo8eLxG8WqT/D9c1VhlLFIjKWrrqX ClaYIXdCZIY9mLHSgCwG4ArK6oIy7dFruB92uyE37Gayrad2KsZr+SyJnBcKYnpmkVhQ DYcjoqMYX0AyEezcXqD4V2MBft0AapLiFqIqSxI8Q3AeMerJYAxquQAOYCWUkMkP7f4+ X2EdlChamzCMXvsKskj14YbNRo+tcdI1252fltSugVXOBONgecOVtEIR8td3pbv5gNSa i3bqB4uv8WKc2lN5uATZY5X1RBT6PNYHJBrcSWSxpF7zScN9fsV1c1ckFwvI3StvVkCt iT8A==; 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-71593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b14-20020a63340e000000b005cfd3333850si4653597pga.106.2024.02.19.07.46.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 07:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-71593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71593-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C38FB22045 for ; Mon, 19 Feb 2024 15:37:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01B3739FEC; Mon, 19 Feb 2024 15:37:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DDDA383BE for ; Mon, 19 Feb 2024 15:36:59 +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=1708357021; cv=none; b=rBlrERTVQKQGs8Ow2CxLTqBSzQxzwZOJB5LmIxsxmoqW4IKojsghwU4E5p/3TdZ/Gjtk6wikEjA4u5MdNkoajv3ywuVF+d3BAzoGOGnQ7OLKQn1FIXh+UoTx/TKzXJI8udLpnj9L8GRq6ZLTe3gOxjLglzR+iKnxW+UqptjRUQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708357021; c=relaxed/simple; bh=8KZpnnBsbpLu8GE2mANOnSknsqHAGg5dhZ59vdXuTiA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=c4vWuNluxRSjE8aT/ajV+gW8aaBF+if54HtrKHVlgBGuGy0AUImXzjFJhTE3sKpjOZRsovg337R7BBc1pHKRdXk5PALqKTsEo3juHyLBztLRQ4c6knO7qKKAbkGKjOWFaFzAzSCZBAXsX3gfSGdwYuSMdfeeZvq4dff4kNxrAXs= 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 69841FEC; Mon, 19 Feb 2024 07:37:39 -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 EF6873F7CE; Mon, 19 Feb 2024 07:36:57 -0800 (PST) Message-ID: <9bdf420c-f716-2a18-4b68-a8c6331eeb39@arm.com> Date: Mon, 19 Feb 2024 15:36:56 +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] coresight: constify the struct device_type usage Content-Language: en-US To: "Ricardo B. Marliere" , Suzuki K Poulose Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Mike Leach , Alexander Shishkin References: <20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net> From: James Clark In-Reply-To: <20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19/02/2024 13:43, 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 > --- > 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, Reviewed-by: James Clark