linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: dhowells@redhat.com, mkrufky@linuxtv.org, linux-media@vger.kernel.org
Subject: Re: [PATCH] cxusb: Use enum to represent table offsets rather than hard-coding numbers
Date: Tue, 17 Feb 2015 13:45:50 +0000	[thread overview]
Message-ID: <28064.1424180750@warthog.procyon.org.uk> (raw)
In-Reply-To: <20150217095705.6b317321@recife.lan>

Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote:

> I would do a s/ix_USB_PID_// in the above, in order to simplify the
> namespace and to avoid giving the false impression that those are vendor
> IDs.

Okay.

> If you look below on your patch, even you forgot to add a "ix_" prefix into
> one of the entires ;)

Bah.  I realised I'd forgotten and went back to try and fix them up.

> Just calling MEDION_MD95700..MYGICA_T230 would be enough and shorter.

True.

> static struct usb_device_id cxusb_table [] = {
> 	[VID_MEDION] = {USB_VID_MEDION,	USB_PID_MEDION_MD95700},
> ...

That should really be:

	[VID_MEDION_MD95700] = {USB_VID_MEDION,	USB_PID_MEDION_MD95700},

since the index number is the model, not the vendor, which brings me to:

	[DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM] = {USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM},

which would be excessively long.

> > +	_(USB_VID_MEDION,	USB_PID_MEDION_MD95700), // 0
> 
> Please don't use c99 comments. Also, I don't think that the comments would
> help, as the entries on this table doesn't need to follow the same order
> as defined at the enum.

Sorry, yes, I meant those as guides purely for when I was converting numbers
to symbols.

David

  reply	other threads:[~2015-02-17 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 15:33 [PATCH] cxusb: Use enum to represent table offsets rather than hard-coding numbers David Howells
2015-02-17 11:57 ` Mauro Carvalho Chehab
2015-02-17 13:45   ` David Howells [this message]
2015-02-17 13:52     ` David Howells
2015-02-17 13:57     ` Mauro Carvalho Chehab

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=28064.1424180750@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=mkrufky@linuxtv.org \
    /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).