lib/crc7: Shift crc7() output left 1 bit

This eliminates a 1-bit left shift in every single caller,
and makes the inner loop of the CRC computation more efficient.

Renamed crc7 to crc7_be (big-endian) since the interface changed.

Also purged #include <linux/crc7.h> from files that don't use it at all.

Signed-off-by: George Spelvin <linux@horizon.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
George Spelvin
2014-05-10 10:32:57 -04:00
committed by John W. Linville
parent d91a48cbae
commit 1836eea209
7 changed files with 53 additions and 49 deletions

View File

@@ -472,7 +472,7 @@ mmc_spi_command_send(struct mmc_spi_host *host,
*cp++ = (u8)(arg >> 16);
*cp++ = (u8)(arg >> 8);
*cp++ = (u8)arg;
*cp++ = (crc7(0, &data->status[1], 5) << 1) | 0x01;
*cp++ = crc7_be(0, &data->status[1], 5) | 0x01;
/* Then, read up to 13 bytes (while writing all-ones):
* - N(CR) (== 1..8) bytes of all-ones