Re: bttv-driver.c:3964: error: void value not ignored as it oughtto be

From: Michael Krufky
Date: Mon Jul 17 2006 - 17:29:20 EST


Nish Aravamudan wrote:
> On 7/17/06, Michael Krufky <mkrufky@xxxxxxxxxxx> wrote:
>> Axel Thimm wrote:
>> > latest hg fails on > 2.6.17 due to video_device_create_file being void
>> > but still being asked for a return value in bttv-driver.c
>> >
>> > linux/drivers/media/video/bt8xx/bttv-driver.c:
>> >
>> > 3963 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
>> > 3964 ret = video_device_create_file(btv->video_dev,
>> class_device_attr_card);
>> > 3965 if (ret < 0)
>> >
>> >
>> > linux/include/media/v4l2-dev.h:
>> >
>> > 379 static inline void
>> > 380 video_device_create_file(struct video_device *vfd,
>> > 381 struct class_device_attribute *attr)
>> > 382 {
>> >
>
> <snip>
>
>> Hmmm... This was caused by the "Check all __must_check warnings in
>> bttv." patch from Randy Dunlap (cc's from original thread added)
>>
>> I am aware that this was done for various reasons of sanity checking,
>> however, we cannot check the return value of a void ;-)
>
> For the sanity checking, I don't think video_device_create_file()
> should be a void function. It probably should return
> class_device_create_file()'s return value, no? As it can fail...
>

You are correct... I was merely pointing out the error, but now I see it
runs deeper than I had thought. I will fix both
video_device_create_file and video_device_remove_file to return the
class_device_foo return values, then I'll push it over to Mauro.

Cheers,

Michael Krufky

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