* [PATCH] HID: intel-ish-hid: initialize ts_format.reserved
@ 2016-11-05 15:15 Jiri Kosina
2016-11-05 17:05 ` Srinivas Pandruvada
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Kosina @ 2016-11-05 15:15 UTC (permalink / raw)
To: Srinivas Pandruvada; +Cc: linux-kernel, linux-input
From: Jiri Kosina <jkosina@suse.cz>
ts_format.reserved is not used anywhere yet, but the compiler generates a
warning when the struct's (uninitialized) field is being copied around
drivers/hid/intel-ish-hid/ipc/ipc.c: In function ‘write_ipc_from_queue’:
drivers/hid/intel-ish-hid/ipc/ipc.c:316: warning: ‘ts_format.reserved’ may be used uninitialized in this function
Avoid this by force-initializing the field to zero.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
drivers/hid/intel-ish-hid/ipc/ipc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 0c9ac4d..417cd07 100644
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -310,6 +310,7 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
((uint32_t)tv_utc.tv_usec);
ts_format.ts1_source = HOST_SYSTEM_TIME_USEC;
ts_format.ts2_source = HOST_UTC_TIME_USEC;
+ ts_format.reserved = 0;
time_update.primary_host_time = usec_system;
time_update.secondary_host_time = usec_utc;
--
1.9.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: intel-ish-hid: initialize ts_format.reserved
2016-11-05 15:15 [PATCH] HID: intel-ish-hid: initialize ts_format.reserved Jiri Kosina
@ 2016-11-05 17:05 ` Srinivas Pandruvada
0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Pandruvada @ 2016-11-05 17:05 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel, linux-input
On Sat, 2016-11-05 at 16:15 +0100, Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@suse.cz>
>
> ts_format.reserved is not used anywhere yet, but the compiler
> generates a
> warning when the struct's (uninitialized) field is being copied
> around
>
> drivers/hid/intel-ish-hid/ipc/ipc.c: In function
> ‘write_ipc_from_queue’:
> drivers/hid/intel-ish-hid/ipc/ipc.c:316: warning:
> ‘ts_format.reserved’ may be used uninitialized in this function
>
> Avoid this by force-initializing the field to zero.
>
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> drivers/hid/intel-ish-hid/ipc/ipc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-
> ish-hid/ipc/ipc.c
> index 0c9ac4d..417cd07 100644
> --- a/drivers/hid/intel-ish-hid/ipc/ipc.c
> +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
> @@ -310,6 +310,7 @@ static int write_ipc_from_queue(struct
> ishtp_device *dev)
> ((uint32_t)tv_utc.tv_
> usec);
> ts_format.ts1_source = HOST_SYSTEM_TIME_USEC;
> ts_format.ts2_source = HOST_UTC_TIME_USEC;
> + ts_format.reserved = 0;
>
> time_update.primary_host_time = usec_system;
> time_update.secondary_host_time = usec_utc;
> --
> 1.9.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-05 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-05 15:15 [PATCH] HID: intel-ish-hid: initialize ts_format.reserved Jiri Kosina
2016-11-05 17:05 ` Srinivas Pandruvada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).