linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
@ 2019-02-14 18:12 Douglas Anderson
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Douglas Anderson @ 2019-02-14 18:12 UTC (permalink / raw)
  To: Rafael J . Wysocki, Ulf Hansson
  Cc: linux-arm-msm, Viresh Kumar, Rajendra Nayak, swboyd,
	Douglas Anderson, linux-pm, linux-kernel, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

The genpd_dev_pm_attach_by_name() simply takes the name and passes it
to of_property_match_string() where the argument is "const char *".
Adding a const here allows a later patch to add a const to
dev_pm_domain_attach_by_name() which allows drivers to pass in a name
that was declared "const" in a driver.

Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/base/power/domain.c | 2 +-
 include/linux/pm_domain.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 45eafe8cf7dd..2c334c01fc43 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2483,7 +2483,7 @@ EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id);
  * power-domain-names DT property. For further description see
  * genpd_dev_pm_attach_by_id().
  */
-struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name)
+struct device *genpd_dev_pm_attach_by_name(struct device *dev, const char *name)
 {
 	int index;
 
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index dd364abb649a..203be5082f33 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev);
 struct device *genpd_dev_pm_attach_by_id(struct device *dev,
 					 unsigned int index);
 struct device *genpd_dev_pm_attach_by_name(struct device *dev,
-					   char *name);
+					   const char *name);
 #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
 static inline int of_genpd_add_provider_simple(struct device_node *np,
 					struct generic_pm_domain *genpd)
@@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
 }
 
 static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
-							 char *name)
+							 const char *name)
 {
 	return NULL;
 }
-- 
2.21.0.rc0.258.g878e2cd30e-goog


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

* [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
  2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
@ 2019-02-14 18:12 ` Douglas Anderson
  2019-02-14 18:23   ` Stephen Boyd
  2019-02-15 10:27   ` Ulf Hansson
  2019-02-14 18:23 ` [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Stephen Boyd
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Douglas Anderson @ 2019-02-14 18:12 UTC (permalink / raw)
  To: Rafael J . Wysocki, Ulf Hansson
  Cc: linux-arm-msm, Viresh Kumar, Rajendra Nayak, swboyd,
	Douglas Anderson, linux-pm, linux-kernel, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

As of the patch ("PM / Domains: Mark "name" const in
genpd_dev_pm_attach_by_name()") it's clear that the name in
dev_pm_domain_attach_by_name() can be const.  Mark it as so.  This
allows drivers to pass in a name that was declared "const" in a
driver.

Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/base/power/common.c | 2 +-
 include/linux/pm_domain.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index b413951c6abc..22aedb28aad7 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -160,7 +160,7 @@ EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id);
  * For a detailed function description, see dev_pm_domain_attach_by_id().
  */
 struct device *dev_pm_domain_attach_by_name(struct device *dev,
-					    char *name)
+					    const char *name)
 {
 	if (dev->pm_domain)
 		return ERR_PTR(-EEXIST);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 203be5082f33..1ed5874bcee0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on);
 struct device *dev_pm_domain_attach_by_id(struct device *dev,
 					  unsigned int index);
 struct device *dev_pm_domain_attach_by_name(struct device *dev,
-					    char *name);
+					    const char *name);
 void dev_pm_domain_detach(struct device *dev, bool power_off);
 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
 #else
@@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
 	return NULL;
 }
 static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
-							  char *name)
+							  const char *name)
 {
 	return NULL;
 }
-- 
2.21.0.rc0.258.g878e2cd30e-goog


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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
@ 2019-02-14 18:23 ` Stephen Boyd
  2019-02-15  3:02 ` Viresh Kumar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2019-02-14 18:23 UTC (permalink / raw)
  To: Rafael J . Wysocki, Douglas Anderson, Ulf Hansson
  Cc: linux-arm-msm, Viresh Kumar, Rajendra Nayak, Douglas Anderson,
	linux-pm, linux-kernel, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

Quoting Douglas Anderson (2019-02-14 10:12:48)
> The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> to of_property_match_string() where the argument is "const char *".
> Adding a const here allows a later patch to add a const to
> dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> that was declared "const" in a driver.
> 
> Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---

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


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

