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:	Tue, 28 Oct 2014 15:25:36 +0200
From:	Octavian Purdila <octavian.purdila@...el.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Octavian Purdila <octavian.purdila@...el.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>, wsa@...-dreams.de,
	sameo@...ux.intel.com, Lee Jones <lee.jones@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, Johan Hovold <johan@...nel.org>,
	Daniel Baluta <daniel.baluta@...el.com>,
	Laurentiu Palcu <laurentiu.palcu@...el.com>,
	linux-usb@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
	linux-gpio@...r.kernel.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH v9 1/4] mfd: add support for Diolan DLN-2 devices

On Mon, Oct 27, 2014 at 6:57 PM, Joe Perches <joe@...ches.com> wrote:
> On Mon, 2014-10-27 at 18:31 +0200, Octavian Purdila wrote:
>> This patch implements the USB part of the Diolan USB-I2C/SPI/GPIO
>> Master Adapter DLN-2. Details about the device can be found here:
>
> trivia:
>

Thanks for the review Joe.

>> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> []
>> +static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
>> +                       const void *obuf, unsigned obuf_len,
>> +                       void *ibuf, unsigned *ibuf_len)
>> +{
>> +     int ret = 0;
>> +     int rx_slot;
>> +     struct dln2_response *rsp;
>> +     struct dln2_rx_context *rxc;
>> +     struct device *dev = &dln2->interface->dev;
>> +     const int timeout = DLN2_USB_TIMEOUT * HZ / 1000;
>
> unsigned long timeout?
>

Ok.

> []
>
>> +     ret = wait_for_completion_interruptible_timeout(&rxc->done, timeout);
>> +     if (ret <= 0) {
>> +             if (!ret)
>> +                     ret = -ETIMEDOUT;
>> +             goto out_free_rx_slot;
>> +     }
>
> []

I think you forgot to add your comments here?

>
>> +static int dln2_print_serialno(struct dln2_dev *dln2)
>> +{
>> +     int ret;
>> +     __le32 serial_no;
>> +     int len = sizeof(serial_no);
>> +     struct device *dev = &dln2->interface->dev;
>> +
>> +     ret = _dln2_transfer(dln2, DLN2_HANDLE_CTRL, CMD_GET_DEVICE_SN, NULL, 0,
>> +                          &serial_no, &len);
>> +     if (ret < 0)
>> +             return ret;
>> +     if (len < sizeof(serial_no))
>> +             return -EREMOTEIO;
>> +
>> +     dev_info(dev, "Diolan DLN2 serial 0x%x\n", le32_to_cpu(serial_no));
>
> why a hex serial #?
>

Good point, I will switch it to decimal.
--
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