All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: "Benoît Monin" <benoit.monin@bootlin.com>
Cc: linux-i2c@vger.kernel.org, Jean Delvare <jdelvare@suse.de>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH i2c-tools v4] i2ctransfer: Add optional message modifier flags
Date: Tue, 9 Jun 2026 13:02:50 +0200	[thread overview]
Message-ID: <aify2jjX4MZsXUGy@shikoro> (raw)
In-Reply-To: <20260608-msg-flags-v4-1-68ad6f0a4e4d@bootlin.com>

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

Hi Benoît,

Looks mostly good, I think we are nearly there.

> +	/* unexpected next part of the message: length or address */
> +	case '0':
> +	case '1':
> +	case '2':
> +	case '3':
> +	case '4':
> +	case '5':
> +	case '6':
> +	case '7':
> +	case '8':
> +	case '9':
> +	case '?':
> +	case '@':
> +		fprintf(stderr, "Error: Unexpected flag '%c'\n", arg);
> +		return FLAGS_UNEXPECTED;

I suggest to drop this error message. The above characters are not
exactly flags. By removing the printout here...

> +			for (ret = FLAGS_GOT_OPTIONAL; *arg_ptr && ret == FLAGS_GOT_OPTIONAL; arg_ptr++)
> +				ret = add_flag_if_supported(&flags, funcs, *arg_ptr);
> +			if (ret == FLAGS_UNKNOWN || ret == FLAGS_UNEXPECTED || ret == FLAGS_UNSUPPORTED)

... and simplifying this to ...

+			if (ret == FLAGS_UNKNOWN || ret == FLAGS_UNSUPPORTED)

... we get the error message of a missing r/w-flag instead. I think this
is more helpful to the user? What do you think?

Happy hacking,

   Wolfram


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

      reply	other threads:[~2026-06-09 11:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 15:21 [PATCH i2c-tools v4] i2ctransfer: Add optional message modifier flags Benoît Monin
2026-06-09 11:02 ` Wolfram Sang [this message]

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=aify2jjX4MZsXUGy@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=benoit.monin@bootlin.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.