From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753498AbbIAEvB (ORCPT ); Tue, 1 Sep 2015 00:51:01 -0400 Received: from seldrel01.sonyericsson.com ([37.139.156.2]:18428 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbbIAEvA (ORCPT ); Tue, 1 Sep 2015 00:51:00 -0400 Date: Mon, 31 Aug 2015 21:50:55 -0700 From: Bjorn Andersson To: Stephen Boyd CC: Andy Gross , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] soc: qcom: Make qcom_smem_get() return a pointer Message-ID: <20150901045055.GA13472@usrtlx11787.corpusers.net> References: <1441071666-16156-1-git-send-email-sboyd@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1441071666-16156-1-git-send-email-sboyd@codeaurora.org> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 31 Aug 18:41 PDT 2015, Stephen Boyd wrote: > Passing a void ** almost always requires a cast at the call site. > Instead of littering the code with casts every time this function > is called, have qcom_smem_get() return a void pointer to the > location of the smem item. This frees the caller from having to > cast the pointer with the small downside of doing some extra work > to find the item in the case that the caller doesn't care to use > the pointer. > We still need to find the item even if the caller is not interested, to know if we should have returned -ENOENT, so I think it's just a matter of style. I did have the API to return the pointer earlier in development, but it didn't look good and uniform. But in the final piece, that was picked up, I think it makes more sense (and looks better) to do it this way. Reviewed-by: Bjorn Andersson > Signed-off-by: Stephen Boyd > --- > > This is on top of the smd and smem big endian support. > How sneaky of you, then we need to approve those patches before we add new consumers of this API... Regards, Bjorn