diff options
author | George Spelvin <linux@horizon.com> | 2014-05-10 10:32:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-16 14:26:52 -0400 |
commit | 1836eea209546b870dd83f3f4ef234d6598a560d (patch) | |
tree | 6d47ab85b4eb40d414ba74f2972b80096fd764b2 /drivers/net | |
parent | d91a48cbae4cc12f6e8a65372a73ecf46f8f1b7f (diff) | |
download | blackbird-obmc-linux-1836eea209546b870dd83f3f4ef234d6598a560d.tar.gz blackbird-obmc-linux-1836eea209546b870dd83f3f4ef234d6598a560d.zip |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ti/wl1251/acx.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl1251/cmd.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl1251/spi.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/spi.c | 3 |
4 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index 5a4ec56c83d0..5695628757ee 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c @@ -2,7 +2,6 @@ #include <linux/module.h> #include <linux/slab.h> -#include <linux/crc7.h> #include "wl1251.h" #include "reg.h" diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c index bf1fa18b9786..ede31f048ef9 100644 --- a/drivers/net/wireless/ti/wl1251/cmd.c +++ b/drivers/net/wireless/ti/wl1251/cmd.c @@ -2,7 +2,6 @@ #include <linux/module.h> #include <linux/slab.h> -#include <linux/crc7.h> #include <linux/etherdevice.h> #include "wl1251.h" diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c index b06d36d99362..e94b57cd5a22 100644 --- a/drivers/net/wireless/ti/wl1251/spi.c +++ b/drivers/net/wireless/ti/wl1251/spi.c @@ -122,8 +122,7 @@ static void wl1251_spi_wake(struct wl1251 *wl) crc[3] = cmd[6]; crc[4] = cmd[5]; - cmd[4] |= crc7(0, crc, WSPI_INIT_CMD_CRC_LEN) << 1; - cmd[4] |= WSPI_INIT_CMD_END; + cmd[4] = crc7_be(0, crc, WSPI_INIT_CMD_CRC_LEN) | WSPI_INIT_CMD_END; t.tx_buf = cmd; t.len = WSPI_INIT_CMD_LEN; diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index 5f3a389dd74c..1d4ddabe6063 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -151,8 +151,7 @@ static void wl12xx_spi_init(struct device *child) crc[3] = cmd[6]; crc[4] = cmd[5]; - cmd[4] |= crc7(0, crc, WSPI_INIT_CMD_CRC_LEN) << 1; - cmd[4] |= WSPI_INIT_CMD_END; + cmd[4] = crc7_be(0, crc, WSPI_INIT_CMD_CRC_LEN) | WSPI_INIT_CMD_END; t.tx_buf = cmd; t.len = WSPI_INIT_CMD_LEN; |