All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Brian Norris <briannorris@chromium.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-kernel@vger.kernel.org,
	Brian Norris <computersforpeace@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] nvmem: fix nvmem_cell_read() return type for !CONFIG_NVMEM
Date: Wed, 8 Jun 2016 19:52:06 +0100	[thread overview]
Message-ID: <57586956.2070008@linaro.org> (raw)
In-Reply-To: <20160608164011.GA144473@google.com>



On 08/06/16 17:40, Brian Norris wrote:
> 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 <briannorris@chromium.org>
>
> Seems Guenter submitted the same thing a week ago, with no response:

This patch has been already sent to Greg few days back with my sign off 
http://permalink.gmane.org/gmane.linux.kernel/2233276

>
> https://patchwork.kernel.org/patch/9148325/
>
> I'll selfishly suggest that mine is better, since it also corrects the
> comments :)
>
I agree, If Greg has not picked that up yet, then its easy to apply 
this, else we need another patch to fix the comment. :-).


--srini
> 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
>>

  parent reply	other threads:[~2016-06-08 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 16:26 [PATCH] nvmem: fix nvmem_cell_read() return type for !CONFIG_NVMEM Brian Norris
2016-06-08 16:40 ` Brian Norris
2016-06-08 17:40   ` Guenter Roeck
2016-06-08 18:52   ` Srinivas Kandagatla [this message]
2016-06-08 20:00     ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57586956.2070008@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=briannorris@chromium.org \
    --cc=computersforpeace@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=maxime.ripard@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.