[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55071B6B.3010102@intel.com>
Date: Mon, 16 Mar 2015 11:05:31 -0700
From: "H. Peter Anvin" <h.peter.anvin@...el.com>
To: Ingo Molnar <mingo@...nel.org>,
Ross Zwisler <ross.zwisler@...ux.intel.com>
CC: Borislav Petkov <bp@...en8.de>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] x86: Add kerneldoc for pcommit_sfence()
On 03/16/2015 01:35 AM, Ingo Molnar wrote:
>
> :-/
>
> Not sure what hpa's problem with 'void *' was: especially in MM code
> we are using 'void *' rather widely.
>
> All compilers that aim for being able to build the Linux kernel
> implement 'void *' as well, so that 'standard C' argument is pretty
> weak IMHO - unlike some of the more esoteric GCC extensions, this one
> is actually pretty well done and widely used in and outside of the
> kernel.
>
>> It seems like both have arguments for them. Char pointer arithmetic
>> has the advantage that its behavior is standard in C, so it's not
>> specific to gcc. I agree that void* has the advantage that it fits
>> more naturally with the types of the parameters passed in, requiring
>> no casting.
>
> It's also a bonus property of 'void *' that unlike 'char *' it cannot
> be dereferenced. So we use it for opaque buffers wherever we can.
>
The issue isn't void *, it is doing arithmetic on void *.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists