From nobody Sun Feb 8 17:23:30 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 019F3745FA for ; Mon, 29 Apr 2024 13:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395716; cv=none; b=aeiIMe8MUk94gcu7OxwBthYx+cp4tfN++EksOLsGVbk330Ch9SlILY1GntSq6DuV2qS1Ry0AXrY5CEubHUDMd9Bxx9kSzepUpUUQL1k5ozHrhru2hNpZoM7sj8jMoiXzhmjisVDMbPpqgI/h30kGaWFPR8mLdu2wNQU9+XmmYtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395716; c=relaxed/simple; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SxIwMYai4PbhHQ8w8ZecOw0AGTMby4XKVy1WtINzIaoq5Sq61v8NEc9TE0TPeOV182NxcSuapAgBskYyssYC6tMLHESBC5fDhiT9/En6gHk77bvjmbA7LFwNw7Ll2CI9V4OQdQQVG8NBbntWt6nW/TasibslwreZupJiBwzlci8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GZs8e3ZS; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GZs8e3ZS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714395715; x=1745931715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; b=GZs8e3ZSnJDAN2rzJSm15LblsPHdLcLtggo7FGjCnT7Zdhf4BaiaeOwg OBxf+QK1XYB+Vvf7FqT8yBgU1vLnx8K8JZHnGOHVajtpTy0JRNKi6UR3c 51kSfogjuREcib86SKD+tGOw2JYnOMs5JAIsn3xaapdJEJX1IpegbwAx2 NYLI+xsoVpzXnu6xRKYj9RCMhIuEo9pWuc1a2vgA9yuCoRZGwyc1+1oJV jjEus1izPt1iaX4RLN3GnIkNbFoCgYBn2hP3uZDMCYDLLmZHnS/21Wxhx 1+JZM9CCZnPixut/ah+5iIhwufmjzv6IuUsemoMYMwCURpjVX6MecHiwn Q==; X-CSE-ConnectionGUID: HaZVQfU3TJeRwQ+6GWm2Jw== X-CSE-MsgGUID: DXA0xUG6Qh+iIzAu1+XBwg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="12986879" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="12986879" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 06:01:54 -0700 X-CSE-ConnectionGUID: 0rsYsUexRiqHGuF/23yvhA== X-CSE-MsgGUID: RpVeWMmaSU+2si/LYMdpng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26507081" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 29 Apr 2024 06:01:52 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Alexander Shishkin , Andy Shevchenko Subject: [PATCH v1 06/15] intel_th: Constify the struct device_type usage Date: Mon, 29 Apr 2024 16:01:10 +0300 Message-ID: <20240429130119.1518073-7-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> References: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Ricardo B. Marliere" Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the intel_th_source_device_type, intel_th_output_device_type, intel_th_switch_device_type and intel_th_device_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Signed-off-by: Ricardo B. Marliere Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th= /core.c index cc7f879bb175..3511f3618f2d 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -180,7 +180,7 @@ static void intel_th_device_release(struct device *dev) intel_th_device_free(to_intel_th_device(dev)); } =20 -static struct device_type intel_th_source_device_type =3D { +static const struct device_type intel_th_source_device_type =3D { .name =3D "intel_th_source_device", .release =3D intel_th_device_release, }; @@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] =3D { =20 ATTRIBUTE_GROUPS(intel_th_output); =20 -static struct device_type intel_th_output_device_type =3D { +static const struct device_type intel_th_output_device_type =3D { .name =3D "intel_th_output_device", .groups =3D intel_th_output_groups, .release =3D intel_th_device_release, .devnode =3D intel_th_output_devnode, }; =20 -static struct device_type intel_th_switch_device_type =3D { +static const struct device_type intel_th_switch_device_type =3D { .name =3D "intel_th_switch_device", .release =3D intel_th_device_release, }; =20 -static struct device_type *intel_th_device_type[] =3D { +static const struct device_type *intel_th_device_type[] =3D { [INTEL_TH_SOURCE] =3D &intel_th_source_device_type, [INTEL_TH_OUTPUT] =3D &intel_th_output_device_type, [INTEL_TH_SWITCH] =3D &intel_th_switch_device_type, --=20 2.43.0