File tree Expand file tree Collapse file tree 2 files changed +29
-24
lines changed
drivers/thermal/intel/int340x_thermal Expand file tree Collapse file tree 2 files changed +29
-24
lines changed Original file line number Diff line number Diff line change @@ -250,8 +250,9 @@ static int fill_art(char __user *ubuf)
250
250
get_single_name (arts [i ].source , art_user [i ].source_device );
251
251
get_single_name (arts [i ].target , art_user [i ].target_device );
252
252
/* 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 ));
255
256
}
256
257
257
258
if (copy_to_user (ubuf , art_user , art_len ))
Original file line number Diff line number Diff line change 17
17
struct art {
18
18
acpi_handle source ;
19
19
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
+ );
31
33
} __packed ;
32
34
33
35
struct trt {
@@ -47,17 +49,19 @@ union art_object {
47
49
struct {
48
50
char source_device [8 ]; /* ACPI single name */
49
51
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
+ );
61
65
};
62
66
u64 __data [ACPI_NR_ART_ELEMENTS ];
63
67
};
You can’t perform that action at this time.
0 commit comments