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>
This commit is contained in:
parent
931b9c86d9
commit
b81e5962af
1 changed files with 5 additions and 5 deletions
|
@ -317,21 +317,21 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned long length = 0;
|
unsigned long length = 0;
|
||||||
unsigned long count = 0;
|
int count = 0;
|
||||||
char __user *arg = (void __user *)__arg;
|
char __user *arg = (void __user *)__arg;
|
||||||
struct trt *trts;
|
struct trt *trts;
|
||||||
struct art *arts;
|
struct art *arts;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case ACPI_THERMAL_GET_TRT_COUNT:
|
case ACPI_THERMAL_GET_TRT_COUNT:
|
||||||
ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count,
|
ret = acpi_parse_trt(acpi_thermal_rel_handle, &count,
|
||||||
&trts, false);
|
&trts, false);
|
||||||
kfree(trts);
|
kfree(trts);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return put_user(count, (unsigned long __user *)__arg);
|
return put_user(count, (unsigned long __user *)__arg);
|
||||||
return ret;
|
return ret;
|
||||||
case ACPI_THERMAL_GET_TRT_LEN:
|
case ACPI_THERMAL_GET_TRT_LEN:
|
||||||
ret = acpi_parse_trt(acpi_thermal_rel_handle, (int *)&count,
|
ret = acpi_parse_trt(acpi_thermal_rel_handle, &count,
|
||||||
&trts, false);
|
&trts, false);
|
||||||
kfree(trts);
|
kfree(trts);
|
||||||
length = count * sizeof(union trt_object);
|
length = count * sizeof(union trt_object);
|
||||||
|
@ -341,14 +341,14 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
|
||||||
case ACPI_THERMAL_GET_TRT:
|
case ACPI_THERMAL_GET_TRT:
|
||||||
return fill_trt(arg);
|
return fill_trt(arg);
|
||||||
case ACPI_THERMAL_GET_ART_COUNT:
|
case ACPI_THERMAL_GET_ART_COUNT:
|
||||||
ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count,
|
ret = acpi_parse_art(acpi_thermal_rel_handle, &count,
|
||||||
&arts, false);
|
&arts, false);
|
||||||
kfree(arts);
|
kfree(arts);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return put_user(count, (unsigned long __user *)__arg);
|
return put_user(count, (unsigned long __user *)__arg);
|
||||||
return ret;
|
return ret;
|
||||||
case ACPI_THERMAL_GET_ART_LEN:
|
case ACPI_THERMAL_GET_ART_LEN:
|
||||||
ret = acpi_parse_art(acpi_thermal_rel_handle, (int *)&count,
|
ret = acpi_parse_art(acpi_thermal_rel_handle, &count,
|
||||||
&arts, false);
|
&arts, false);
|
||||||
kfree(arts);
|
kfree(arts);
|
||||||
length = count * sizeof(union art_object);
|
length = count * sizeof(union art_object);
|
||||||
|
|
Loading…
Add table
Reference in a new issue