lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 03 Jun 2012 04:48:38 -0700
From:	Joe Perches <joe@...ches.com>
To:	stefani@...bold.net
Cc:	linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
	oneukum@...e.de, alan@...rguk.ukuu.org.uk,
	thomas.braunstorfinger@...de-schwarz.com
Subject: Re: [PATCH] add new NRP power meter USB device driver

On Sun, 2012-06-03 at 10:46 +0200, stefani@...bold.net wrote:
> From: Stefani Seibold <stefani@...bold.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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