From 2f21871b13274afcac4f49f559537dcc5d3d0a10 Mon Sep 17 00:00:00 2001 From: Dipen Patel Date: Tue, 11 Apr 2023 16:45:21 +0000 Subject: [PATCH] drivers: staging: gte: fix warnings The gte driver has multiple sparse warnings when kernel is compiled with tmp kernel C=2. This CL corrects those warnings. Bug 3954363 Change-Id: If7a112c1bf1e491118b3d4119e0e09f7673a553a Signed-off-by: Dipen Patel Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2886127 Reviewed-by: Ketan Patil Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/staging/platform/tegra/gte/tegra194_gte.c | 12 ++++++------ .../platform/tegra/gte_test/tegra194_gte_test.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/platform/tegra/gte/tegra194_gte.c b/drivers/staging/platform/tegra/gte/tegra194_gte.c index f70fb8a0..79dcfc0b 100644 --- a/drivers/staging/platform/tegra/gte/tegra194_gte.c +++ b/drivers/staging/platform/tegra/gte/tegra194_gte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION & AFFILIATES.All rights reserved. + * Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES.All rights reserved. * * SPDX-License-Identifier: GPL-2.0 */ @@ -311,9 +311,9 @@ static ssize_t show_num_events_avail(struct kobject *kobj, return scnprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&ev->usage)); } -struct kobj_attribute num_events_avail_attr = +static struct kobj_attribute num_events_avail_attr = __ATTR(num_events_avail, 0400, show_num_events_avail, NULL); -struct kobj_attribute num_dropped_events_attr = +static struct kobj_attribute num_dropped_events_attr = __ATTR(num_dropped_events, 0400, show_num_dropped_events, NULL); static struct attribute *ev_attrs[] = { @@ -674,11 +674,11 @@ struct gte_uspace_event_state { struct tegra_gte_ev_desc *gte_data; }; -static unsigned int gte_event_poll(struct file *filep, - struct poll_table_struct *wait) +static __poll_t gte_event_poll(struct file *filep, + struct poll_table_struct *wait) { struct gte_uspace_event_state *le = filep->private_data; - unsigned int events = 0; + __poll_t events = 0; poll_wait(filep, &le->wait, wait); diff --git a/drivers/staging/platform/tegra/gte_test/tegra194_gte_test.c b/drivers/staging/platform/tegra/gte_test/tegra194_gte_test.c index 0c98cbca..89b2d41a 100644 --- a/drivers/staging/platform/tegra/gte_test/tegra194_gte_test.c +++ b/drivers/staging/platform/tegra/gte_test/tegra194_gte_test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION & AFFILIATES.All rights reserved. + * Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES.All rights reserved. * * SPDX-License-Identifier: GPL-2.0 */ @@ -193,11 +193,11 @@ static ssize_t show_lic_irq_ts(struct kobject *kobj, hts.ts_raw, hts.ts_ns); } -struct kobj_attribute gpio_en_dis_attr = +static struct kobj_attribute gpio_en_dis_attr = __ATTR(gpio_en_dis, 0220, NULL, store_gpio_en_dis); -struct kobj_attribute lic_irq_en_dis_attr = +static struct kobj_attribute lic_irq_en_dis_attr = __ATTR(lic_irq_en_dis, 0220, NULL, store_lic_irq_en_dis); -struct kobj_attribute lic_irq_ts_attr = +static struct kobj_attribute lic_irq_ts_attr = __ATTR(lic_irq_ts, 0440, show_lic_irq_ts, NULL); static struct attribute *attrs[] = {