[RFC-patch] pc87360 - unchecked rc=device_create_file() fixes

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

 



On Thu, Aug 17, 2006 at 10:45:03PM -0400, Mark M. Hoffman wrote:
> It's a reasonable question though.  I wondered about it for a little bit
> when I saw that struct attribute_group seems to be missing two const
> modifiers, i.e.:
> 
> --- linux-2.6.18-rc4-mm1.orig/include/linux/sysfs.h
> +++ linux-2.6.18-rc4-mm1/include/linux/sysfs.h
> @@ -24,7 +24,7 @@ struct attribute {
>  
>  struct attribute_group {
>  	const char		* name;
> -	struct attribute	** attrs;
> +	const struct attribute	* const * attrs;
>  };
>  
> But actually compiling a kernel with the above introduces a ton of warnings.

It shouldn't make that many warnings, but yeah, that would be the
correct fix.

> All those I examined could be fixed by adding const to struct attribute
> declarations (AFAICT nobody is actually modifying any data through those
> pointers), but I haven't looked at them all, and it's late here, blah...

Care to send a patch for this?  We are trying to fix up things like this
in the kernel to make it harder for people to do things wrong.

thanks,

greg k-h




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux