Skip to content

Commit fca4f23

Browse files
committed
ACPI: TAD: Clear unused RT data in acpi_tad_set_real_time()
Move the clearing of the fields in struct acpi_tad_rt that are not used on the real time setting side to acpi_tad_set_real_time(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8660506.T7Z3S40VBb@rafael.j.wysocki
1 parent 3329a14 commit fca4f23

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/acpi/acpi_tad.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ static int acpi_tad_set_real_time(struct device *dev, struct acpi_tad_rt *rt)
9696
if (acpi_tad_rt_is_invalid(rt))
9797
return -EINVAL;
9898

99+
rt->valid = 0;
100+
rt->msec = 0;
101+
memset(rt->padding, 0, 3);
102+
99103
args[0].buffer.pointer = (u8 *)rt;
100104
args[0].buffer.length = sizeof(*rt);
101105

@@ -233,10 +237,6 @@ static ssize_t time_store(struct device *dev, struct device_attribute *attr,
233237

234238
rt.daylight = val;
235239

236-
rt.valid = 0;
237-
rt.msec = 0;
238-
memset(rt.padding, 0, 3);
239-
240240
ret = acpi_tad_set_real_time(dev, &rt);
241241
if (ret)
242242
return ret;

0 commit comments

Comments
 (0)