From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] command "sspi": add write-only flag '.w' (discard read data)
Date: Wed, 20 Jul 2011 21:27:21 -0400 [thread overview]
Message-ID: <201107202127.22405.vapier@gentoo.org> (raw)
In-Reply-To: <1311181487.27155.33.camel@ws-apr.office.loc>
On Wednesday, July 20, 2011 13:04:47 Andreas Pretzsch wrote:
> I also thought about passing NULL for the read buffer, but a quick
> browse through the code showed that most, but not all SPI drivers are
> prepared for that. And as there is already a static rx buffer in the spi
> command code, I preferred to keep a few needless byte copies over fixing
> all the spi drivers...
those drivers are broken. the SPI API requires them to handle NULL rx or tx
buffers. do not cater to broken code by avoiding fixing common code because
of bugs in drivers.
> Following the common U-Boot way to do this, I'd suggest
> sspi [<bus>:]<cs>[.<mode>] <bit_len> <dout> [din_env_var]
> and either never print the read result to the console (my favorite) or
> only if no env variable to store is passed. To be defined, comments
> welcome.
is this the common u-boot approach ? seems like extending every random func
to take a supplementary env var is the wrong way. if the hush shell simply
supported syntax like:
foo="`sspi ......`"
then every command would get this for free
> > along these lines, doesnt the general shell provide basic output
> > redirection to support "silencing" all commands rather than having to
> > add a "quiet" flag to them all ? then your script could simply do
> > "sspi ... >/dev/null" (or however u-boot does it).
>
> Not that I know of. Just tried on hush parser, no effect. Also looks
> like the whole redirect code is disabled by a #ifndef __U_BOOT__.
> Maybe one could change env stdout before and after, might work, but I'd
> call that grotesque...
yes, playing with stdout would be awful, but it would work today ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110720/6b17f8cb/attachment.pgp
next prev parent reply other threads:[~2011-07-21 1:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-16 17:32 [U-Boot] [PATCH] command "sspi": add write-only flag '.w' (discard read data) Andreas Pretzsch
2011-07-18 17:49 ` Mike Frysinger
2011-07-20 17:04 ` Andreas Pretzsch
2011-07-21 1:27 ` Mike Frysinger [this message]
2011-07-21 9:01 ` Detlev Zundel
2011-07-22 18:02 ` Andreas Pretzsch
2011-07-22 19:07 ` Mike Frysinger
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=201107202127.22405.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/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