2014-11-14 05:13:53

by Wang, Yalin

[permalink] [raw]
Subject: [PATCH] 6fire: Convert byte_rev_table uses to bitrev8

Use the inline function instead of directly indexing the array.

This allows some architectures with hardware instructions for bit
reversals to eliminate the array.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Yalin Wang <[email protected]>
---
sound/usb/6fire/firmware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
index 3b02e54..2e39c3f 100644
--- a/sound/usb/6fire/firmware.c
+++ b/sound/usb/6fire/firmware.c
@@ -316,7 +316,7 @@ static int usb6fire_fw_fpga_upload(

while (c != end) {
for (i = 0; c != end && i < FPGA_BUFSIZE; i++, c++)
- buffer[i] = byte_rev_table[(u8) *c];
+ buffer[i] = bitrev8((u8) *c);

ret = usb6fire_fw_fpga_write(device, buffer, i);
if (ret < 0) {
--
2.1.1


2014-11-14 05:45:38

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] 6fire: Convert byte_rev_table uses to bitrev8

On Fri, 2014-11-14 at 13:13 +0800, Wang, Yalin wrote:
> Use the inline function instead of directly indexing the array.
>
> This allows some architectures with hardware instructions for bit
> reversals to eliminate the array.
>
> Signed-off-by: Joe Perches <[email protected]>
> Signed-off-by: Yalin Wang <[email protected]>
> ---
[]
> diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
[]
> @@ -316,7 +316,7 @@ static int usb6fire_fw_fpga_upload(
>
> while (c != end) {
> for (i = 0; c != end && i < FPGA_BUFSIZE; i++, c++)
> - buffer[i] = byte_rev_table[(u8) *c];
> + buffer[i] = bitrev8((u8) *c);

This is not what I submitted.
What I posted did not have a space after (u8)

https://lkml.org/lkml/2014/10/28/1056

If you are going to resubmit or add your own sign-off,
please try to maintain the proper patch that is
submitted and please also use a "From:" line before
the patch itself.

Thanks, Joe