* Re: [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
@ 2019-02-14 18:23   ` Stephen Boyd
  2019-02-15 10:27   ` Ulf Hansson
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2019-02-14 18:23 UTC (permalink / raw)
  To: Rafael J . Wysocki, Douglas Anderson, Ulf Hansson
  Cc: linux-arm-msm, Viresh Kumar, Rajendra Nayak, Douglas Anderson,
	linux-pm, linux-kernel, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

Quoting Douglas Anderson (2019-02-14 10:12:49)
> As of the patch ("PM / Domains: Mark "name" const in
> genpd_dev_pm_attach_by_name()") it's clear that the name in
> dev_pm_domain_attach_by_name() can be const.  Mark it as so.  This
> allows drivers to pass in a name that was declared "const" in a
> driver.
> 
> Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---

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


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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
  2019-02-14 18:23 ` [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Stephen Boyd
@ 2019-02-15  3:02 ` Viresh Kumar
  2019-02-15 15:47   ` Doug Anderson
  2019-02-15 10:27 ` Ulf Hansson
  2019-02-19 10:19 ` Rafael J. Wysocki
  4 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2019-02-15  3:02 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Rafael J . Wysocki, Ulf Hansson, linux-arm-msm, Rajendra Nayak,
	swboyd, linux-pm, linux-kernel, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

On 14-02-19, 10:12, Douglas Anderson wrote:
> The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> to of_property_match_string() where the argument is "const char *".
> Adding a const here allows a later patch to add a const to
> dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> that was declared "const" in a driver.
> 
> Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")

Not sure if this should be counted as a fix.

> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  drivers/base/power/domain.c | 2 +-
>  include/linux/pm_domain.h   | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

For both the patches:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
  2019-02-14 18:23   ` Stephen Boyd
@ 2019-02-15 10:27   ` Ulf Hansson
  2019-02-15 15:42     ` Doug Anderson
  1 sibling, 1 reply; 12+ messages in thread
From: Ulf Hansson @ 2019-02-15 10:27 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Rafael J . Wysocki, linux-arm-msm, Viresh Kumar, Rajendra Nayak,
	Stephen Boyd, Linux PM, Linux Kernel Mailing List, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

On Thu, 14 Feb 2019 at 19:13, Douglas Anderson <dianders@chromium.org> wrote:
>
> As of the patch ("PM / Domains: Mark "name" const in
> genpd_dev_pm_attach_by_name()") it's clear that the name in
> dev_pm_domain_attach_by_name() can be const.  Mark it as so.  This
> allows drivers to pass in a name that was declared "const" in a
> driver.
>
> Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Perhaps fold $subject patch into patch1, they seems highly related.
Anyway, no strong opinion here.

Kind regards
Uffe

> ---
>
>  drivers/base/power/common.c | 2 +-
>  include/linux/pm_domain.h   | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
> index b413951c6abc..22aedb28aad7 100644
> --- a/drivers/base/power/common.c
> +++ b/drivers/base/power/common.c
> @@ -160,7 +160,7 @@ EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id);
>   * For a detailed function description, see dev_pm_domain_attach_by_id().
>   */
>  struct device *dev_pm_domain_attach_by_name(struct device *dev,
> -                                           char *name)
> +                                           const char *name)
>  {
>         if (dev->pm_domain)
>                 return ERR_PTR(-EEXIST);
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 203be5082f33..1ed5874bcee0 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on);
>  struct device *dev_pm_domain_attach_by_id(struct device *dev,
>                                           unsigned int index);
>  struct device *dev_pm_domain_attach_by_name(struct device *dev,
> -                                           char *name);
> +                                           const char *name);
>  void dev_pm_domain_detach(struct device *dev, bool power_off);
>  void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
>  #else
> @@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
>         return NULL;
>  }
>  static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
> -                                                         char *name)
> +                                                         const char *name)
>  {
>         return NULL;
>  }
> --
> 2.21.0.rc0.258.g878e2cd30e-goog
>

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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
                   ` (2 preceding siblings ...)
  2019-02-15  3:02 ` Viresh Kumar
@ 2019-02-15 10:27 ` Ulf Hansson
  2019-02-19 10:19 ` Rafael J. Wysocki
  4 siblings, 0 replies; 12+ messages in thread
From: Ulf Hansson @ 2019-02-15 10:27 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Rafael J . Wysocki, linux-arm-msm, Viresh Kumar, Rajendra Nayak,
	Stephen Boyd, Linux PM, Linux Kernel Mailing List, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

On Thu, 14 Feb 2019 at 19:13, Douglas Anderson <dianders@chromium.org> wrote:
>
> The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> to of_property_match_string() where the argument is "const char *".
> Adding a const here allows a later patch to add a const to
> dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> that was declared "const" in a driver.
>
> Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe


