diff mbox series

devfreq: Use of_node_name_eq for node name comparisons

Message ID 20181205195050.4759-6-robh@kernel.org (mailing list archive)
State Mainlined, archived
Commit 0d00a239f70fa52eb23837ffacf990f8404ecace
Headers show
Series devfreq: Use of_node_name_eq for node name comparisons | expand

Commit Message

Rob Herring (Arm) Dec. 5, 2018, 7:50 p.m. UTC
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which all of these are.

Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/devfreq/devfreq-event.c     | 2 +-
 drivers/devfreq/event/exynos-ppmu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

MyungJoo Ham Dec. 16, 2018, 9:12 a.m. UTC | #1
On Thu, Dec 6, 2018 at 4:54 AM Rob Herring <robh@kernel.org> wrote:
>
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

> ---
>  drivers/devfreq/devfreq-event.c     | 2 +-
>  drivers/devfreq/event/exynos-ppmu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
Rob Herring (Arm) Feb. 13, 2019, 4:09 p.m. UTC | #2
On Wed, Dec 5, 2018 at 1:50 PM Rob Herring <robh@kernel.org> wrote:
>
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/devfreq/devfreq-event.c     | 2 +-
>  drivers/devfreq/event/exynos-ppmu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Can someone apply this please.

>
> diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
> index d67242d87744..87e93406d7cd 100644
> --- a/drivers/devfreq/devfreq-event.c
> +++ b/drivers/devfreq/devfreq-event.c
> @@ -240,7 +240,7 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
>         }
>
>         list_for_each_entry(edev, &devfreq_event_list, node) {
> -               if (!strcmp(edev->desc->name, node->name))
> +               if (of_node_name_eq(node, edev->desc->name))
>                         goto out;
>         }
>         edev = NULL;
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index c61de0bdf053..c2ea94957501 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -529,7 +529,7 @@ static int of_get_devfreq_events(struct device_node *np,
>                         if (!ppmu_events[i].name)
>                                 continue;
>
> -                       if (!of_node_cmp(node->name, ppmu_events[i].name))
> +                       if (of_node_name_eq(node, ppmu_events[i].name))
>                                 break;
>                 }
>
> --
> 2.19.1
>
Chanwoo Choi Feb. 14, 2019, 3:49 a.m. UTC | #3
Hi Rob,

On 19. 2. 14. 오전 1:09, Rob Herring wrote:
> On Wed, Dec 5, 2018 at 1:50 PM Rob Herring <robh@kernel.org> wrote:
>>
>> Convert string compares of DT node names to use of_node_name_eq helper
>> instead. This removes direct access to the node name pointer.
>>
>> For instances using of_node_cmp, this has the side effect of now using
>> case sensitive comparisons. This should not matter for any FDT based
>> system which all of these are.
>>
>> Cc: Chanwoo Choi <cw00.choi@samsung.com>
>> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: Krzysztof Kozlowski <krzk@kernel.org>
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-samsung-soc@vger.kernel.org
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> ---
>>  drivers/devfreq/devfreq-event.c     | 2 +-
>>  drivers/devfreq/event/exynos-ppmu.c | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> Can someone apply this please.

Myungjoo picked up this patch[1] on devfreq.git
but has not yet sent the pull request.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git/commit/?h=for-next&id=0c1e8ce295acc3becc95e393e88a9a6da233074f

> 
>>
>> diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
>> index d67242d87744..87e93406d7cd 100644
>> --- a/drivers/devfreq/devfreq-event.c
>> +++ b/drivers/devfreq/devfreq-event.c
>> @@ -240,7 +240,7 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
>>         }
>>
>>         list_for_each_entry(edev, &devfreq_event_list, node) {
>> -               if (!strcmp(edev->desc->name, node->name))
>> +               if (of_node_name_eq(node, edev->desc->name))
>>                         goto out;
>>         }
>>         edev = NULL;
>> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
>> index c61de0bdf053..c2ea94957501 100644
>> --- a/drivers/devfreq/event/exynos-ppmu.c
>> +++ b/drivers/devfreq/event/exynos-ppmu.c
>> @@ -529,7 +529,7 @@ static int of_get_devfreq_events(struct device_node *np,
>>                         if (!ppmu_events[i].name)
>>                                 continue;
>>
>> -                       if (!of_node_cmp(node->name, ppmu_events[i].name))
>> +                       if (of_node_name_eq(node, ppmu_events[i].name))
>>                                 break;
>>                 }
>>
>> --
>> 2.19.1
>>
> 
>
Rob Herring (Arm) Feb. 14, 2019, 2:24 p.m. UTC | #4
On Wed, Feb 13, 2019 at 9:49 PM Chanwoo Choi <cw00.choi@samsung.com> wrote:
>
> Hi Rob,
>
> On 19. 2. 14. 오전 1:09, Rob Herring wrote:
> > On Wed, Dec 5, 2018 at 1:50 PM Rob Herring <robh@kernel.org> wrote:
> >>
> >> Convert string compares of DT node names to use of_node_name_eq helper
> >> instead. This removes direct access to the node name pointer.
> >>
> >> For instances using of_node_cmp, this has the side effect of now using
> >> case sensitive comparisons. This should not matter for any FDT based
> >> system which all of these are.
> >>
> >> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> >> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
> >> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> >> Cc: Kukjin Kim <kgene@kernel.org>
> >> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> >> Cc: linux-pm@vger.kernel.org
> >> Cc: linux-arm-kernel@lists.infradead.org
> >> Cc: linux-samsung-soc@vger.kernel.org
> >> Signed-off-by: Rob Herring <robh@kernel.org>
> >> ---
> >>  drivers/devfreq/devfreq-event.c     | 2 +-
> >>  drivers/devfreq/event/exynos-ppmu.c | 2 +-
> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > Can someone apply this please.
>
> Myungjoo picked up this patch[1] on devfreq.git
> but has not yet sent the pull request.

Okay, thanks.

Please add that tree to linux-next or reply to patches when they've
been applied, so submitters have some way to know when their patch is
accepted.

Rob
diff mbox series

Patch

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index d67242d87744..87e93406d7cd 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -240,7 +240,7 @@  struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
 	}
 
 	list_for_each_entry(edev, &devfreq_event_list, node) {
-		if (!strcmp(edev->desc->name, node->name))
+		if (of_node_name_eq(node, edev->desc->name))
 			goto out;
 	}
 	edev = NULL;
diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index c61de0bdf053..c2ea94957501 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -529,7 +529,7 @@  static int of_get_devfreq_events(struct device_node *np,
 			if (!ppmu_events[i].name)
 				continue;
 
-			if (!of_node_cmp(node->name, ppmu_events[i].name))
+			if (of_node_name_eq(node, ppmu_events[i].name))
 				break;
 		}