linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value
@ 2021-05-21 21:00 Douglas Anderson
  2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Douglas Anderson @ 2021-05-21 21:00 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Rajendra Nayak, linux-arm-msm, Stephen Boyd, Joe Perches,
	Douglas Anderson, linux-kernel

The caller doesn't modify the memory pointed to by the pointer so it
can be const.

Suggested-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/nvmem/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index f9c9c9859919..4868aa876e1b 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1609,9 +1609,9 @@ int nvmem_cell_read_u64(struct device *dev, const char *cell_id, u64 *val)
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_read_u64);
 
-static void *nvmem_cell_read_variable_common(struct device *dev,
-					     const char *cell_id,
-					     size_t max_len, size_t *len)
+static const void *nvmem_cell_read_variable_common(struct device *dev,
+						   const char *cell_id,
+						   size_t max_len, size_t *len)
 {
 	struct nvmem_cell *cell;
 	int nbits;
@@ -1655,7 +1655,7 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id,
 				    u32 *val)
 {
 	size_t len;
-	u8 *buf;
+	const u8 *buf;
 	int i;
 
 	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
@@ -1686,7 +1686,7 @@ int nvmem_cell_read_variable_le_u64(struct device *dev, const char *cell_id,
 				    u64 *val)
 {
 	size_t len;
-	u8 *buf;
+	const u8 *buf;
 	int i;
 
 	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
-- 
2.31.1.818.g46aad6cb9e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting
  2021-05-21 21:00 [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Douglas Anderson
@ 2021-05-21 21:00 ` Douglas Anderson
  2021-05-21 22:03   ` Stephen Boyd
  2021-05-21 22:02 ` [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Stephen Boyd
  2021-05-28  8:25 ` Srinivas Kandagatla
  2 siblings, 1 reply; 5+ messages in thread
From: Douglas Anderson @ 2021-05-21 21:00 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Rajendra Nayak, linux-arm-msm, Stephen Boyd, Joe Perches,
	Douglas Anderson, linux-kernel

In review feedback Joe Perches found the existing comment
confusing. Let's use something based on the wording proposed by Joe.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/nvmem/qfprom.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
index 1ba666bcb900..81fbad5e939d 100644
--- a/drivers/nvmem/qfprom.c
+++ b/drivers/nvmem/qfprom.c
@@ -196,9 +196,9 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
 	}
 
 	/*
-	 * Hardware requires a min voltage for fuse blowing; this may be
-	 * a rail shared do don't specify a max--regulator constraints
-	 * will handle.
+	 * Hardware requires a minimum voltage for fuse blowing.
+	 * This may be a shared rail so don't specify a maximum.
+	 * Regulator constraints will cap to the actual maximum.
 	 */
 	ret = regulator_set_voltage(priv->vcc, qfprom_blow_uV, INT_MAX);
 	if (ret) {
-- 
2.31.1.818.g46aad6cb9e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value
  2021-05-21 21:00 [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Douglas Anderson
  2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
@ 2021-05-21 22:02 ` Stephen Boyd
  2021-05-28  8:25 ` Srinivas Kandagatla
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2021-05-21 22:02 UTC (permalink / raw)
  To: Douglas Anderson, Srinivas Kandagatla
  Cc: Rajendra Nayak, linux-arm-msm, Joe Perches, linux-kernel

Quoting Douglas Anderson (2021-05-21 14:00:57)
> The caller doesn't modify the memory pointed to by the pointer so it
> can be const.
>
> Suggested-by: Stephen Boyd <swboyd@chromium.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting
  2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
@ 2021-05-21 22:03   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2021-05-21 22:03 UTC (permalink / raw)
  To: Douglas Anderson, Srinivas Kandagatla
  Cc: Rajendra Nayak, linux-arm-msm, Joe Perches, linux-kernel

Quoting Douglas Anderson (2021-05-21 14:00:58)
> In review feedback Joe Perches found the existing comment
> confusing. Let's use something based on the wording proposed by Joe.
>
> Suggested-by: Joe Perches <joe@perches.com>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value
  2021-05-21 21:00 [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Douglas Anderson
  2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
  2021-05-21 22:02 ` [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Stephen Boyd
@ 2021-05-28  8:25 ` Srinivas Kandagatla
  2 siblings, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2021-05-28  8:25 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Rajendra Nayak, linux-arm-msm, Stephen Boyd, Joe Perches, linux-kernel



On 21/05/2021 22:00, Douglas Anderson wrote:
> The caller doesn't modify the memory pointed to by the pointer so it
> can be const.
> 
> Suggested-by: Stephen Boyd <swboyd@chromium.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 

Applied both thanks,

--srini
>   drivers/nvmem/core.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index f9c9c9859919..4868aa876e1b 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -1609,9 +1609,9 @@ int nvmem_cell_read_u64(struct device *dev, const char *cell_id, u64 *val)
>   }
>   EXPORT_SYMBOL_GPL(nvmem_cell_read_u64);
>   
> -static void *nvmem_cell_read_variable_common(struct device *dev,
> -					     const char *cell_id,
> -					     size_t max_len, size_t *len)
> +static const void *nvmem_cell_read_variable_common(struct device *dev,
> +						   const char *cell_id,
> +						   size_t max_len, size_t *len)
>   {
>   	struct nvmem_cell *cell;
>   	int nbits;
> @@ -1655,7 +1655,7 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id,
>   				    u32 *val)
>   {
>   	size_t len;
> -	u8 *buf;
> +	const u8 *buf;
>   	int i;
>   
>   	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
> @@ -1686,7 +1686,7 @@ int nvmem_cell_read_variable_le_u64(struct device *dev, const char *cell_id,
>   				    u64 *val)
>   {
>   	size_t len;
> -	u8 *buf;
> +	const u8 *buf;
>   	int i;
>   
>   	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-28  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 21:00 [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Douglas Anderson
2021-05-21 21:00 ` [PATCH 2/2] nvmem: qfprom: Improve the comment about regulator setting Douglas Anderson
2021-05-21 22:03   ` Stephen Boyd
2021-05-21 22:02 ` [PATCH 1/2] nvmem: core: constify nvmem_cell_read_variable_common() return value Stephen Boyd
2021-05-28  8:25 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).