* [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c
@ 2021-06-08 23:56 Phillip Potter
2021-06-09 9:21 ` Dan Carpenter
2021-06-09 10:02 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Phillip Potter @ 2021-06-08 23:56 UTC (permalink / raw)
To: gregkh; +Cc: Larry.Finger, straube.linux, kaixuxia, linux-staging, linux-kernel
Within rtl88eu_dm_txpower_track_adjust function, retrieve the struct
net_device pointer, and replace both calls to the ODM_RT_TRACE macro
with equivalent netdev_dbg calls, as well as modifying layout, wording
and spacing slightly. The purpose of this, and patches like it, is to
eventually remove the need for include/odm_debug.h, which is an overly
complex way of printing debug/tracing information about the driver.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
---
drivers/staging/rtl8188eu/hal/phy.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index a664bff370bb..a8caf618f588 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -301,11 +301,12 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type,
u8 *direction, u32 *out_write_val)
{
u8 pwr_value = 0;
+ struct net_device *pnetdev = dm_odm->Adapter->pnetdev;
+
/* Tx power tracking BB swing table. */
if (type == 0) { /* For OFDM adjust */
- ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
- ("BbSwingIdxOfdm = %d BbSwingFlagOfdm=%d\n",
- dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm));
+ netdev_dbg(pnetdev, "%s(): BbSwingIdxOfdm = %d BbSwingFlagOfdm = %d\n",
+ __func__, dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm);
if (dm_odm->BbSwingIdxOfdm <= dm_odm->BbSwingIdxOfdmBase) {
*direction = 1;
@@ -318,9 +319,8 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type,
}
} else if (type == 1) { /* For CCK adjust. */
- ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
- ("dm_odm->BbSwingIdxCck = %d dm_odm->BbSwingIdxCckBase = %d\n",
- dm_odm->BbSwingIdxCck, dm_odm->BbSwingIdxCckBase));
+ netdev_dbg(pnetdev, "%s(): BbSwingIdxCck = %d BbSwingIdxCckBase = %d\n",
+ __func__, dm_odm->BbSwingIdxCck, dm_odm->BbSwingIdxCckBase);
if (dm_odm->BbSwingIdxCck <= dm_odm->BbSwingIdxCckBase) {
*direction = 1;
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c
2021-06-08 23:56 [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c Phillip Potter
@ 2021-06-09 9:21 ` Dan Carpenter
2021-06-10 22:43 ` Phillip Potter
2021-06-09 10:02 ` Greg KH
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-06-09 9:21 UTC (permalink / raw)
To: Phillip Potter
Cc: gregkh, Larry.Finger, straube.linux, kaixuxia, linux-staging,
linux-kernel
On Wed, Jun 09, 2021 at 12:56:09AM +0100, Phillip Potter wrote:
> Within rtl88eu_dm_txpower_track_adjust function, retrieve the struct
> net_device pointer, and replace both calls to the ODM_RT_TRACE macro
> with equivalent netdev_dbg calls, as well as modifying layout, wording
> and spacing slightly. The purpose of this, and patches like it, is to
> eventually remove the need for include/odm_debug.h, which is an overly
> complex way of printing debug/tracing information about the driver.
>
In the original code DebugComponents is always zero so the ODM_RT_TRACE()
stuff was dead code and could never be printed. I would prefer we just
delete it all instead of fixing it.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c
2021-06-08 23:56 [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c Phillip Potter
2021-06-09 9:21 ` Dan Carpenter
@ 2021-06-09 10:02 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-06-09 10:02 UTC (permalink / raw)
To: Phillip Potter
Cc: Larry.Finger, straube.linux, kaixuxia, linux-staging, linux-kernel
On Wed, Jun 09, 2021 at 12:56:09AM +0100, Phillip Potter wrote:
> Within rtl88eu_dm_txpower_track_adjust function, retrieve the struct
> net_device pointer, and replace both calls to the ODM_RT_TRACE macro
> with equivalent netdev_dbg calls, as well as modifying layout, wording
> and spacing slightly. The purpose of this, and patches like it, is to
> eventually remove the need for include/odm_debug.h, which is an overly
> complex way of printing debug/tracing information about the driver.
>
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
> drivers/staging/rtl8188eu/hal/phy.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index a664bff370bb..a8caf618f588 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -301,11 +301,12 @@ void rtl88eu_dm_txpower_track_adjust(struct odm_dm_struct *dm_odm, u8 type,
> u8 *direction, u32 *out_write_val)
> {
> u8 pwr_value = 0;
> + struct net_device *pnetdev = dm_odm->Adapter->pnetdev;
> +
> /* Tx power tracking BB swing table. */
> if (type == 0) { /* For OFDM adjust */
> - ODM_RT_TRACE(dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
> - ("BbSwingIdxOfdm = %d BbSwingFlagOfdm=%d\n",
> - dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm));
> + netdev_dbg(pnetdev, "%s(): BbSwingIdxOfdm = %d BbSwingFlagOfdm = %d\n",
> + __func__, dm_odm->BbSwingIdxOfdm, dm_odm->BbSwingFlagOfdm);
Along with what Dan said, please note that the dev_dbg() and
netdev_dbg() calls allow the user to see the function where the message
came from automatically, so there's never a need to add a __func__
string in the output.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c
2021-06-09 9:21 ` Dan Carpenter
@ 2021-06-10 22:43 ` Phillip Potter
0 siblings, 0 replies; 4+ messages in thread
From: Phillip Potter @ 2021-06-10 22:43 UTC (permalink / raw)
To: Dan Carpenter
Cc: gregkh, Larry.Finger, straube.linux, kaixuxia, linux-staging,
linux-kernel
On Wed, Jun 09, 2021 at 12:21:06PM +0300, Dan Carpenter wrote:
> On Wed, Jun 09, 2021 at 12:56:09AM +0100, Phillip Potter wrote:
> > Within rtl88eu_dm_txpower_track_adjust function, retrieve the struct
> > net_device pointer, and replace both calls to the ODM_RT_TRACE macro
> > with equivalent netdev_dbg calls, as well as modifying layout, wording
> > and spacing slightly. The purpose of this, and patches like it, is to
> > eventually remove the need for include/odm_debug.h, which is an overly
> > complex way of printing debug/tracing information about the driver.
> >
>
> In the original code DebugComponents is always zero so the ODM_RT_TRACE()
> stuff was dead code and could never be printed. I would prefer we just
> delete it all instead of fixing it.
>
> regards,
> dan carpenter
>
Dear Dan (and Greg),
Thank you for your feedback. I will just remove all the ODM_RT_TRACE
calls in a follow up patch set in that case.
Regards,
Phil
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-10 22:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 23:56 [PATCH] staging: rtl8188eu: replace two ODM_RT_TRACE calls in hal/phy.c Phillip Potter
2021-06-09 9:21 ` Dan Carpenter
2021-06-10 22:43 ` Phillip Potter
2021-06-09 10:02 ` Greg KH
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).