Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1337139rdb; Mon, 19 Feb 2024 11:50:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9I3m+l6zWXC5abcjVT+xQkttCzeDq+ttUalMgKjSa+qSqly3ZR7DbB9wUKug4P4LQ+O5BJv1INR69OxOu2LQXCgMcCB3hgZztaa6c2w== X-Google-Smtp-Source: AGHT+IFANBVrGwOqd6zjRYfVQtiv6us6QtLIQBaPb0jU9A3dLP+i+Cfo5CMKPU78GHRXAiI5Wt2a X-Received: by 2002:a17:907:75ca:b0:a3e:69ff:141f with SMTP id jl10-20020a17090775ca00b00a3e69ff141fmr4050924ejc.33.1708372225102; Mon, 19 Feb 2024 11:50:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708372225; cv=pass; d=google.com; s=arc-20160816; b=YevFYsnJYWSNkVAn4WIHMuI8uohoubbQYHeRK45f0n4buJPVTSvzihKU36vWIcUNAJ ALZCmFi8+UTiXcDPaRWK7D2JPKkTxvP7Zsr7Snlo81Kv1ynpTpwgiI2QkM4qco9BQnC+ 6j4Q4nHViI6IXZ+A0AQnWOiwUGmeEaF3UBlMJ/d90kIcS+VhlCd0GKW4cYgphoIadLZO wvXTSG8qzsWJT7dTI+6VIAzrjECf4gAc+Z+hmMWeyb71hrUCaQtBfEuMRUu5P3xzx3O6 Jx3ohCOC2K0CQJ3pUQBKTuwy1vwGMML8dgEiaEPCtufohD9Zwmuq5phbTwRUPlNVHDbt tv4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :dkim-signature:from; bh=AwRCLhHz23aV/zozDITJb0YDvXJTzc2EO/w3xANaOLQ=; fh=BxWOgbJDQS2MiPGUiSi5mLvpSll5tyLMAZ4Wy/dy7Wo=; b=Q/g+M2lgTQxQ//MuoPFQAbGjCOqLhi5LUjHQ4/SlaeT112cSE+nUdzuSok5LqH9xyc K04NIAW3qn2jnDAQrI/cx5Es9voB2/3VtSW5v/TslF5Xri11u3pTT8sAlymQi3mZY+MO 1G9PtxVE75DUgw8bDr1RxAec8JnVGDy8OUDX0SAxjpmxtbEFyQVictmdNAkzP4fLH7DG 5mjDF/wYMMo0iOBGjJbcd3zA6mxpSNRPGSbhzixyqq0k4ISvHcoms71yiUxPr1um+pIU saO4C7Mr9JTElgRiJZULF061Hxnd/dXw2XNuIdcRbQ48lN4hmvQdomCdSG/D+Mb5ZYi4 yoqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=UeeWPQe8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-bluetooth+bounces-2010-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x19-20020a05640226d300b0056447ebd7afsi1825425edd.1.2024.02.19.11.50.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 11:50:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2010-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=@marliere.net header.s=2024 header.b=UeeWPQe8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-bluetooth+bounces-2010-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 CF1691F23180 for ; Mon, 19 Feb 2024 19:50:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED88B535D5; Mon, 19 Feb 2024 19:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="UeeWPQe8" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A90D7535B5; Mon, 19 Feb 2024 19:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708371981; cv=none; b=ahIGsntzlS9KZb1MuIwZmz/z2hgOLpJofY+iFuq0XEcnV/gHlddg8PsnpjJEA4TYoeZfDd6RofQDsW0l0m1eaRTR9/AsLPQKQyn7oDH1LpemAL2h6EVOw/p/7+C2vQSYa+O0S2MDJUu0etpxPqWLAh/4hscN1X4CpiyCGrntdC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708371981; c=relaxed/simple; bh=qkNCX/evOVyVcsQQXkga5V8mXV5VQFEJOLdKmEkioZw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=MyFNsXdhJ5F6JHnb4q8KxIZPGisWQuIt2OfYqkjG5lKMic3nqdZWGBnW91NcAyh4OCx1DbMDrAlKG1L3vPPABQdWBVOghQSeUiVN76XuQvF5ib1vyeFbBSSbZW4QtOAUlhESXZy87DELxYo4bWq3zdTsl0oHZ0UqEjfv4U7Bm+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=UeeWPQe8; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1dbb47852cdso20085175ad.1; Mon, 19 Feb 2024 11:46:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708371979; x=1708976779; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:dkim-signature:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AwRCLhHz23aV/zozDITJb0YDvXJTzc2EO/w3xANaOLQ=; b=a9omP0KFedUSS5EPWXjLWk00YwJ3CP8YV4DhTjkNEaEcStgKK4nCheISG5XCR8z7Gz K6Ms63VyNn2SgE7IIYsQMuJ/lEiXWy+lg57laWDZO+176/AscwJtKJS01gZtsgn8pFzA Tat+4n6s9HwkByRwU6vgvz9zIDjdB/T77yPjtsZV0hjXYETxwGCYWpXbzr3O+mDbDMqH KysK+qLqHWaYz3LXHrS6HtTSjWCavD6BNHETS3Y0QNMiVt8CBdFsrgM/eRilqBm5oOoP Isd6t1vMulEyw3a/W5FlTgReoibBPg/2cdZWp1Ipf/H6jN1p5eGzkLHNuxa6kEUwm10q mW3Q== X-Forwarded-Encrypted: i=1; AJvYcCWbFgNi/GqkuCRTO9LZU3cMcgYVaLG+xT+Pl2L2qzrNDo4NojBDdV4QIr4NR6oLLKOF6XpbuPT70dWrC1Vt3UEGw6VOwXz6LH0noA685LwJN2y3EA7P5vHmSvNIcMx3N6O/9Zfx X-Gm-Message-State: AOJu0YwRg6jJqru1j1cgVRvUE/l6Xls9YVVl1h2bgh+gUVAYpSUTXsz6 QZumOzMPSbbWusRmAmVYnRGnJM3YrJz86bxXx7p3xsYd/+XwlOCn X-Received: by 2002:a17:902:a3ce:b0:1db:a94f:903d with SMTP id q14-20020a170902a3ce00b001dba94f903dmr8295308plb.36.1708371978816; Mon, 19 Feb 2024 11:46:18 -0800 (PST) Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id lw8-20020a1709032ac800b001db9fa23407sm4753658plb.195.2024.02.19.11.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 11:46:18 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1708371976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwRCLhHz23aV/zozDITJb0YDvXJTzc2EO/w3xANaOLQ=; b=UeeWPQe82l1RQbVnsDf77Nh8VbkC43M9SjfnDIxjvtKsinuJdi6ZhS0NHu7m8FPAIfIKxt Q0hPsFb/pETo/emEdV1Acbc+EdkYzhxucmWRywziyx0aVVhs7A18V8hC9N+vYaDaX9ItwT UEByd/k4q5ANyL/M2PiNShJj/LjecsmoELs5VMA6NiaOiN+zWo3jsDob2g+UWe5L00ftvO GNO2Bw6F0BNib23Sqj9Xm4AP0jswKwRy5S1s2Ro8vcycwvKE8hMuLF+nfpafcQEBV8Tc1a Xu5IbiqdrLbgAna47F27eyrEkkUfPYjbmoiDgw9eoJfeAPk7zkG4YkwsS/gtMQ== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 19 Feb 2024 16:46:57 -0300 Subject: [PATCH] Bluetooth: constify the struct device_type usage Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240219-device_cleanup-bluetooth-v1-1-dd81ba00c95e@marliere.net> X-B4-Tracking: v=1; b=H4sIADCw02UC/x2MWwqAIBAAryL7naDSg7pKRGy21UJoqEUQ3T3pc 2BmHogUmCJ04oFAF0f2LoMuBNgN3UqS58xglCmV0a2cs2RptDuhOw857Scl79MmFSq91BbLpjK Q8yPQwve/7of3/QAyte8RagAAAA== To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1525; i=ricardo@marliere.net; h=from:subject:message-id; bh=qkNCX/evOVyVcsQQXkga5V8mXV5VQFEJOLdKmEkioZw=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBl07AxGJrWiNXtnXNhSeiX52AHCHXjkF3XyhmeO cOr2GGQuKqJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZdOwMQAKCRDJC4p8Y4ZY ps1zD/9dgzh7mROaeNsTJHEFlvzG+3pU5cdy7vyulxNhZRdlDMs8bDJYIp2dJ+J1WPRtkDszqRG 0xs8w+Iv/kNBcLruG7F34LhiqwPUtvDMO4H1Q5QwQBQ45lpzZBbEczSm4TXD5aBp4VpgOR+6GnY TW8UzqU6OQmzVR4Pcdilu+YXrzqfN2Id4znBgFuGSNy8c+36MpDzgQKMkAcUvikZM7jdtO6SuIy fQtN2FHMXY+d8lDwc6VdFPfRoF3QHK7aEKjocdynYtF2GN5p158FIuiYmJJhiKHTLl/mFjv7whG S37dLkmmFL+yLW9+4uIxAD5CUr1I3zdNPiQ8js/DMtq+uabOElAPdjm21g1PUryqvPtFSGZuGR0 rYJ3LJMRVeP9ENlgGF+9zn1FP2LDctPQwTxfkGvZEAIktdQgfquAdpkgAbpFYe2XhXI9ccOP3OI I9GsaM6mApzKcLMQE8z1Dgm42K5oQbYhboo8YysHJjVs3riTybdnUFqmqkWREz0XzX8IN0LwYxL 6dwkhxnbCh04CA4yget61jAaKCEl/PNaLDoPfZB/Du9iEogLlRBnLx94ltfGaDEHeNPVQKXiF79 RTt6NtgftUgfYWuZ/THJXtmFgyhCdyzgSNNPn/tRXC97dpq15OszlCPBos4Jg3cDwxOZG5/VDVN 3g9GZeGe1su/lrQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the bt_type and bnep_type variables to be constant structures 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 --- net/bluetooth/6lowpan.c | 2 +- net/bluetooth/bnep/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 215af9b3b589..5c1b8b5bfe71 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -572,7 +572,7 @@ static void netdev_setup(struct net_device *dev) dev->needs_free_netdev = true; } -static struct device_type bt_type = { +static const struct device_type bt_type = { .name = "bluetooth", }; diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index 5a6a49885ab6..8c3f8d0c0358 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c @@ -549,7 +549,7 @@ static struct device *bnep_get_device(struct bnep_session *session) return &conn->hcon->dev; } -static struct device_type bnep_type = { +static const struct device_type bnep_type = { .name = "bluetooth", }; --- base-commit: 64b5c4c8e79c131fe8f135bab5e5dfaa245c5776 change-id: 20240219-device_cleanup-bluetooth-0a01f6ca4752 Best regards, -- Ricardo B. Marliere