RE: [PATCH] Cast removal

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

 



>If you're discussing this type of thing, I agree wholeheartedly:
>
>static void acpi_processor_notify(acpi_handle handle, u32 
>event, void *data)  {
>-	struct acpi_processor *pr = (struct acpi_processor *)data;
>+	struct acpi_processor *pr = data;
>
>
>I find this one interesting, as we've put a number of them 
>into the ACPICA core:
>
>-	(void) kmem_cache_destroy(cache);
>+	kmem_cache_destroy(cache);
>
>I believe that the point of the (void) is to prevent lint from 
>squawking, and perhaps some picky ANSI-C compilers. What is 
>the overall Linux policy on this?

Back when I started on Linux I was told that (void) foo()
was just extra characters and somehow made the code "hard to read"
and was thus not the "Linux way".

I think I did it because in a previous life kernel code needed to be
lint-free
to get checked in, and lint complained about return values getting
ignored.
I happen to agree with lint because I think it uncovers real bugs -- in
this case ignored error return values -- something that is rarely tested
at run-time until you need it:-)  But I have no interest in a style
debate.
I expect the custom will get changed when Linus decides that it is
useful, and not before.

-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux