Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1309765lqa; Mon, 29 Apr 2024 05:10:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfkmuYr1FK2WX94KlLzVjXS/pgc9DEB0AFMn5nuBJvqC+WJRPpleMQrBRtsiFn/OvI2uM+YoOPtkp6cJT0U/tyklcYyovz67WusH3lVw== X-Google-Smtp-Source: AGHT+IGl4pcOiGAs8EHFhel/GjggG2jBhC1H7MQfhmPwyrTXIy2RDr4GZv9kvr4RGHUYWHZnPhFo X-Received: by 2002:a50:cdd2:0:b0:568:abe3:52b2 with SMTP id h18-20020a50cdd2000000b00568abe352b2mr9512164edj.23.1714392621799; Mon, 29 Apr 2024 05:10:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714392621; cv=pass; d=google.com; s=arc-20160816; b=Rtuk4RHRIi/7+vDSsZvC5Kw+1rIfPxneRF1O4Wwsbr74ApwhiY479ynrdDbweowLr3 iBzJNJh7ZJbOH40P+k1p0iuHKSBtJWY4jW0B9NQFCzUOKZYANvWzpha3M3jZJ7Xqt+9u 9oVDbAtK4ELzUj1ZBheABpSOOM/XjHjKJveJDYbdyN9qMBZ7dON918ztwnUiusXvEykc TYaTN4vudzCgh7BNkbTQcRH+r7dD+ZKq7bZucWniPFR8u3MV16Dp3wkNJdlCeSYLQ2/R BteSqVRf7c0TcosrxVhar2zatc1AbdiH3bFWZo9un116p2mBLzXsvugkV3YdNUOVfPZG uoTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kIGCyq4mPHrYN9vGA/0B3aWfkNGL28t22hNk2rt/JLQ=; fh=pRAMfx7ty+3URlRV6nW57SZLXO4nz5VCHsvNoAEerzo=; b=yl6GLBntnJ9G8sSvFQmEg6ofEiQnIjiCtxrQ2tBHRezpWs5o0xVGyoOyU2vL/cy6dV MurRmRM+17eAEoa0nwoPLI8CztEuqxQKZ9bM0xv1X/6MyRL0mSatNDEUV1/UCLA8uzht O/CloU/gDfrv2NTeVYL4xcaxRAK5e0eZkUSB4XPw8iijMI1OeBU8V4ku8lgZSxX3pRSx ueY4waHKuYooFgDDE96SsjdkMcVhjlCEmzfF2GzG3de5rS8J4H/f9T6Jd+6dr1KIwLXH 1Q0ASbH/hI5pV27/l2q5Au+GqZ6GVtPbQx69FVWG2YUqmnLwfN9py/4qAQv4E+eY/sZx kExg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dIv29yvj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162194-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162194-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q3-20020aa7d443000000b0057222c7dd89si7786549edr.640.2024.04.29.05.10.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 05:10:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162194-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; dkim=pass header.i=@intel.com header.s=Intel header.b=dIv29yvj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162194-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162194-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 874BE1F23D20 for ; Mon, 29 Apr 2024 12:10:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8F9B54743; Mon, 29 Apr 2024 12:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dIv29yvj" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 AA1FE54905 for ; Mon, 29 Apr 2024 12:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; cv=none; b=R/xb44JwIUe6n10P6NZ91veCPnv2tVgeQJHuWO1y8I9Kp4hMnEmp3pgjZJNaKcupoxar228veQrwO/Lly4jX9UTPMxGI15vGV9Uk1vhmTy+16Jir0rWbPNorKQ8giwlqpn81y2a30tr1sPKyiGd92msA0Sv3107yWFiDr8p2A48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392567; c=relaxed/simple; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dytpuyvjZcFJ3iglPVm4OC9XAjAXAi6o8xafxVfNToJ7/pR0zwpdmP86IT5zebKrVclj7m5CwyO+8N1ThX3jdUK+8l/Q4WTXyq33nE93LRIfdPvW5uzpmJYR2Qrt6hhI2U6t9E0pOmwrvcg440byvi+2uxlqu1x4cADLy+E0Yc0= 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=dIv29yvj; arc=none smtp.client-ip=198.175.65.19 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392566; x=1745928566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DArV7j/szx7co+lsS5KqZv3unCNqezb1USQ5LCYCZyI=; b=dIv29yvj8urmtKFWeBEp1wl8DEH6/a9D+OW97ggMJeHneXh7Y5ogAYh0 MDT4YZ9TZqoaK1djpJDhZSYLxOCkVzPdwPAgHMGHw1DhO87QfqipIIWgd s9ydPGGDeGh4d0RYGlRorfcfd9zNB1b8aLjoCEZqoRbyLahs/JXcRlj16 jjgUAPIogxjT+ypNmo6j5P0GJPJ1SbGPfd+yAvKsy9R52TRZSIIrtZEzX rkYaT/9yG/Pz+Gj56iS22LrfQBTw9HhLDJxChox7QcTbciUz57eWc4Tl2 q/WAqNgSXIJO1Iokwe2FchC1hU4L3FYdpI+LMhdtWlYziGA6Yx6b6hPP6 g==; X-CSE-ConnectionGUID: oPVOdxbwSKiw4uHqGTqbBg== X-CSE-MsgGUID: +znorXDMSrGGEvzJXMELXQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908242" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908242" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:26 -0700 X-CSE-ConnectionGUID: OG/5I1r0S0Ctk5Pj/kTiDA== X-CSE-MsgGUID: 5hJ2fJwbQYaXTD1yI50OGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166623" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:23 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 05/14] intel_th: Constify the struct device_type usage Date: Mon, 29 Apr 2024 15:08:59 +0300 Message-ID: <20240429120908.3723458-6-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-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: 8bit 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)); } -static struct device_type intel_th_source_device_type = { +static const struct device_type intel_th_source_device_type = { .name = "intel_th_source_device", .release = intel_th_device_release, }; @@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] = { ATTRIBUTE_GROUPS(intel_th_output); -static struct device_type intel_th_output_device_type = { +static const struct device_type intel_th_output_device_type = { .name = "intel_th_output_device", .groups = intel_th_output_groups, .release = intel_th_device_release, .devnode = intel_th_output_devnode, }; -static struct device_type intel_th_switch_device_type = { +static const struct device_type intel_th_switch_device_type = { .name = "intel_th_switch_device", .release = intel_th_device_release, }; -static struct device_type *intel_th_device_type[] = { +static const struct device_type *intel_th_device_type[] = { [INTEL_TH_SOURCE] = &intel_th_source_device_type, [INTEL_TH_OUTPUT] = &intel_th_output_device_type, [INTEL_TH_SWITCH] = &intel_th_switch_device_type, -- 2.43.0