From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757306AbcFHQkS (ORCPT ); Wed, 8 Jun 2016 12:40:18 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36023 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754568AbcFHQkP (ORCPT ); Wed, 8 Jun 2016 12:40:15 -0400 Date: Wed, 8 Jun 2016 09:40:11 -0700 From: Brian Norris To: Srinivas Kandagatla , Maxime Ripard Cc: linux-kernel@vger.kernel.org, Brian Norris , Greg Kroah-Hartman , Guenter Roeck Subject: Re: [PATCH] nvmem: fix nvmem_cell_read() return type for !CONFIG_NVMEM Message-ID: <20160608164011.GA144473@google.com> References: <1465403206-142082-1-git-send-email-briannorris@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465403206-142082-1-git-send-email-briannorris@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 08, 2016 at 09:26:46AM -0700, Brian Norris wrote: > With CONFIG_NVMEM, nvmem_cell_read() returns void *. With !CONFIG_NVMEM > it returns char *. Let's make that consistent. Also drop the > incorrect/inconsistent comment about char * above the nvmem_cell_read() > definition. > > drivers/thermal/mtk_thermal.c is already working around this by casting > to (u32 *). > > Signed-off-by: Brian Norris Seems Guenter submitted the same thing a week ago, with no response: https://patchwork.kernel.org/patch/9148325/ I'll selfishly suggest that mine is better, since it also corrects the comments :) Brian > --- > drivers/nvmem/core.c | 4 ++-- > include/linux/nvmem-consumer.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > index 965911d9b36a..398ea7f54826 100644 > --- a/drivers/nvmem/core.c > +++ b/drivers/nvmem/core.c > @@ -981,8 +981,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem, > * @cell: nvmem cell to be read. > * @len: pointer to length of cell which will be populated on successful read. > * > - * Return: ERR_PTR() on error or a valid pointer to a char * buffer on success. > - * The buffer should be freed by the consumer with a kfree(). > + * Return: ERR_PTR() on error or a valid pointer to a buffer on success. The > + * buffer should be freed by the consumer with a kfree(). > */ > void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) > { > diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h > index 9bb77d3ed6e0..c2256d746543 100644 > --- a/include/linux/nvmem-consumer.h > +++ b/include/linux/nvmem-consumer.h > @@ -74,7 +74,7 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell) > { > } > > -static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) > +static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) > { > return ERR_PTR(-ENOSYS); > } > -- > 2.8.0.rc3.226.g39d4020 >