mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jonas Rebmann <jre@pengutronix.de>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	kernel@pengutronix.de
Subject: Re: [PATCH 3/7] spi: spidev_test: allow disabling rx or tx buffers
Date: Mon, 14 Sep 2026 18:20:18 +0100	[thread overview]
Message-ID: <aqgs0s5bbFDyJAo8@sirena.org.uk> (raw)
In-Reply-To: <20260914-spi-sun4i-spidev_test-v1-3-72d6a3b38cee@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

On Mon, Sep 14, 2026 at 04:50:42PM +0200, Jonas Rebmann wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> Allow not providing rx or tx buffers. This is useful to check if drivers
> that don't use SPI_CONTROLLER_MUST_RX (or -TX respectively) handle their
> operations correctly without a buffer.

> -	if (output_file) {
> +	if (rx && output_file) {
>  		out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
>  		if (out_fd < 0)
>  			pabort("could not open output file");

It'd be nice to complain if the user asks for output and no RX
simultaneously, but OTOH I'm sure the target audience can cope.

> -	if (input_tx && input_file)
> -		pabort("only one of -p and --input may be selected");
> +	if (!!input_tx + !!input_file + !do_tx > 0)
> +		pabort("only one of -p, -i (--input), -t (--no-tx) may be selected");

This logic is probably a bit *too* cute; it's far too hard to read.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-09-14 17:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 14:50 [PATCH 0/7] spi: spidev_test: new features Jonas Rebmann
2026-09-14 14:50 ` [PATCH 1/7] spi: spidev_test: include tools/include Jonas Rebmann
2026-09-14 14:50 ` [PATCH 2/7] spi: spidev_test: add compare mode Jonas Rebmann
2026-09-14 17:03   ` Mark Brown
2026-09-14 14:50 ` [PATCH 3/7] spi: spidev_test: allow disabling rx or tx buffers Jonas Rebmann
2026-09-14 17:20   ` Mark Brown [this message]
2026-09-14 14:50 ` [PATCH 4/7] spi: spidev_test: don't send 0x0 or 0xff Jonas Rebmann
2026-09-14 17:22   ` Mark Brown
2026-09-14 14:50 ` [PATCH 5/7] spi: spidev_test: send predictable data Jonas Rebmann
2026-09-14 14:50 ` [PATCH 6/7] spi: spidev_test: add option to split message into multiple transfers Jonas Rebmann
2026-09-14 18:04   ` Mark Brown
2026-09-14 14:50 ` [PATCH 7/7] spi: spidev_test: print TX on error Jonas Rebmann
2026-09-14 18:07   ` Mark Brown

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=aqgs0s5bbFDyJAo8@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=jre@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mkl@pengutronix.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

all inboxes | Powered by JetHome®