> ---
>
>  drivers/base/power/domain.c | 2 +-
>  include/linux/pm_domain.h   | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 45eafe8cf7dd..2c334c01fc43 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2483,7 +2483,7 @@ EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id);
>   * power-domain-names DT property. For further description see
>   * genpd_dev_pm_attach_by_id().
>   */
> -struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name)
> +struct device *genpd_dev_pm_attach_by_name(struct device *dev, const char *name)
>  {
>         int index;
>
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index dd364abb649a..203be5082f33 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev);
>  struct device *genpd_dev_pm_attach_by_id(struct device *dev,
>                                          unsigned int index);
>  struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> -                                          char *name);
> +                                          const char *name);
>  #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
>  static inline int of_genpd_add_provider_simple(struct device_node *np,
>                                         struct generic_pm_domain *genpd)
> @@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
>  }
>
>  static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> -                                                        char *name)
> +                                                        const char *name)
>  {
>         return NULL;
>  }
> --
> 2.21.0.rc0.258.g878e2cd30e-goog
>

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

* Re: [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
  2019-02-15 10:27   ` Ulf Hansson
@ 2019-02-15 15:42     ` Doug Anderson
  0 siblings, 0 replies; 12+ messages in thread
From: Doug Anderson @ 2019-02-15 15:42 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J . Wysocki, linux-arm-msm, Viresh Kumar, Rajendra Nayak,
	Stephen Boyd, Linux PM, Linux Kernel Mailing List, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

Hi,

On Fri, Feb 15, 2019 at 2:28 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Thu, 14 Feb 2019 at 19:13, Douglas Anderson <dianders@chromium.org> wrote:
> >
> > As of the patch ("PM / Domains: Mark "name" const in
> > genpd_dev_pm_attach_by_name()") it's clear that the name in
> > dev_pm_domain_attach_by_name() can be const.  Mark it as so.  This
> > allows drivers to pass in a name that was declared "const" in a
> > driver.
> >
> > Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()")
> > Signed-off-by: Douglas Anderson <dianders@chromium.org>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
>
> Perhaps fold $subject patch into patch1, they seems highly related.
> Anyway, no strong opinion here.

Sure, either way is fine with me so I'll wait until someone tells me
for sure one way or the other.  I'm also happy if they just get
squashed together when applied if that's easier.  I originally kept
them separate since the two APIs were originally added in separate
patches so it seemed consistent to do the bugfixes in separate
patches.  ;-)

-Doug

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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-15  3:02 ` Viresh Kumar
@ 2019-02-15 15:47   ` Doug Anderson
  2019-02-18  4:15     ` Viresh Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Doug Anderson @ 2019-02-15 15:47 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J . Wysocki, Ulf Hansson, linux-arm-msm, Rajendra Nayak,
	Stephen Boyd, linux-pm, LKML, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

Hi,
On Thu, Feb 14, 2019 at 7:02 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 14-02-19, 10:12, Douglas Anderson wrote:
> > The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> > to of_property_match_string() where the argument is "const char *".
> > Adding a const here allows a later patch to add a const to
> > dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> > that was declared "const" in a driver.
> >
> > Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
>
> Not sure if this should be counted as a fix.

I'm OK if the "Fixes" is stripped when applying or if someone tells me
to re-post without the Fixes--just let me know.  In general I do a lot
of cherry-picks from upstream and I appreciate the Fixes tag helping
to link patches together.  In this case if I picked the original patch
I'd definitely want this one too.  Certainly, though, CCing stable
would make no sense in this case.  ;-)

-Doug

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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-15 15:47   ` Doug Anderson
@ 2019-02-18  4:15     ` Viresh Kumar
  2019-02-18  8:41       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2019-02-18  4:15 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Rafael J . Wysocki, Ulf Hansson, linux-arm-msm, Rajendra Nayak,
	Stephen Boyd, linux-pm, LKML, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

On 15-02-19, 07:47, Doug Anderson wrote:
> Hi,
> On Thu, Feb 14, 2019 at 7:02 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >
> > On 14-02-19, 10:12, Douglas Anderson wrote:
> > > The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> > > to of_property_match_string() where the argument is "const char *".
> > > Adding a const here allows a later patch to add a const to
> > > dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> > > that was declared "const" in a driver.
> > >
> > > Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
> >
> > Not sure if this should be counted as a fix.
> 
> I'm OK if the "Fixes" is stripped when applying or if someone tells me
> to re-post without the Fixes--just let me know.  In general I do a lot
> of cherry-picks from upstream and I appreciate the Fixes tag helping
> to link patches together.  In this case if I picked the original patch
> I'd definitely want this one too.  Certainly, though, CCing stable
> would make no sense in this case.  ;-)

I am not sure if this is being done right now or not, but I read/heard
somewhere that stable has started picking "Fixes" patches directly as
well even if they aren't cc'd to stable.

-- 
viresh

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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-18  4:15     ` Viresh Kumar
@ 2019-02-18  8:41       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2019-02-18  8:41 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Doug Anderson, Rafael J . Wysocki, Ulf Hansson, linux-arm-msm,
	Rajendra Nayak, Stephen Boyd, linux-pm, LKML, Len Brown,
	Kevin Hilman, Pavel Machek

On Mon, Feb 18, 2019 at 09:45:14AM +0530, Viresh Kumar wrote:
> On 15-02-19, 07:47, Doug Anderson wrote:
> > Hi,
> > On Thu, Feb 14, 2019 at 7:02 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > >
> > > On 14-02-19, 10:12, Douglas Anderson wrote:
> > > > The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> > > > to of_property_match_string() where the argument is "const char *".
> > > > Adding a const here allows a later patch to add a const to
> > > > dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> > > > that was declared "const" in a driver.
> > > >
> > > > Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
> > >
> > > Not sure if this should be counted as a fix.
> > 
> > I'm OK if the "Fixes" is stripped when applying or if someone tells me
> > to re-post without the Fixes--just let me know.  In general I do a lot
> > of cherry-picks from upstream and I appreciate the Fixes tag helping
> > to link patches together.  In this case if I picked the original patch
> > I'd definitely want this one too.  Certainly, though, CCing stable
> > would make no sense in this case.  ;-)
> 
> I am not sure if this is being done right now or not, but I read/heard
> somewhere that stable has started picking "Fixes" patches directly as
> well even if they aren't cc'd to stable.

