aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2015-10-28 12:42:45 -0400
committerLee Jones <lee.jones@linaro.org>2016-01-14 03:44:01 -0500
commit8827a642a4635d5e696037f9213cb1d015d4cec3 (patch)
tree1b9ea0245a2cf737ef7ad6ae2fe27545e4d485dd
parent2756db6c63662a179d1a59be2c0fa260dbd1b2fc (diff)
mfd: cros_ec_spi: Repair comparison ordering issue
WARNING: Comparisons should place the constant on the right side of the test + BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); WARNING: Comparisons should place the constant on the right side of the test + BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); total: 0 errors, 2 warnings, 731 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/cros_ec_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index d6af52d18c06..ebe9b9477cb2 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -175,7 +175,7 @@ static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev,
175 unsigned long deadline; 175 unsigned long deadline;
176 int todo; 176 int todo;
177 177
178 BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); 178 BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
179 179
180 /* Receive data until we see the header byte */ 180 /* Receive data until we see the header byte */
181 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); 181 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
@@ -283,7 +283,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
283 unsigned long deadline; 283 unsigned long deadline;
284 int todo; 284 int todo;
285 285
286 BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); 286 BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
287 287
288 /* Receive data until we see the header byte */ 288 /* Receive data until we see the header byte */
289 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); 289 deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);