Message ID | 20240213-bus_cleanup-tee-v1-1-77945ae1a172@marliere.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63706-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp592762dyb; Tue, 13 Feb 2024 07:01:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5bbctdmeTtuxSI5jPg09anETJxy39E/7JgfDu/2x8hdpLK8vAeavNOSjEGC2vT3zX6WREcCAgff1MUnmKl0o4FlVPiA== X-Google-Smtp-Source: AGHT+IFSBf+HXoekuD3I452UES+L0VyLKQCD5hIMlbDNB7ksgw8PEy3Q5Fgd5iWKABtG5z0arU5x X-Received: by 2002:a17:906:789:b0:a3d:15eb:b104 with SMTP id l9-20020a170906078900b00a3d15ebb104mr1043278ejc.36.1707836484400; Tue, 13 Feb 2024 07:01:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707836484; cv=pass; d=google.com; s=arc-20160816; b=Q8KSZHUe1HgfdeHyaZLRp91a6mPnvBueqq0RiCWzD+e0uekiCwwCj8AND1ZY4X5Jq8 9Q6pnwGLy920Kake/l+7m4EPPmxAOHzcerB8GH5TqdO/+HhQRHSJ5P9Ai9O6k0ZaW7iv WO7UBdf7/kTj10jdfAIVCBRdEAP5YkUmAGLFs9NsRElob18lM3sT/gP+YKJbKpc6Bm0R MGWRcCxo9ZnR0Dtz8kdHe8YpoV55vy4Ww7bn5E156VGLJQp2tYbNlvv4ZHD6YVKVaFUD /lSjybBRAeQXop7p9QGnR7b7Urzd5gnO6rCj1Vn8x8MXepFUJnvJv0i1yuTN0TIiYPyH /QNQ== 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=NCwgMbwC7An3DNn4GGPR+ZW0r4hzwBM1GqjFa3Sruew=; fh=BIM2yFZIOobJDRRFkjkxNvNvKhY9YC/KO8BvWQkXpGo=; b=Cp1rwWYIxqp8jIhnwZQghZHCyLvV+ypxFAJcDZwT5ijEWi9QhZD8vo9TMruj/hFlDG GiCJIx8A803RjBAhf/28YF10OnXggG68uen1auZOgbXlbBKi8hLYlbQasvNf5UNOfImY cT2q5XquytyNQTtKPA8s44rgze+llItPIDrvHqkA3HqZ9sgOMdh29H05fjfvgXnhHJTK 2j5gZquqhJstyghw6HFtl3z2s6e56fhYUlfEc/d8ELVBGh4MV9h8feanado6sBq+BbUz z9TGzuwEVpgmxRcsp6sX6yP8gRhWg3RZaQjAmp1N03jvx+33eK3NcSFGSlJaC8l1oVFB 1kqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=GFjrFfIV; 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-kernel+bounces-63706-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63706-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCXAnkXeagFzqbK6AGdof1AhNgwEtdhe2SuV6Fz0Zp2MUpMidmKys4gvAK40DWDFbsW1QYtRo9E8p/TS/UAmouw09cyk2A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c13-20020a170906528d00b00a3cfcd87729si761431ejm.385.2024.02.13.07.01.24 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:01:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63706-ouuuleilei=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=GFjrFfIV; 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-kernel+bounces-63706-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63706-ouuuleilei=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 A5C5D1F28E0A for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 14:46:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CD2458AC5; Tue, 13 Feb 2024 14:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="GFjrFfIV" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 1498B1DFEF for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 14:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707835551; cv=none; b=g1hPh1H+A3r/mm1fLXqqRfDwRNivlMRRvFNIplUZTe+hyTMKr7Bd8NcLf69jJBrEA/Azixq/O+Pb2P0i0henRi0IVLUuQHmow2GBJ1+QNkuT5t+S1SBqqxN/M0XZR6DbF8/24jEAv7OLq4HfnnYS0QZ/PaX3PjSr+RBoFl1qLdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707835551; c=relaxed/simple; bh=/JVw6JUS7Qlkpf9PDVKxppJuv27t2j/1nfrrHYHsvoY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=YU+nd5HofH0dNfj5I9EsY0CdviYuMuRAHZRcE815XpO2HVYvB1RcXbqJEtkKS8Pcxy9buYr0wrXXJo0XEDtLM+4yS3ySu2Yfkl2F568OjiXQY1pjDijAgYYzGsx7KrEi2RbkB5DzY03bYgbrIes1xgfJOQZrNy1aiNkJajSuSzU= 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=GFjrFfIV; arc=none smtp.client-ip=209.85.210.172 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-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e0a479a6cbso1622665b3a.0 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 06:45:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707835549; x=1708440349; 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=NCwgMbwC7An3DNn4GGPR+ZW0r4hzwBM1GqjFa3Sruew=; b=HvPvG1wUTXxB1sdoBs3AeEuJ8f62DnVHB0R0KhAAxygEvqQ5SWYwZWgy+s/wsHp1OF 7b43yHdUCkijcQCDCdtYM8ZJXYzMsQMC9m3PHXhjYQnL6SVFigT5Tm3t+ECE58uBSr/Q hsRHnxX76T5Qfnwvocdyv67Ou3pOnP/crHnVAWZ9IYcNSJkI2pj3Y7MTp3HQQvltLy0v RYK2LtItMS9ul/4mptolT4qz3AOOEgLG584UOCIPkzi91Q952R/m8CLbpC4HtCOr7RBq tx78YnD7QdM2H4IuBcHt+TPBInQz9QZOVqJqTHimzim1pU937mRvnOgdfHPtrNCK0MpG i/Jw== X-Forwarded-Encrypted: i=1; AJvYcCWNC6KjIdqcKFII38d8dnGCP0VZBB48ecBwDK+LLRkj2W1G1RPJsdLDyJqd7wUqDHoZZnPpIX3T9LVbh+2ukKBfpal7xMix9rPUzdJe X-Gm-Message-State: AOJu0Yy6/ix455cIpzWpB9BIIcrM3M6hfEQTgFOxaI3M1ruUL42wZg8U d/IsFLEK61JBA+WO3WyhgC8j9WBCxOHUrRgsED94gWjY8j6Qcn/oJmllNS2CB3e8Bw== X-Received: by 2002:a05:6a20:e614:b0:19e:3a9f:f925 with SMTP id my20-20020a056a20e61400b0019e3a9ff925mr8138159pzb.14.1707835549331; Tue, 13 Feb 2024 06:45:49 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXtAjLGCjHI3cOozF0Sk8MS4dleiqvFOOVS7wzvZ2e4O4Mzn4qs+iQGBUmDQv9mWtn/qZUwJwl5+jgqgJmnJYqEHvq3gzvOs1CboO3vpt2RBT7U5V+PN+Lo/RaE5UKLfhiC0y+93xm6atCs2QuPj8nWmbRoGLOr89+Pxd3auD+j Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id y20-20020a170903011400b001d9d4375149sm1280232plc.215.2024.02.13.06.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:45:48 -0800 (PST) From: "Ricardo B. Marliere" <ricardo@marliere.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707835547; 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=NCwgMbwC7An3DNn4GGPR+ZW0r4hzwBM1GqjFa3Sruew=; b=GFjrFfIV5EBELI4zA8+4T4IAoxBjxoJI6zlwYm5jht5E1suU+I78mkZo9qhCxDYpd3jn3R dHov23cbkUklp+QKGKAOA8ukaFCnl3bv63CJBRyGcpA0byImRCLTTyQ5KQxrEbT6uLk+JL jf9dsz8DXmWtECbWJw4bFJfm+fr4dhRM0WxFPMbVFXe3gYO+oNrjkLYShyZ+lCKd1STVMc VsHR0bkL6E2D3HJd0tv3kNhRcsZ0h+6drl0dpwsGpyizXzxcac3+O1wGiBT66uiFbiZJTW Rpg5MdyCOnTZmSNbc/b83Mji8qDN5+mD4Fx2tpRem1kjeyQhs+EXy3VceG99+w== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Tue, 13 Feb 2024 11:46:25 -0300 Subject: [PATCH] tee: make tee_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240213-bus_cleanup-tee-v1-1-77945ae1a172@marliere.net> X-B4-Tracking: v=1; b=H4sIAMCAy2UC/x3MQQqAIBBA0avErBNyKqKuEhFqUw2EhWYE4t2Tl m/xfwRPjsnDUERw9LDn02bIsgCzK7uR4CUbsMKmQlkLHfxsDlI2XOImEgbbDnutzdKtkKvL0cr vfxynlD6MhzL1YQAAAA== To: Jens Wiklander <jens.wiklander@linaro.org>, Sumit Garg <sumit.garg@linaro.org> Cc: op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Ricardo B. Marliere" <ricardo@marliere.net> X-Developer-Signature: v=1; a=openpgp-sha256; l=1663; i=ricardo@marliere.net; h=from:subject:message-id; bh=/JVw6JUS7Qlkpf9PDVKxppJuv27t2j/1nfrrHYHsvoY=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBly4DDQ9wKZ20oNtPX+2IiSw52LstvRyeEqj0c/ cxZ5DctXOWJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcuAwwAKCRDJC4p8Y4ZY ptimEACUJ9WmQFcj7VNoXIXx49IP+fPFbNgZhh2OL2TlibLbBoMImQQgUM+/DpMfhUzisPLbxAk 4RYldBiJUSeBOZylG9vGlkcHiA+XIAYZklbern3w2HgO93gfoBGIyBZty2d0C2/23dUGN5aKqnd HC4ueJUfGgGeJYBxp2+W1HvkaPVoR7zJvJhTGiL3/TOTAJTLeo+DP3TEoCaeyCFLXyGPEIr7Rf9 1htOaH2Jv/Yg+LAw9nXs0+IfR8rVUKAKOSZBj/YBf8Fe9/syfLN9lE2ln4bVNrxMffCji2udQvk Aonm36uyIj7n/QHL0xjCnFDb/ETcs/XZyHLQqQiHt4G7KI+028dnI5e7sO2IV0MFXWx3Qas5bpB 5ytXokwwcW0WPIxcLXJxDWKh9/iio7eBtbIe8nMe3RttGxiIbjobYkr1GvHYGmNrN55yy1EwE0g UmxZEwG20fw2lLqi6cUUHewoKM+zfmYjEYNaQfKFba7sieYVjiRAC4k604QAvblcZKUVpLQEQzn Sx5AsA49SWPrm3s90vjHXRtOan1UvLGAfKeCxerTv4W+C2hXvVQ/mw++iDJ/CgtK4rI81XVhqBa 83fuK5+W9YR5XfQJc7/IbrJ+uFDO922hgphXtwIUbzt7J0ucD9DN+L2d+cari5UxhBMXI4W8UT0 qP2YR4lM6D3bZ/w== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790796349296248167 X-GMAIL-MSGID: 1790796349296248167 |
Series |
tee: make tee_bus_type const
|
|
Commit Message
Ricardo B. Marliere
Feb. 13, 2024, 2:46 p.m. UTC
Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the tee_bus_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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/tee/tee_core.c | 2 +-
include/linux/tee_drv.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7
change-id: 20240213-bus_cleanup-tee-c25729bbcd7f
Best regards,
Comments
On Tue, Feb 13, 2024 at 11:46:25AM -0300, Ricardo B. Marliere wrote: > Since commit d492cc2573a0 ("driver core: device.h: make struct > bus_type a const *"), the driver core can properly handle constant > struct bus_type, move the tee_bus_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 <gregkh@linuxfoundation.org> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Tue, 13 Feb 2024 at 20:15, Ricardo B. Marliere <ricardo@marliere.net> wrote: > > Since commit d492cc2573a0 ("driver core: device.h: make struct > bus_type a const *"), the driver core can properly handle constant > struct bus_type, move the tee_bus_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 <gregkh@linuxfoundation.org> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> > --- > drivers/tee/tee_core.c | 2 +- > include/linux/tee_drv.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Sumit Garg <sumit.garg@linaro.org> -Sumit > diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c > index 792d6fae4354..e59c20d74b36 100644 > --- a/drivers/tee/tee_core.c > +++ b/drivers/tee/tee_core.c > @@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev, > return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id); > } > > -struct bus_type tee_bus_type = { > +const struct bus_type tee_bus_type = { > .name = "tee", > .match = tee_client_device_match, > .uevent = tee_client_device_uevent, > diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h > index 911ddf92dcee..71632e3c5f18 100644 > --- a/include/linux/tee_drv.h > +++ b/include/linux/tee_drv.h > @@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param) > } > } > > -extern struct bus_type tee_bus_type; > +extern const struct bus_type tee_bus_type; > > /** > * struct tee_client_device - tee based device > > --- > base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7 > change-id: 20240213-bus_cleanup-tee-c25729bbcd7f > > Best regards, > -- > Ricardo B. Marliere <ricardo@marliere.net> >
On Tue, Feb 13, 2024 at 3:45 PM Ricardo B. Marliere <ricardo@marliere.net> wrote: > > Since commit d492cc2573a0 ("driver core: device.h: make struct > bus_type a const *"), the driver core can properly handle constant > struct bus_type, move the tee_bus_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 <gregkh@linuxfoundation.org> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> > --- > drivers/tee/tee_core.c | 2 +- > include/linux/tee_drv.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) I'm picking up this. Thanks, Jens > > diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c > index 792d6fae4354..e59c20d74b36 100644 > --- a/drivers/tee/tee_core.c > +++ b/drivers/tee/tee_core.c > @@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev, > return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id); > } > > -struct bus_type tee_bus_type = { > +const struct bus_type tee_bus_type = { > .name = "tee", > .match = tee_client_device_match, > .uevent = tee_client_device_uevent, > diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h > index 911ddf92dcee..71632e3c5f18 100644 > --- a/include/linux/tee_drv.h > +++ b/include/linux/tee_drv.h > @@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param) > } > } > > -extern struct bus_type tee_bus_type; > +extern const struct bus_type tee_bus_type; > > /** > * struct tee_client_device - tee based device > > --- > base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7 > change-id: 20240213-bus_cleanup-tee-c25729bbcd7f > > Best regards, > -- > Ricardo B. Marliere <ricardo@marliere.net> >
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 792d6fae4354..e59c20d74b36 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev, return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id); } -struct bus_type tee_bus_type = { +const struct bus_type tee_bus_type = { .name = "tee", .match = tee_client_device_match, .uevent = tee_client_device_uevent, diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 911ddf92dcee..71632e3c5f18 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param) } } -extern struct bus_type tee_bus_type; +extern const struct bus_type tee_bus_type; /** * struct tee_client_device - tee based device