summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-01-22 09:08:25 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-08 14:26:59 -0800
commit2c38103382d077020d1335a7094190b493ed358b (patch)
treef6cb35a579172e2add4dc734aa45e8c606cafa3c
parentd86ad91c7b7c429e0470cf1ac0b0bda14ab32b67 (diff)
downloadchrome-ec-2c38103382d077020d1335a7094190b493ed358b.tar.gz
ec_commands: Fix more warnings from check_patch.pl
Rename lid_ang lid_angle, split long lines. BRANCH=none BUG=none TEST=Compile. Change-Id: Idab0877f77d69d8e0b099891834cb775535dd058 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1428759 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--common/motion_lid.c36
-rw-r--r--include/ec_commands.h18
-rw-r--r--util/ectool.c14
3 files changed, 35 insertions, 33 deletions
diff --git a/common/motion_lid.c b/common/motion_lid.c
index db7b076afa..4513df1e48 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -149,21 +149,21 @@ __attribute__((weak)) int board_is_lid_angle_tablet_mode(void)
* by using MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE.
*/
-#define DEFAULT_TABLET_MODE_ANG (180)
+#define DEFAULT_TABLET_MODE_ANGLE (180)
#define DEFAULT_TABLET_MODE_HYS (20)
#define TABLET_ZONE_ANGLE(a, h) ((a) + (h))
#define LAPTOP_ZONE_ANGLE(a, h) ((a) - (h))
static fp_t tablet_zone_lid_angle =
- FLOAT_TO_FP(TABLET_ZONE_ANGLE(DEFAULT_TABLET_MODE_ANG,
+ FLOAT_TO_FP(TABLET_ZONE_ANGLE(DEFAULT_TABLET_MODE_ANGLE,
DEFAULT_TABLET_MODE_HYS));
static fp_t laptop_zone_lid_angle =
- FLOAT_TO_FP(LAPTOP_ZONE_ANGLE(DEFAULT_TABLET_MODE_ANG,
+ FLOAT_TO_FP(LAPTOP_ZONE_ANGLE(DEFAULT_TABLET_MODE_ANGLE,
DEFAULT_TABLET_MODE_HYS));
-static int tablet_mode_lid_ang = DEFAULT_TABLET_MODE_ANG;
-static int tablet_mode_hys_deg = DEFAULT_TABLET_MODE_HYS;
+static int tablet_mode_lid_angle = DEFAULT_TABLET_MODE_ANGLE;
+static int tablet_mode_hys_degree = DEFAULT_TABLET_MODE_HYS;
/*
* We will change our tablet mode status when we are "convinced" that it has
@@ -212,20 +212,20 @@ static void motion_lid_set_tablet_mode(int reliable)
tablet_mode_debounce_cnt = TABLET_MODE_DEBOUNCE_COUNT;
}
-static int lid_angle_set_tablet_mode_threshold(int ang, int hys)
+static int lid_angle_set_tablet_mode_threshold(int angle, int hys)
{
- if ((ang == EC_MOTION_SENSE_NO_VALUE) ||
+ if ((angle == EC_MOTION_SENSE_NO_VALUE) ||
(hys == EC_MOTION_SENSE_NO_VALUE))
return EC_RES_SUCCESS;
- if ((ang < 0) || (hys < 0) || (ang < hys) || ((ang + hys) > 360))
+ if ((angle < 0) || (hys < 0) || (angle < hys) || ((angle + hys) > 360))
return EC_RES_INVALID_PARAM;
- tablet_mode_lid_ang = ang;
- tablet_mode_hys_deg = hys;
+ tablet_mode_lid_angle = angle;
+ tablet_mode_hys_degree = hys;
- tablet_zone_lid_angle = INT_TO_FP(TABLET_ZONE_ANGLE(ang, hys));
- laptop_zone_lid_angle = INT_TO_FP(LAPTOP_ZONE_ANGLE(ang, hys));
+ tablet_zone_lid_angle = INT_TO_FP(TABLET_ZONE_ANGLE(angle, hys));
+ laptop_zone_lid_angle = INT_TO_FP(LAPTOP_ZONE_ANGLE(angle, hys));
return EC_RES_SUCCESS;
}
@@ -574,16 +574,16 @@ int host_cmd_motion_lid(struct host_cmd_handler_args *args)
#ifdef CONFIG_TABLET_MODE
int ret;
ret = lid_angle_set_tablet_mode_threshold(
- in->tablet_mode_threshold.lid_ang,
- in->tablet_mode_threshold.hys_deg);
+ in->tablet_mode_threshold.lid_angle,
+ in->tablet_mode_threshold.hys_degree);
if (ret != EC_RES_SUCCESS)
return ret;
- out->tablet_mode_threshold.lid_ang =
- tablet_mode_lid_ang;
- out->tablet_mode_threshold.hys_deg =
- tablet_mode_hys_deg;
+ out->tablet_mode_threshold.lid_angle =
+ tablet_mode_lid_angle;
+ out->tablet_mode_threshold.hys_degree =
+ tablet_mode_hys_degree;
args->response_size =
sizeof(out->tablet_mode_threshold);
diff --git a/include/ec_commands.h b/include/ec_commands.h
index cc46eec72a..60ef2d1812 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -2701,16 +2701,16 @@ struct ec_params_motion_sense {
* Lid angle threshold for switching between tablet and
* clamshell mode.
*/
- int16_t lid_ang;
+ int16_t lid_angle;
/*
* Hysteresis degree to prevent fluctuations between
* clamshell and tablet mode if lid angle keeps
* changing around the threshold. Lid motion driver will
- * use lid_ang + hys_deg to trigger tablet mode and
- * lid_ang - hys_deg to trigger clamshell mode.
+ * use lid_angle + hys_degree to trigger tablet mode and
+ * lid_angle - hys_degree to trigger clamshell mode.
*/
- int16_t hys_deg;
+ int16_t hys_degree;
} tablet_mode_threshold;
};
} __ec_todo_packed;
@@ -2823,10 +2823,10 @@ struct ec_response_motion_sense {
* Lid angle threshold for switching between tablet and
* clamshell mode.
*/
- uint16_t lid_ang;
+ uint16_t lid_angle;
/* Hysteresis degree. */
- uint16_t hys_deg;
+ uint16_t hys_degree;
} tablet_mode_threshold;
};
@@ -4417,9 +4417,9 @@ struct ec_params_cec_write {
* struct ec_params_cec_set - CEC parameters set
* @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
* @val: in case cmd is CEC_CMD_ENABLE, this field can be 0 to disable CEC
- * or 1 to enable CEC functionality, in case cmd is CEC_CMD_LOGICAL_ADDRESS,
- * this field encodes the requested logical address between 0 and 15
- * or 0xff to unregister
+ * or 1 to enable CEC functionality, in case cmd is
+ * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical
+ * address between 0 and 15 or 0xff to unregister
*/
struct ec_params_cec_set {
uint8_t cmd; /* enum cec_command */
diff --git a/util/ectool.c b/util/ectool.c
index b863a190f3..33d464138d 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -4484,11 +4484,13 @@ static int cmd_motionsense(int argc, char **argv)
* EC_MOTION_SENSE_NO_VALUE indicates to the EC that host is
* attempting to only read the current values.
*/
- param.tablet_mode_threshold.lid_ang = EC_MOTION_SENSE_NO_VALUE;
- param.tablet_mode_threshold.hys_deg = EC_MOTION_SENSE_NO_VALUE;
+ param.tablet_mode_threshold.lid_angle =
+ EC_MOTION_SENSE_NO_VALUE;
+ param.tablet_mode_threshold.hys_degree =
+ EC_MOTION_SENSE_NO_VALUE;
if (argc == 4) {
- param.tablet_mode_threshold.lid_ang = strtol(argv[2],
+ param.tablet_mode_threshold.lid_angle = strtol(argv[2],
&e, 0);
if (e && *e) {
@@ -4496,7 +4498,7 @@ static int cmd_motionsense(int argc, char **argv)
return -1;
}
- param.tablet_mode_threshold.hys_deg = strtol(argv[3],
+ param.tablet_mode_threshold.hys_degree = strtol(argv[3],
&e, 0);
if (e && *e) {
fprintf(stderr, "Bad %s arg.\n", argv[3]);
@@ -4514,8 +4516,8 @@ static int cmd_motionsense(int argc, char **argv)
return rv;
printf("tablet_mode_angle=%d hys=%d\n",
- resp->tablet_mode_threshold.lid_ang,
- resp->tablet_mode_threshold.hys_deg);
+ resp->tablet_mode_threshold.lid_angle,
+ resp->tablet_mode_threshold.hys_degree);
return 0;
}