* [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig @ 2023-02-21 0:51 Rebecca Cran 2023-02-22 7:19 ` [edk2-devel] " Wu, Hao A 0 siblings, 1 reply; 5+ messages in thread From: Rebecca Cran @ 2023-02-21 0:51 UTC (permalink / raw) To: devel, Jian J Wang, Liming Gao, Hao A Wu, Ray Ni; +Cc: Rebecca Cran Improve the formatting of a warning in UsbSelectConfig by adding parentheses around the EFI_STATUS value. Signed-off-by: Rebecca Cran <rebecca@quicinc.com> --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index aed34596f469..29a6419c3c86 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -440,7 +440,7 @@ UsbSelectConfig ( if (EFI_ERROR (Status)) { DEBUG (( DEBUG_WARN, - "UsbSelectConfig: failed to connect driver %r, ignored\n", + "UsbSelectConfig: failed to connect driver (%r), ignored\n", Status )); } -- 2.30.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig 2023-02-21 0:51 [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig Rebecca Cran @ 2023-02-22 7:19 ` Wu, Hao A 2023-02-22 11:43 ` Rebecca Cran 0 siblings, 1 reply; 5+ messages in thread From: Wu, Hao A @ 2023-02-22 7:19 UTC (permalink / raw) To: devel@edk2.groups.io, quic_rcran@quicinc.com, Wang, Jian J, Gao, Liming, Ni, Ray Cc: Rebecca Cran Sorry, may I know why only this specific debug message requests format improving while others do not? Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca > Cran > Sent: Tuesday, February 21, 2023 8:52 AM > To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming > <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray > <ray.ni@intel.com> > Cc: Rebecca Cran <rebecca@quicinc.com> > Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of > warning DEBUG in UsbSelectConfig > > Improve the formatting of a warning in UsbSelectConfig by adding parentheses > around the EFI_STATUS value. > > Signed-off-by: Rebecca Cran <rebecca@quicinc.com> > --- > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > index aed34596f469..29a6419c3c86 100644 > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > @@ -440,7 +440,7 @@ UsbSelectConfig ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_WARN, > - "UsbSelectConfig: failed to connect driver %r, ignored\n", > + "UsbSelectConfig: failed to connect driver (%r), ignored\n", > Status > )); > } > -- > 2.30.2 > > > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig 2023-02-22 7:19 ` [edk2-devel] " Wu, Hao A @ 2023-02-22 11:43 ` Rebecca Cran 2023-02-23 1:39 ` Wu, Hao A 0 siblings, 1 reply; 5+ messages in thread From: Rebecca Cran @ 2023-02-22 11:43 UTC (permalink / raw) To: devel, hao.a.wu, Wang, Jian J, Gao, Liming, Ni, Ray That's the only USB debug message I noticed that seemed unclear. Looking through the code I see a few others that could also be improved: MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c 764: "UsbGetOneConfig: failed to get descript length(%d) %r\n", 790: DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full descript %r\n", Status)); 894: DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n", Status)); -- Rebecca Cran On 2/22/23 12:19 AM, Wu, Hao A wrote: > Sorry, may I know why only this specific debug message requests format improving while others do not? > > Best Regards, > Hao Wu > >> -----Original Message----- >> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca >> Cran >> Sent: Tuesday, February 21, 2023 8:52 AM >> To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming >> <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray >> <ray.ni@intel.com> >> Cc: Rebecca Cran <rebecca@quicinc.com> >> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of >> warning DEBUG in UsbSelectConfig >> >> Improve the formatting of a warning in UsbSelectConfig by adding parentheses >> around the EFI_STATUS value. >> >> Signed-off-by: Rebecca Cran <rebecca@quicinc.com> >> --- >> MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >> index aed34596f469..29a6419c3c86 100644 >> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >> @@ -440,7 +440,7 @@ UsbSelectConfig ( >> if (EFI_ERROR (Status)) { >> DEBUG (( >> DEBUG_WARN, >> - "UsbSelectConfig: failed to connect driver %r, ignored\n", >> + "UsbSelectConfig: failed to connect driver (%r), ignored\n", >> Status >> )); >> } >> -- >> 2.30.2 >> >> >> >> >> > > > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig 2023-02-22 11:43 ` Rebecca Cran @ 2023-02-23 1:39 ` Wu, Hao A 2023-02-23 23:08 ` Rebecca Cran 0 siblings, 1 reply; 5+ messages in thread From: Wu, Hao A @ 2023-02-23 1:39 UTC (permalink / raw) To: Rebecca Cran, devel@edk2.groups.io, Wang, Jian J, Gao, Liming, Ni, Ray If you think the format modification is valuable, please at least keep it aligned within the driver level. A search of the keyword '%r' in UsbBusDxe shows: edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbBus.c (8 hits) Line 841: "UsbIoPortReset: failed to reset hub port %d@hub %d, %r \n", Line 870: "UsbIoPortReset: failed to set address for device %d - %r\n", Line 890: "UsbIoPortReset: failed to set configure for device %d - %r\n", Line 948: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open device path %r\n", Status)); Line 981: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC %r\n", Status)); Line 1009: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to install bus protocol %r\n", Status)); Line 1057: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to init root hub %r\n", Status)); Line 1105: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to start bus driver %r\n", Status)); edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbDesc.c (4 hits) Line 764: "UsbGetOneConfig: failed to get descript length(%d) %r\n", Line 790: DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full descript %r\n", Status)); Line 829: DEBUG ((DEBUG_ERROR, "UsbBuildDescTable: failed to get device descriptor - %r\n", Status)); Line 894: DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n", Status)); edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbEnumer.c (9 hits) Line 153: DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status)); Line 172: DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to open host for child - %r\n", Status)); Line 443: "UsbSelectConfig: failed to connect driver (%r), ignored\n", Line 693: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status)); Line 794: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status)); Line 809: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status)); Line 822: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status)); Line 834: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status)); Line 846: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status)); edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbHub.c (5 hits) Line 510: DEBUG ((DEBUG_ERROR, "UsbOnHubInterrupt: failed to remove async transfer - %r\n", Status)); Line 525: DEBUG ((DEBUG_ERROR, "UsbOnHubInterrupt: failed to submit new async transfer - %r\n", Status)); Line 612: DEBUG ((DEBUG_ERROR, "UsbHubInit: failed to read HUB descriptor %r\n", Status)); Line 671: "UsbHubInit: failed to create signal for hub %d - %r\n", Line 700: "UsbHubInit: failed to queue interrupt transfer for hub %d - %r\n", I found that most of them follows the pattern "... - %r ...". Not sure if this format is good enough to you. Best Regards, Hao Wu > -----Original Message----- > From: Rebecca Cran <rebecca@bsdio.com> > Sent: Wednesday, February 22, 2023 7:43 PM > To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J > <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Ni, Ray > <ray.ni@intel.com> > Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of > warning DEBUG in UsbSelectConfig > > That's the only USB debug message I noticed that seemed unclear. > > Looking through the code I see a few others that could also be improved: > > > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c > 764: "UsbGetOneConfig: failed to get descript length(%d) %r\n", > 790: DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full > descript %r\n", Status)); > 894: DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n", > Status)); > > > -- > > Rebecca Cran > > > On 2/22/23 12:19 AM, Wu, Hao A wrote: > > Sorry, may I know why only this specific debug message requests format > improving while others do not? > > > > Best Regards, > > Hao Wu > > > >> -----Original Message----- > >> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > >> Rebecca Cran > >> Sent: Tuesday, February 21, 2023 8:52 AM > >> To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Gao, > >> Liming <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; > >> Ni, Ray <ray.ni@intel.com> > >> Cc: Rebecca Cran <rebecca@quicinc.com> > >> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of > >> warning DEBUG in UsbSelectConfig > >> > >> Improve the formatting of a warning in UsbSelectConfig by adding > >> parentheses around the EFI_STATUS value. > >> > >> Signed-off-by: Rebecca Cran <rebecca@quicinc.com> > >> --- > >> MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > >> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > >> index aed34596f469..29a6419c3c86 100644 > >> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > >> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > >> @@ -440,7 +440,7 @@ UsbSelectConfig ( > >> if (EFI_ERROR (Status)) { > >> DEBUG (( > >> DEBUG_WARN, > >> - "UsbSelectConfig: failed to connect driver %r, ignored\n", > >> + "UsbSelectConfig: failed to connect driver (%r), ignored\n", > >> Status > >> )); > >> } > >> -- > >> 2.30.2 > >> > >> > >> > >> > >> > > > > > > > > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig 2023-02-23 1:39 ` Wu, Hao A @ 2023-02-23 23:08 ` Rebecca Cran 0 siblings, 0 replies; 5+ messages in thread From: Rebecca Cran @ 2023-02-23 23:08 UTC (permalink / raw) To: Wu, Hao A, devel@edk2.groups.io, Wang, Jian J, Gao, Liming, Ni, Ray Thanks, I think that's a good format. I'll send out a v2 patch with more of lines updated. -- Rebecca Cran On 2/22/23 6:39 PM, Wu, Hao A wrote: > If you think the format modification is valuable, please at least keep it aligned within the driver level. > > A search of the keyword '%r' in UsbBusDxe shows: > edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbBus.c (8 hits) > Line 841: "UsbIoPortReset: failed to reset hub port %d@hub %d, %r \n", > Line 870: "UsbIoPortReset: failed to set address for device %d - %r\n", > Line 890: "UsbIoPortReset: failed to set configure for device %d - %r\n", > Line 948: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open device path %r\n", Status)); > Line 981: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC %r\n", Status)); > Line 1009: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to install bus protocol %r\n", Status)); > Line 1057: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to init root hub %r\n", Status)); > Line 1105: DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to start bus driver %r\n", Status)); > edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbDesc.c (4 hits) > Line 764: "UsbGetOneConfig: failed to get descript length(%d) %r\n", > Line 790: DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full descript %r\n", Status)); > Line 829: DEBUG ((DEBUG_ERROR, "UsbBuildDescTable: failed to get device descriptor - %r\n", Status)); > Line 894: DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n", Status)); > edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbEnumer.c (9 hits) > Line 153: DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status)); > Line 172: DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to open host for child - %r\n", Status)); > Line 443: "UsbSelectConfig: failed to connect driver (%r), ignored\n", > Line 693: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status)); > Line 794: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status)); > Line 809: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status)); > Line 822: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status)); > Line 834: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status)); > Line 846: DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status)); > edk2\MdeModulePkg\Bus\Usb\UsbBusDxe\UsbHub.c (5 hits) > Line 510: DEBUG ((DEBUG_ERROR, "UsbOnHubInterrupt: failed to remove async transfer - %r\n", Status)); > Line 525: DEBUG ((DEBUG_ERROR, "UsbOnHubInterrupt: failed to submit new async transfer - %r\n", Status)); > Line 612: DEBUG ((DEBUG_ERROR, "UsbHubInit: failed to read HUB descriptor %r\n", Status)); > Line 671: "UsbHubInit: failed to create signal for hub %d - %r\n", > Line 700: "UsbHubInit: failed to queue interrupt transfer for hub %d - %r\n", > > I found that most of them follows the pattern "... - %r ...". > Not sure if this format is good enough to you. > > Best Regards, > Hao Wu > >> -----Original Message----- >> From: Rebecca Cran <rebecca@bsdio.com> >> Sent: Wednesday, February 22, 2023 7:43 PM >> To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J >> <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Ni, Ray >> <ray.ni@intel.com> >> Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of >> warning DEBUG in UsbSelectConfig >> >> That's the only USB debug message I noticed that seemed unclear. >> >> Looking through the code I see a few others that could also be improved: >> >> >> MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c >> 764: "UsbGetOneConfig: failed to get descript length(%d) %r\n", >> 790: DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full >> descript %r\n", Status)); >> 894: DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n", >> Status)); >> >> >> -- >> >> Rebecca Cran >> >> >> On 2/22/23 12:19 AM, Wu, Hao A wrote: >>> Sorry, may I know why only this specific debug message requests format >> improving while others do not? >>> Best Regards, >>> Hao Wu >>> >>>> -----Original Message----- >>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of >>>> Rebecca Cran >>>> Sent: Tuesday, February 21, 2023 8:52 AM >>>> To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Gao, >>>> Liming <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; >>>> Ni, Ray <ray.ni@intel.com> >>>> Cc: Rebecca Cran <rebecca@quicinc.com> >>>> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Improve formatting of >>>> warning DEBUG in UsbSelectConfig >>>> >>>> Improve the formatting of a warning in UsbSelectConfig by adding >>>> parentheses around the EFI_STATUS value. >>>> >>>> Signed-off-by: Rebecca Cran <rebecca@quicinc.com> >>>> --- >>>> MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >>>> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >>>> index aed34596f469..29a6419c3c86 100644 >>>> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >>>> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c >>>> @@ -440,7 +440,7 @@ UsbSelectConfig ( >>>> if (EFI_ERROR (Status)) { >>>> DEBUG (( >>>> DEBUG_WARN, >>>> - "UsbSelectConfig: failed to connect driver %r, ignored\n", >>>> + "UsbSelectConfig: failed to connect driver (%r), ignored\n", >>>> Status >>>> )); >>>> } >>>> -- >>>> 2.30.2 >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-23 23:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-02-21 0:51 [PATCH 1/1] MdeModulePkg: Improve formatting of warning DEBUG in UsbSelectConfig Rebecca Cran 2023-02-22 7:19 ` [edk2-devel] " Wu, Hao A 2023-02-22 11:43 ` Rebecca Cran 2023-02-23 1:39 ` Wu, Hao A 2023-02-23 23:08 ` Rebecca Cran
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox