linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: gregkh@linuxfoundation.org, fengguang.wu@intel.com,
	oneukum@suse.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [v6] usb: core: Add "quirks" parameter for usbcore
Date: Tue, 13 Mar 2018 04:36:54 -0700	[thread overview]
Message-ID: <20180313113654.GA3304@bombadil.infradead.org> (raw)

On Tue, Mar 13, 2018 at 03:26:19PM +0800, Kai-Heng Feng wrote:
> +	usbcore.quirks=
> +			[USB] A list of quirks entries to supplement or
> +			override the built-in usb core quirk list.  List
> +			entries are separated by commas.  Each entry has
> +			the form VID:PID:Flags where VID and PID are Vendor
> +			and Product ID values (4-digit hex numbers) and
> +			Flags is a set of characters, each corresponding
> +			to a common usb core quirk flag as follows:

This doesn't really tell me that the specified quirks will be XORed with
the built-in quirks.  Maybe something like ...

			[USB] A list of quirk entries to augment the
			built-in usb core quirk list.  List entries are
			separated by commas.  Each entry has the form
			VendorID:ProductID:Flags.  The IDs are 4-digit hex
			numbers and Flags is a set of letters.  Each letter
			will change the built-in quirk; setting it if it is
			clear and clearing it if it is set.  The letters
			have the following meanings:

> +		/* Each entry consists of VID:PID:flags */
> +		field = strsep(&p, ":");
> +		if (!field)
> +			break;
> +
> +		if (kstrtou16(field, 16, &vid))
> +			break;
> +
> +		field = strsep(&p, ":");
> +		if (!field)
> +			break;
> +
> +		if (kstrtou16(field, 16, &pid))
> +			break;

Is there a reason to not use sscanf here like hid-quirks.c does?
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-03-13 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 11:36 Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-19 15:57 [v6] usb: core: Add "quirks" parameter for usbcore Kai-Heng Feng
2018-03-14  2:00 Kai-Heng Feng
2018-03-13  7:26 Kai-Heng Feng

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=20180313113654.GA3304@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.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).