From: "George Spelvin" <linux@horizon.com>
To: hpa@zytor.com, linux@horizon.com, pavel@ucw.cz
Cc: arik@wizery.com, david.gnedt@davizone.at, eliad@wizery.com,
jan.nikitenko@gmail.com,
laurent.pinchart+renesas@ideasonboard.com,
linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-spi@vger.kernel.org, linux-wireless@vger.kernel.org,
linville@tuxdriver.com, luca@coelho.fi, tony@atomide.com
Subject: Re: [PATCH v2 1/3] lib/crc7: Shift crc7() output left 1 bit
Date: 14 May 2014 21:15:51 -0400 [thread overview]
Message-ID: <20140515011551.26781.qmail@ns.horizon.com> (raw)
In-Reply-To: <53740C42.3000906@zytor.com>
H. Peter Anvin wrote:
> If the whole point of this is to use it for MMC/SD cards, why not just
> also subsume the OR 1 and call it crc7_mmc() or something like that.
>
> (Which I'm all for doing... I don't know of any other crc7 users.)
You'll find all users in my patch series. 2/3 updates the MMC
card, while 3/3 hits drivers/net/wireless/ti/wl1251/spi.c and
drivers/net/wireless/ti/wlcore/spi.c (which I'm pretty sure aren't
MMC/SPI cards).
Now, it turns out that they *also* set the lsbit (calling it
WSPI_INIT_CMD_END). However, it's not possible to put that into the CRC
table (it would mess up all bytes but the last), so an explicitly coded
"| 1" is required at the end. Thic ends up being no saving at all to
execution path length, and only moves one instruction from three drivers
to shared code. While making it harder to read the drivers.
A microscopic space saving (if and only if you have more than one of these
drivers loaded) and no performance improvement didn't seem worth it to me.
next prev parent reply other threads:[~2014-05-15 1:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140511082811.GA2695@xo-6d-61-c0.localdomain>
2014-05-11 10:02 ` [PATCH v2 1/3] lib/crc7: Shift crc7() output left 1 bit George Spelvin
[not found] ` <20140511100211.1334.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2014-05-11 10:05 ` [PATCH 2/3] drivers/mmc/host/mmc_spi.c: Use get/put_unaligned_be32 George Spelvin
2014-05-12 8:05 ` Geert Uytterhoeven
[not found] ` <20140511100502.1491.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2014-05-11 10:33 ` Pavel Machek
2014-05-14 10:17 ` Ulf Hansson
2014-05-14 12:23 ` George Spelvin
[not found] ` <20140514122357.11052.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2014-05-14 12:30 ` Ulf Hansson
2014-05-14 14:50 ` John W. Linville
2014-05-11 10:07 ` [PATCH 3/3] drivers/net/wireless/ti/wl*/spi.c: Simplify CRC computation George Spelvin
[not found] ` <20140511100743.1712.qmail-HzZAx2gCgqrSUeElwK9/Pw@public.gmane.org>
2014-05-11 10:36 ` Pavel Machek
2014-05-11 10:32 ` [PATCH v2 1/3] lib/crc7: Shift crc7() output left 1 bit Pavel Machek
2014-05-14 10:14 ` Ulf Hansson
2014-05-15 0:37 ` H. Peter Anvin
2014-05-15 1:15 ` George Spelvin [this message]
2014-05-15 1:26 ` H. Peter Anvin
2014-05-15 2:02 ` George Spelvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140515011551.26781.qmail@ns.horizon.com \
--to=linux@horizon.com \
--cc=arik@wizery.com \
--cc=david.gnedt@davizone.at \
--cc=eliad@wizery.com \
--cc=hpa@zytor.com \
--cc=jan.nikitenko@gmail.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=luca@coelho.fi \
--cc=pavel@ucw.cz \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).