From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933287AbbCPSFd (ORCPT ); Mon, 16 Mar 2015 14:05:33 -0400 Received: from mga03.intel.com ([134.134.136.65]:32008 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932874AbbCPSFc (ORCPT ); Mon, 16 Mar 2015 14:05:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,410,1422950400"; d="scan'208";a="666002715" Message-ID: <55071B6B.3010102@intel.com> Date: Mon, 16 Mar 2015 11:05:31 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ingo Molnar , Ross Zwisler CC: Borislav Petkov , linux-kernel@vger.kernel.org, Thomas Gleixner , Linus Torvalds , Andrew Morton Subject: Re: [PATCH] x86: Add kerneldoc for pcommit_sfence() References: <1426097961-24921-1-git-send-email-ross.zwisler@linux.intel.com> <20150311201830.GD3359@pd.tnic> <20150312105843.GA6812@gmail.com> <1426276993.3737.3.camel@theros.lm.intel.com> <20150316083510.GA19634@gmail.com> In-Reply-To: <20150316083510.GA19634@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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