* [PATCH] usb: dwc3: use proper initializers for property entries
@ 2019-12-13 17:46 Dmitry Torokhov
2019-12-15 16:41 ` Hans de Goede
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2019-12-13 17:46 UTC (permalink / raw)
To: Felipe Balbi, Rafael J. Wysocki
Cc: Greg Kroah-Hartman, Hans de Goede, Marek Szyprowski, linux-usb,
linux-kernel
We should not be reaching into property entries and initialize them by
hand, but rather use proper initializer macros. This way we can alter
internal representation of property entries with no visible changes to
their users.
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
It would be good if this could go through Rafael's tree as it is needed
for the rest of my software_node/property_entry rework patch series
which I would love not to delay till 5.6.
Thanks!
drivers/usb/dwc3/host.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 5567ed2cddbec..fa252870c926f 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
if (dwc->usb3_lpm_capable)
- props[prop_idx++].name = "usb3-lpm-capable";
+ props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable");
if (dwc->usb2_lpm_disable)
- props[prop_idx++].name = "usb2-lpm-disable";
+ props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
/**
* WORKAROUND: dwc3 revisions <=3.00a have a limitation
@@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)
* This following flag tells XHCI to do just that.
*/
if (dwc->revision <= DWC3_REVISION_300A)
- props[prop_idx++].name = "quirk-broken-port-ped";
+ props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped");
if (prop_idx) {
ret = platform_device_add_properties(xhci, props);
--
2.24.1.735.g03f4e72817-goog
--
Dmitry
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc3: use proper initializers for property entries
2019-12-13 17:46 [PATCH] usb: dwc3: use proper initializers for property entries Dmitry Torokhov
@ 2019-12-15 16:41 ` Hans de Goede
2020-01-07 11:32 ` Marek Szyprowski
0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2019-12-15 16:41 UTC (permalink / raw)
To: Dmitry Torokhov, Felipe Balbi, Rafael J. Wysocki
Cc: Greg Kroah-Hartman, Marek Szyprowski, linux-usb, linux-kernel
Hi,
On 13-12-2019 18:46, Dmitry Torokhov wrote:
> We should not be reaching into property entries and initialize them by
> hand, but rather use proper initializer macros. This way we can alter
> internal representation of property entries with no visible changes to
> their users.
>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>
> It would be good if this could go through Rafael's tree as it is needed
> for the rest of my software_node/property_entry rework patch series
> which I would love not to delay till 5.6.
Patch looks good to me:
Acked-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
>
> Thanks!
>
> drivers/usb/dwc3/host.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index 5567ed2cddbec..fa252870c926f 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)
> memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
>
> if (dwc->usb3_lpm_capable)
> - props[prop_idx++].name = "usb3-lpm-capable";
> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable");
>
> if (dwc->usb2_lpm_disable)
> - props[prop_idx++].name = "usb2-lpm-disable";
> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
>
> /**
> * WORKAROUND: dwc3 revisions <=3.00a have a limitation
> @@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)
> * This following flag tells XHCI to do just that.
> */
> if (dwc->revision <= DWC3_REVISION_300A)
> - props[prop_idx++].name = "quirk-broken-port-ped";
> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped");
>
> if (prop_idx) {
> ret = platform_device_add_properties(xhci, props);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc3: use proper initializers for property entries
2019-12-15 16:41 ` Hans de Goede
@ 2020-01-07 11:32 ` Marek Szyprowski
2020-01-09 9:08 ` Felipe Balbi
0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2020-01-07 11:32 UTC (permalink / raw)
To: Hans de Goede, Dmitry Torokhov, Felipe Balbi, Rafael J. Wysocki
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel
Hi All,
On 15.12.2019 17:41, Hans de Goede wrote:
> Hi,
>
> On 13-12-2019 18:46, Dmitry Torokhov wrote:
>> We should not be reaching into property entries and initialize them by
>> hand, but rather use proper initializer macros. This way we can alter
>> internal representation of property entries with no visible changes to
>> their users.
>>
>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>>
>> It would be good if this could go through Rafael's tree as it is needed
>> for the rest of my software_node/property_entry rework patch series
>> which I would love not to delay till 5.6.
>
> Patch looks good to me:
>
> Acked-by: Hans de Goede <hdegoede@redhat.com>
This patch is instantly needed as the issue it fixes is again triggered
in current (20200107) linux-next by commit e6bff4665c59 "software node:
replace is_array with is_inline".
Felipe: could You ack it, so it could be merged via Rafael's tree
together with related device property changes?
>>
>> drivers/usb/dwc3/host.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>> index 5567ed2cddbec..fa252870c926f 100644
>> --- a/drivers/usb/dwc3/host.c
>> +++ b/drivers/usb/dwc3/host.c
>> @@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)
>> memset(props, 0, sizeof(struct property_entry) *
>> ARRAY_SIZE(props));
>> if (dwc->usb3_lpm_capable)
>> - props[prop_idx++].name = "usb3-lpm-capable";
>> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable");
>> if (dwc->usb2_lpm_disable)
>> - props[prop_idx++].name = "usb2-lpm-disable";
>> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
>> /**
>> * WORKAROUND: dwc3 revisions <=3.00a have a limitation
>> @@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)
>> * This following flag tells XHCI to do just that.
>> */
>> if (dwc->revision <= DWC3_REVISION_300A)
>> - props[prop_idx++].name = "quirk-broken-port-ped";
>> + props[prop_idx++] =
>> PROPERTY_ENTRY_BOOL("quirk-broken-port-ped");
>> if (prop_idx) {
>> ret = platform_device_add_properties(xhci, props);
>>
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc3: use proper initializers for property entries
2020-01-07 11:32 ` Marek Szyprowski
@ 2020-01-09 9:08 ` Felipe Balbi
2020-01-09 9:32 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2020-01-09 9:08 UTC (permalink / raw)
To: Marek Szyprowski, Hans de Goede, Dmitry Torokhov, Rafael J. Wysocki
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]
Hi,
Marek Szyprowski <m.szyprowski@samsung.com> writes:
> Hi All,
>
> On 15.12.2019 17:41, Hans de Goede wrote:
>> Hi,
>>
>> On 13-12-2019 18:46, Dmitry Torokhov wrote:
>>> We should not be reaching into property entries and initialize them by
>>> hand, but rather use proper initializer macros. This way we can alter
>>> internal representation of property entries with no visible changes to
>>> their users.
>>>
>>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>> ---
>>>
>>> It would be good if this could go through Rafael's tree as it is needed
>>> for the rest of my software_node/property_entry rework patch series
>>> which I would love not to delay till 5.6.
>>
>> Patch looks good to me:
>>
>> Acked-by: Hans de Goede <hdegoede@redhat.com>
>
> This patch is instantly needed as the issue it fixes is again triggered
> in current (20200107) linux-next by commit e6bff4665c59 "software node:
> replace is_array with is_inline".
>
> Felipe: could You ack it, so it could be merged via Rafael's tree
> together with related device property changes?
Here you go:
Acked-by: Felipe Balbi <balbi@kernel.org>
cheers
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc3: use proper initializers for property entries
2020-01-09 9:08 ` Felipe Balbi
@ 2020-01-09 9:32 ` Rafael J. Wysocki
0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2020-01-09 9:32 UTC (permalink / raw)
To: Felipe Balbi, Marek Szyprowski, Dmitry Torokhov
Cc: Hans de Goede, Rafael J. Wysocki, Greg Kroah-Hartman,
open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:,
Linux Kernel Mailing List
On Thu, Jan 9, 2020 at 10:07 AM Felipe Balbi <balbi@kernel.org> wrote:
>
>
> Hi,
>
> Marek Szyprowski <m.szyprowski@samsung.com> writes:
>
> > Hi All,
> >
> > On 15.12.2019 17:41, Hans de Goede wrote:
> >> Hi,
> >>
> >> On 13-12-2019 18:46, Dmitry Torokhov wrote:
> >>> We should not be reaching into property entries and initialize them by
> >>> hand, but rather use proper initializer macros. This way we can alter
> >>> internal representation of property entries with no visible changes to
> >>> their users.
> >>>
> >>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >>> ---
> >>>
> >>> It would be good if this could go through Rafael's tree as it is needed
> >>> for the rest of my software_node/property_entry rework patch series
> >>> which I would love not to delay till 5.6.
> >>
> >> Patch looks good to me:
> >>
> >> Acked-by: Hans de Goede <hdegoede@redhat.com>
> >
> > This patch is instantly needed as the issue it fixes is again triggered
> > in current (20200107) linux-next by commit e6bff4665c59 "software node:
> > replace is_array with is_inline".
> >
> > Felipe: could You ack it, so it could be merged via Rafael's tree
> > together with related device property changes?
>
> Here you go:
>
> Acked-by: Felipe Balbi <balbi@kernel.org>
Thanks, applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-09 9:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 17:46 [PATCH] usb: dwc3: use proper initializers for property entries Dmitry Torokhov
2019-12-15 16:41 ` Hans de Goede
2020-01-07 11:32 ` Marek Szyprowski
2020-01-09 9:08 ` Felipe Balbi
2020-01-09 9:32 ` 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).