From: Joe Perches <joe@perches.com>
To: stefani@seibold.net
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
oneukum@suse.de, alan@lxorguk.ukuu.org.uk,
thomas.braunstorfinger@rohde-schwarz.com
Subject: Re: [PATCH] add new NRP power meter USB device driver
Date: Sun, 03 Jun 2012 04:48:38 -0700 [thread overview]
Message-ID: <1338724118.24148.22.camel@joe2Laptop> (raw)
In-Reply-To: <1338713172-7496-1-git-send-email-stefani@seibold.net>
On Sun, 2012-06-03 at 10:46 +0200, stefani@seibold.net wrote:
> From: Stefani Seibold <stefani@seibold.net>
>
> This driver supports all of the Rohde&Schwarz RF Power Meter NRP Sensors. These
> sensors are intelligent standalone instruments that communicate via USB.
Just trivia:
> diff --git a/drivers/usb/misc/nrpz.c b/drivers/usb/misc/nrpz.c
[]
> +#include <linux/usb/nrpzmodule.h>
why in linux/usb?
> +static struct usb_device_id nrpz_table[] = {
const
> + {USB_DEVICE(USB_RS_VENDOR_ID, USB_NRP_PRODUCT_ID)},
[]
> +};
> +MODULE_DEVICE_TABLE(usb, nrpz_table);
[]
> +static long nrpz_compat_ioctl(struct file *file, unsigned int cmd,
> + unsigned long arg)
[]
> + switch (cmd) {
> + case NRPZ_START:
> + {
[]
> + case NRPZ_VENDOR_CONTROL_MSG_OUT:
> + {
[]
> + case NRPZ_VENDOR_CONTROL_MSG_IN:
> + {
Perhaps checkpatch should warn on these oddly indented braces.
I think case FOO: { is a bit more standard.
[]
> +static struct usb_class_driver nrpz_class = {
> + .name = "nrpz%d",
> + .fops = &nrpz_fops,
> + .minor_base = NRPZ_MINOR_BASE,
> +};
const ?
[]
> +static struct usb_driver nrpz_driver = {
const ?
> diff --git a/include/linux/usb/nrpzmodule.h b/include/linux/usb/nrpzmodule.h
> new file mode 100644
> index 0000000..8a39aef
> --- /dev/null
> +++ b/include/linux/usb/nrpzmodule.h
Does this file really need to be in include/linux?
It might be better in the same directory as .c
[]
> +struct nrpz_sensor_info {
> + unsigned char bDescriptorType;
> + unsigned short bcdUSB;
> + unsigned char bDeviceClass;
> + unsigned char bDeviceSubClass;
> + unsigned char bDeviceProtocol;
> + unsigned char bMaxPacketSize0;
> + unsigned short vendorId;
> + unsigned short productId;
> + unsigned short bcdDevice;
> + unsigned char iManufacturer;
> + unsigned char iProduct;
> + unsigned char iSerialNumber;
> + unsigned char bNumConfigurations;
This sort of layout creates alignment holes between
some of the struct members, you could reorder it.
or declare it packed if necessary.
next prev parent reply other threads:[~2012-06-03 11:48 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-03 8:46 [PATCH] add new NRP power meter USB device driver stefani
2012-06-03 11:48 ` Joe Perches [this message]
2012-06-13 0:58 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2012-06-02 16:18 stefani
2012-06-02 20:24 ` Oliver Neukum
2012-06-03 5:15 ` Stefani Seibold
2012-05-29 19:14 stefani
2012-05-29 23:15 ` Greg KH
2012-05-31 8:47 ` Stefani Seibold
2012-05-31 9:41 ` Greg KH
2012-06-02 7:10 ` Stefani Seibold
2012-06-02 12:10 ` Greg KH
2012-06-02 15:43 ` Stefani Seibold
2012-05-31 9:53 ` Greg KH
2012-05-31 10:17 ` Oliver Neukum
2012-05-31 12:04 ` Greg KH
2012-05-31 12:32 ` Oliver Neukum
2012-05-31 12:48 ` Greg KH
2012-05-31 14:22 ` Oliver Neukum
2012-05-31 14:32 ` Greg KH
2012-06-01 13:38 ` Oliver Neukum
2012-05-30 8:10 ` Oliver Neukum
2012-05-31 7:43 ` Stefani Seibold
2012-05-31 8:20 ` Oliver Neukum
2012-05-31 9:21 ` Stefani Seibold
2012-06-01 14:16 ` Oliver Neukum
2012-06-01 14:34 ` Alan Cox
2012-06-02 5:57 ` Stefani Seibold
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=1338724118.24148.22.camel@joe2Laptop \
--to=joe@perches.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=stefani@seibold.net \
--cc=thomas.braunstorfinger@rohde-schwarz.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