It's random, not always happening, and nothing you can rely on.

If you know this is a patch for older kernels, then always add the cc:
stable line, as the documentation says you have to do!

thanks,

greg k-h

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

* Re: [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
  2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
                   ` (3 preceding siblings ...)
  2019-02-15 10:27 ` Ulf Hansson
@ 2019-02-19 10:19 ` Rafael J. Wysocki
  4 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2019-02-19 10:19 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Ulf Hansson, linux-arm-msm, Viresh Kumar, Rajendra Nayak, swboyd,
	linux-pm, linux-kernel, Len Brown, Kevin Hilman,
	Greg Kroah-Hartman, Pavel Machek

On Thursday, February 14, 2019 7:12:48 PM CET Douglas Anderson wrote:
> The genpd_dev_pm_attach_by_name() simply takes the name and passes it
> to of_property_match_string() where the argument is "const char *".
> Adding a const here allows a later patch to add a const to
> dev_pm_domain_attach_by_name() which allows drivers to pass in a name
> that was declared "const" in a driver.
> 
> Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  drivers/base/power/domain.c | 2 +-
>  include/linux/pm_domain.h   | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 45eafe8cf7dd..2c334c01fc43 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2483,7 +2483,7 @@ EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id);
>   * power-domain-names DT property. For further description see
>   * genpd_dev_pm_attach_by_id().
>   */
> -struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name)
> +struct device *genpd_dev_pm_attach_by_name(struct device *dev, const char *name)
>  {
>  	int index;
>  
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index dd364abb649a..203be5082f33 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev);
>  struct device *genpd_dev_pm_attach_by_id(struct device *dev,
>  					 unsigned int index);
>  struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> -					   char *name);
> +					   const char *name);
>  #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
>  static inline int of_genpd_add_provider_simple(struct device_node *np,
>  					struct generic_pm_domain *genpd)
> @@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
>  }
>  
>  static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
> -							 char *name)
> +							 const char *name)
>  {
>  	return NULL;
>  }
> 

Both this and the [2/2] applied, thanks!



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

end of thread, other threads:[~2019-02-19 10:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
2019-02-14 18:23   ` Stephen Boyd
2019-02-15 10:27   ` Ulf Hansson
2019-02-15 15:42     ` Doug Anderson
2019-02-14 18:23 ` [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Stephen Boyd
2019-02-15  3:02 ` Viresh Kumar
2019-02-15 15:47   ` Doug Anderson
2019-02-18  4:15     ` Viresh Kumar
2019-02-18  8:41       ` Greg Kroah-Hartman
2019-02-15 10:27 ` Ulf Hansson
2019-02-19 10:19 ` Rafael J. Wysocki

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).