Skip to content

Commit

Permalink
mfd: cros_ec_spi: Repair comparison ordering issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lee Jones committed Jan 14, 2016
1 parent 2756db6 commit 8827a64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/cros_ec_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev,
unsigned long deadline;
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 */
deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
Expand Down Expand Up @@ -283,7 +283,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
unsigned long deadline;
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 */
deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
Expand Down

0 comments on commit 8827a64

Please sign in to comment.