diff options
author | Jacob Pan <jacob.jun.pan@linux.intel.com> | 2014-11-04 18:53:34 -0500 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-12-08 22:31:19 -0500 |
commit | b81e5962af2c9453167d7be2efc46f42c42f63d2 (patch) | |
tree | 116f6bf92289553826bce459b6648a7bcbbe21f6 /drivers/thermal | |
parent | 931b9c86d9a518b1374157f103168fb787e6560e (diff) |
Thermal/int340x: avoid unnecessary pointer casting
Avoid pointer casting which may also lead to problems on big endian
64 bit systems.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/int340x_thermal/acpi_thermal_rel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c index 0d8db808f0ae..ac5c40558b84 100644 --- a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c | |||
@@ -317,21 +317,21 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd, | |||
317 | { | 317 | { |
318 | int ret = 0; | 318 | int ret = 0; |
319 | unsigned long length = 0; | 319 | unsigned long length = 0; |
320 | unsigned long count = 0; | 320 | int count = 0; |
321 | char __user *arg = (void __user *)__arg; | 321 | char __user *arg = (void __user *)__arg; |
322 | struct trt *trts; | 322 | struct trt *trts; |
323 | struct art *arts; | 323 | struct art *arts; |
324 | 324 | ||
325 | switch (cmd) { | 325 | switch (cmd) { |
326 | case ACPI_THERMAL_GET_TRT_COUNT: | 326 | case ACPI_THERMAL_GET_TRT_COUNT: |
327 | ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, | 327 | ret = acpi_parse_trt(acpi_thermal_rel_handle, &count, |
328 | &trts, false); | 328 | &trts, false); |
329 | kfree(trts); | 329 | kfree(trts); |
330 | if (!ret) | 330 | if (!ret) |
331 | return put_user(count, (unsigned long __user *)__arg); | 331 | return put_user(count, (unsigned long __user *)__arg); |
332 | return ret; | 332 | return ret; |
333 | case ACPI_THERMAL_GET_TRT_LEN: | 333 | case ACPI_THERMAL_GET_TRT_LEN: |
334 | ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count, | 334 | ret = acpi_parse_trt(acpi_thermal_rel_handle, &count, |
335 | &trts, false); | 335 | &trts, false); |
336 | kfree(trts); | 336 | kfree(trts); |
337 | length = count * sizeof(union trt_object); | 337 | length = count * sizeof(union trt_object); |
@@ -341,14 +341,14 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd, | |||
341 | case ACPI_THERMAL_GET_TRT: | 341 | case ACPI_THERMAL_GET_TRT: |
342 | return fill_trt(arg); | 342 | return fill_trt(arg); |
343 | case ACPI_THERMAL_GET_ART_COUNT: | 343 | case ACPI_THERMAL_GET_ART_COUNT: |
344 | ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, | 344 | ret = acpi_parse_art(acpi_thermal_rel_handle, &count, |
345 | &arts, false); | 345 | &arts, false); |
346 | kfree(arts); | 346 | kfree(arts); |
347 | if (!ret) | 347 | if (!ret) |
348 | return put_user(count, (unsigned long __user *)__arg); | 348 | return put_user(count, (unsigned long __user *)__arg); |
349 | return ret; | 349 | return ret; |
350 | case ACPI_THERMAL_GET_ART_LEN: | 350 | case ACPI_THERMAL_GET_ART_LEN: |
351 | ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count, | 351 | ret = acpi_parse_art(acpi_thermal_rel_handle, &count, |
352 | &arts, false); | 352 | &arts, false); |
353 | kfree(arts); | 353 | kfree(arts); |
354 | length = count * sizeof(union art_object); | 354 | length = count * sizeof(union art_object); |