From: David Ellingsworth <david@identd.dyndns.org>
To: Daniel Mack <daniel@caiaq.de>
Cc: linux-kernel@vger.kernel.org,
Wolfram Sang <w.sang@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Jiri Slaby <jslaby@suse.cz>, Dmitry Torokhov <dtor@mail.ru>,
Devin Heitmueller <dheitmueller@kernellabs.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers/media/dvb/dvb-usb/dib0700: CodingStyle fixes
Date: Mon, 24 May 2010 10:35:32 -0400 [thread overview]
Message-ID: <AANLkTimSMLPf697B831bEyiSaeKgcOlKPmnu-0EXuqtX@mail.gmail.com> (raw)
In-Reply-To: <1274698635-19512-2-git-send-email-daniel@caiaq.de>
See comments below:
On Mon, May 24, 2010 at 6:57 AM, Daniel Mack <daniel@caiaq.de> wrote:
<snip />
> @@ -106,28 +106,29 @@ int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen
> int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val)
> {
> u8 buf[3] = { REQUEST_SET_GPIO, gpio, ((gpio_dir & 0x01) << 7) | ((gpio_val & 0x01) << 6) };
> - return dib0700_ctrl_wr(d,buf,3);
> + return dib0700_ctrl_wr(d, buf, sizeof(buf));
> }
>
> static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
> {
> - struct dib0700_state *st = d->priv;
> - u8 b[3];
> - int ret;
> -
> - if (st->fw_version >= 0x10201) {
> - b[0] = REQUEST_SET_USB_XFER_LEN;
> - b[1] = (nb_ts_packets >> 8)&0xff;
> - b[2] = nb_ts_packets & 0xff;
> -
> - deb_info("set the USB xfer len to %i Ts packet\n", nb_ts_packets);
> -
> - ret = dib0700_ctrl_wr(d, b, 3);
> - } else {
> - deb_info("this firmware does not allow to change the USB xfer len\n");
> - ret = -EIO;
> - }
> - return ret;
> + struct dib0700_state *st = d->priv;
> + u8 b[3];
> + int ret;
> +
> + if (st->fw_version >= 0x10201) {
> + b[0] = REQUEST_SET_USB_XFER_LEN;
> + b[1] = (nb_ts_packets >> 8) & 0xff;
> + b[2] = nb_ts_packets & 0xff;
> +
> + deb_info("set the USB xfer len to %i Ts packet\n", nb_ts_packets);
> +
> + ret = dib0700_ctrl_wr(d, b, 3);
sizeof(b) would be better than the hard-coded value of 3 above.
> + } else {
> + deb_info("this firmware does not allow to change the USB xfer len\n");
> + ret = -EIO;
> + }
> +
> + return ret;
> }
>
> /*
<snip />
Everything else looks good.
Regards,
David Ellingsworth
next prev parent reply other threads:[~2010-05-24 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 10:26 [PATCH] drivers/media/dvb/dvb-usb/dib0700: fix return values Daniel Mack
2010-05-19 10:34 ` Wolfram Sang
2010-05-19 10:46 ` Daniel Mack
2010-05-24 2:34 ` Devin Heitmueller
2010-05-24 10:57 ` [PATCH 1/2] " Daniel Mack
2010-05-24 11:14 ` Wolfram Sang
2010-05-24 10:57 ` [PATCH 2/2] drivers/media/dvb/dvb-usb/dib0700: CodingStyle fixes Daniel Mack
2010-05-24 11:12 ` Wolfram Sang
2010-05-24 14:35 ` David Ellingsworth [this message]
2010-05-24 15:23 ` [PATCH] " Daniel Mack
2010-05-24 15:56 ` Dmitry Torokhov
2010-05-24 16:02 ` Daniel Mack
2010-05-29 3:53 ` Mauro Carvalho Chehab
2010-05-29 3:58 ` 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=AANLkTimSMLPf697B831bEyiSaeKgcOlKPmnu-0EXuqtX@mail.gmail.com \
--to=david@identd.dyndns.org \
--cc=daniel@caiaq.de \
--cc=dheitmueller@kernellabs.com \
--cc=dtor@mail.ru \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=w.sang@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;
as well as URLs for NNTP newsgroup(s).