diff options
author | Dheeraj CVR <cvr.dheeraj@gmail.com> | 2015-06-11 16:44:25 +0400 |
---|---|---|
committer | forkbomb <keepcalm444@gmail.com> | 2015-11-25 08:34:55 +1100 |
commit | fc862f3a4c433c67605f12ad2d9addc6fc1bc831 (patch) | |
tree | a753c448934c1ef459b302d5d60d46a07f694d6b /libsensors/cm36651_light.c | |
parent | ea6c7d9c8609022e19200d888f449139139d9173 (diff) | |
download | device_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.zip device_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.tar.gz device_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.tar.bz2 |
libsensors: switch to portable typedefs to match callbacks
Using a strict basetype only coding style is not a good idea
especially when we are dealing with callbacks which use portable
typedef like int64_t. This kind of coding style would most likely
end up in overflows at various places especially when dealing with
timestamps and sensor delays which are caused when typecasting
datatypes of different size.
Switch to portable typedefs and get rid of "long".
Change-Id: I75b9cace7602345dba9095f046292e6d4db07df4
Diffstat (limited to 'libsensors/cm36651_light.c')
-rw-r--r-- | libsensors/cm36651_light.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsensors/cm36651_light.c b/libsensors/cm36651_light.c index bd7617b..6781797 100644 --- a/libsensors/cm36651_light.c +++ b/libsensors/cm36651_light.c @@ -150,19 +150,19 @@ int cm36651_light_deactivate(struct smdk4x12_sensors_handlers *handlers) return 0; } -int cm36651_light_set_delay(struct smdk4x12_sensors_handlers *handlers, long int delay) +int cm36651_light_set_delay(struct smdk4x12_sensors_handlers *handlers, int64_t delay) { struct cm36651_light_data *data; int rc; - ALOGD("%s(%p, %ld)", __func__, handlers, delay); + ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay); if (handlers == NULL || handlers->data == NULL) return -EINVAL; data = (struct cm36651_light_data *) handlers->data; - rc = sysfs_value_write(data->path_delay, (int) delay); + rc = sysfs_value_write(data->path_delay, delay); if (rc < 0) { ALOGE("%s: Unable to write sysfs value", __func__); return -1; |