Re: [PATCH 1/2] Staging: line6/midi.c: Fixed call of obsolete function strict_strtoul

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2011 at 09:12:36AM +0100, Andor Daam wrote:
> The function strict_strtoul is obsolete and should be replaced by the
> new kstrto* functions.
> As the variable midi_mask_transmit is of type int a conversion to
> unsigned long is not needed and unsigned int should be sufficient.
> 
> Signed-off-by: Andor Daam <andor.daam@xxxxxxxxxxxxxx>
> ---
>  drivers/staging/line6/midi.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c
> index e554a2d..fb87829 100644
> --- a/drivers/staging/line6/midi.c
> +++ b/drivers/staging/line6/midi.c
> @@ -307,10 +307,10 @@ static ssize_t midi_set_midi_mask_transmit(struct device *dev,
>  {
>  	struct usb_interface *interface = to_usb_interface(dev);
>  	struct usb_line6 *line6 = usb_get_intfdata(interface);
> -	unsigned long value;
> +	unsigned int value;
>  	int ret;
>  
> -	ret = strict_strtoul(buf, 10, &value);
> +	ret = kstrtouint(buf, 10, &value);

It's like an awkward thing.  You're right that midi_mask_transmit is
an int.  But value is an unsigned int.  And you're calling
kstrtouint().  But you'd think that a "mask" would be unsigned.  And
if you look how it's used, we pass it to
line6_midibuf_skip_message() and that's an unsigned short.

My guess is that everything should just be unsigned short, but I
haven't looked at it too hard.

Btw, you people are doing this as part of a class and all.  Figure
out cscope.  To use it with the kernel just do "make cscope" and
then set up vim to use it.  The command is
":cs find s midi_mask_transmit" and then CTRL-t to go back.

regards,
dan carpenter

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux