提交 8827a642 编写于 作者: L Lee Jones

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: NLee Jones <lee.jones@linaro.org>
上级 2756db6c
...@@ -175,7 +175,7 @@ static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev, ...@@ -175,7 +175,7 @@ static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev,
unsigned long deadline; unsigned long deadline;
int todo; int todo;
BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
/* Receive data until we see the header byte */ /* Receive data until we see the header byte */
deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); 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,7 +283,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
unsigned long deadline; unsigned long deadline;
int todo; int todo;
BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size); BUG_ON(ec_dev->din_size < EC_MSG_PREAMBLE_COUNT);
/* Receive data until we see the header byte */ /* Receive data until we see the header byte */
deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS); deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册