Skip to content

Commit 9c33eef

Browse files
committed
Merge back int340x driver material for 5.17.
2 parents f872f73 + 764cedc commit 9c33eef

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ static int fill_art(char __user *ubuf)
250250
get_single_name(arts[i].source, art_user[i].source_device);
251251
get_single_name(arts[i].target, art_user[i].target_device);
252252
/* copy the rest int data in addition to source and target */
253-
memcpy(&art_user[i].weight, &arts[i].weight,
254-
sizeof(u64) * (ACPI_NR_ART_ELEMENTS - 2));
253+
BUILD_BUG_ON(sizeof(art_user[i].data) !=
254+
sizeof(u64) * (ACPI_NR_ART_ELEMENTS - 2));
255+
memcpy(&art_user[i].data, &arts[i].data, sizeof(art_user[i].data));
255256
}
256257

257258
if (copy_to_user(ubuf, art_user, art_len))

drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@
1717
struct art {
1818
acpi_handle source;
1919
acpi_handle target;
20-
u64 weight;
21-
u64 ac0_max;
22-
u64 ac1_max;
23-
u64 ac2_max;
24-
u64 ac3_max;
25-
u64 ac4_max;
26-
u64 ac5_max;
27-
u64 ac6_max;
28-
u64 ac7_max;
29-
u64 ac8_max;
30-
u64 ac9_max;
20+
struct_group(data,
21+
u64 weight;
22+
u64 ac0_max;
23+
u64 ac1_max;
24+
u64 ac2_max;
25+
u64 ac3_max;
26+
u64 ac4_max;
27+
u64 ac5_max;
28+
u64 ac6_max;
29+
u64 ac7_max;
30+
u64 ac8_max;
31+
u64 ac9_max;
32+
);
3133
} __packed;
3234

3335
struct trt {
@@ -47,17 +49,19 @@ union art_object {
4749
struct {
4850
char source_device[8]; /* ACPI single name */
4951
char target_device[8]; /* ACPI single name */
50-
u64 weight;
51-
u64 ac0_max_level;
52-
u64 ac1_max_level;
53-
u64 ac2_max_level;
54-
u64 ac3_max_level;
55-
u64 ac4_max_level;
56-
u64 ac5_max_level;
57-
u64 ac6_max_level;
58-
u64 ac7_max_level;
59-
u64 ac8_max_level;
60-
u64 ac9_max_level;
52+
struct_group(data,
53+
u64 weight;
54+
u64 ac0_max_level;
55+
u64 ac1_max_level;
56+
u64 ac2_max_level;
57+
u64 ac3_max_level;
58+
u64 ac4_max_level;
59+
u64 ac5_max_level;
60+
u64 ac6_max_level;
61+
u64 ac7_max_level;
62+
u64 ac8_max_level;
63+
u64 ac9_max_level;
64+
);
6165
};
6266
u64 __data[ACPI_NR_ART_ELEMENTS];
6367
};

0 commit comments

Comments
 (0)