Re: [PATCH 1/2]drivers/usb/core/sysfs.c Fix variable 'retval' set but not used

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

 



On Mon, 02 Aug 2010 21:26:28 PDT, "Justin P. Mattock" said:
> diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c

>  	if (alt->string)
> -		retval = device_create_file(&intf->dev, &dev_attr_interface);
> +		device_create_file(&intf->dev, &dev_attr_interface);
>  	intf->sysfs_files_created = 1;
>  	return 0;

What should the code do if device_create_file() manages to fail? Yes, ignoring
the return value is one option, but is it the best one?  'return ret;' might be
another one. Somebody who understands this code and has more caffeine than me
should look this over.

(Nothing personal Justin - it's just my opinion that *anytime* we have a patch
that remove a check for a return code, it needs to justify that ignoring the
return code is appropriate).

Attachment: pgp7Rb05oEE7V.pgp
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux