OSDN Git Service

Tweak a few traces
authorPatrick Porlan <patrick.porlan@intel.com>
Thu, 18 Dec 2014 09:04:06 +0000 (10:04 +0100)
committerPatrick Porlan <patrick.porlan@intel.com>
Thu, 18 Dec 2014 10:50:02 +0000 (11:50 +0100)
%f -> %g (don't need all these digits)
ALOGI -> ALOGV (a matter of taste)

Change-Id: Ib65ac6a0fea186cb52da9fa235932b2026bca42b
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
control.c
enumeration.c

index 57bad95..abf9c7c 100644 (file)
--- a/control.c
+++ b/control.c
@@ -1326,10 +1326,9 @@ static int propagate_sensor_report (int s, struct sensors_event_t  *data)
        /* Convert the data into the expected Android-level format */
        for (c=0; c<num_fields; c++) {
 
-               data->data[c] = sensor[s].ops.transform
-                                                       (s, c, current_sample);
+               data->data[c] = sensor[s].ops.transform (s, c, current_sample);
 
-               ALOGV("\tfield %d: %f\n", c, data->data[c]);
+               ALOGV("\tfield %d: %g\n", c, data->data[c]);
                current_sample += sensor[s].channel[c].size;
        }
 
@@ -1565,7 +1564,7 @@ int sensor_set_delay (int s, int64_t ns)
 
        requested_sampling_rate = 1000000000.0 / ns;
 
-       ALOGV("Entering set delay S%d (%s): current rate: %f, requested: %f\n",
+       ALOGV("Entering set delay S%d (%s): current rate: %g, requested: %g\n",
                s, sensor[s].friendly_name, sensor[s].sampling_rate,
                requested_sampling_rate);
 
index bb1831d..54467f2 100644 (file)
@@ -330,14 +330,14 @@ static void add_sensor (int dev_num, int catalog_index, int use_polling)
                 * so try to store it in sensor's scale file
                 */
                if (sysfs_write_float(sysfs_path, scale) == -1 && errno == ENOENT) {
-                       ALOGE("Failed to store scale[%f] into %s - file is missing", scale, sysfs_path);
+                       ALOGE("Failed to store scale[%g] into %s - file is missing", scale, sysfs_path);
                        /* Store failed, try to store the scale into channel specific file */
                        for (c = 0; c < num_channels; c++)
                        {
                                sprintf(sysfs_path, BASE_PATH "%s", dev_num,
                                        sensor_catalog[catalog_index].channel[c].scale_path);
                                if (sysfs_write_float(sysfs_path, scale) == -1)
-                                       ALOGE("Failed to store scale[%f] into %s", scale, sysfs_path);
+                                       ALOGE("Failed to store scale[%g] into %s", scale, sysfs_path);
                         }
                 }
        }
@@ -345,7 +345,7 @@ static void add_sensor (int dev_num, int catalog_index, int use_polling)
        sprintf(sysfs_path, SENSOR_SCALE_PATH, dev_num, prefix);
        if (!sysfs_read_float(sysfs_path, &scale)) {
                 sensor[s].scale = scale;
-               ALOGI("Scale path:%s scale:%f dev_num:%d\n",
+               ALOGV("Scale path:%s scale:%g dev_num:%d\n",
                                         sysfs_path, scale, dev_num);
        } else {
                 sensor[s].scale = 1;
@@ -360,8 +360,8 @@ static void add_sensor (int dev_num, int catalog_index, int use_polling)
                                 sensor[s].channel[c].scale = scale;
                                sensor[s].scale = 0;
 
-                               ALOGI(  "Scale path:%s "
-                                       "channel scale:%f dev_num:%d\n",
+                               ALOGV(  "Scale path:%s "
+                                       "channel scale:%g dev_num:%d\n",
                                         sysfs_path, scale, dev_num);
                         }
                 }