Skip to content

Commit

Permalink
HID: intel-ish-hid: initialize ts_format.reserved
Browse files Browse the repository at this point in the history
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.

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Nov 5, 2016
1 parent 8a1e377 commit 15607a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/intel-ish-hid/ipc/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 15607a3

Please sign in to comment.