All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tee: optee: add const to tee_driver_ops and tee_desc structures
@ 2017-06-29  9:35 Bhumika Goyal
  2017-07-05  6:57 ` Jens Wiklander
  0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-06-29  9:35 UTC (permalink / raw)
  To: julia.lawall, jens.wiklander, linux-kernel; +Cc: Bhumika Goyal

Add const to tee_desc structures as they are only passed as an argument
to the function tee_device_alloc. This argument is of type const, so
declare these structures as const too.
Add const to tee_driver_ops structures as they are only stored in the
ops field of a tee_desc structure. This field is of type const, so
declare these structure types as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/tee/optee/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index 58169e5..7609ec6 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -258,7 +258,7 @@ static void optee_release(struct tee_context *ctx)
 	}
 }
 
-static struct tee_driver_ops optee_ops = {
+static const struct tee_driver_ops optee_ops = {
 	.get_version = optee_get_version,
 	.open = optee_open,
 	.release = optee_release,
@@ -268,13 +268,13 @@ static struct tee_driver_ops optee_ops = {
 	.cancel_req = optee_cancel_req,
 };
 
-static struct tee_desc optee_desc = {
+static const struct tee_desc optee_desc = {
 	.name = DRIVER_NAME "-clnt",
 	.ops = &optee_ops,
 	.owner = THIS_MODULE,
 };
 
-static struct tee_driver_ops optee_supp_ops = {
+static const struct tee_driver_ops optee_supp_ops = {
 	.get_version = optee_get_version,
 	.open = optee_open,
 	.release = optee_release,
@@ -282,7 +282,7 @@ static struct tee_driver_ops optee_supp_ops = {
 	.supp_send = optee_supp_send,
 };
 
-static struct tee_desc optee_supp_desc = {
+static const struct tee_desc optee_supp_desc = {
 	.name = DRIVER_NAME "-supp",
 	.ops = &optee_supp_ops,
 	.owner = THIS_MODULE,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tee: optee: add const to tee_driver_ops and tee_desc structures
  2017-06-29  9:35 [PATCH] tee: optee: add const to tee_driver_ops and tee_desc structures Bhumika Goyal
@ 2017-07-05  6:57 ` Jens Wiklander
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Wiklander @ 2017-07-05  6:57 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: julia.lawall, linux-kernel

On Thu, Jun 29, 2017 at 03:05:04PM +0530, Bhumika Goyal wrote:
> Add const to tee_desc structures as they are only passed as an argument
> to the function tee_device_alloc. This argument is of type const, so
> declare these structures as const too.
> Add const to tee_driver_ops structures as they are only stored in the
> ops field of a tee_desc structure. This field is of type const, so
> declare these structure types as const.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Looks good to me, queueing this.

Thanks,
Jens

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-05  6:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29  9:35 [PATCH] tee: optee: add const to tee_driver_ops and tee_desc structures Bhumika Goyal
2017-07-05  6:57 ` Jens Wiklander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.