mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Zheyu Ma <zheyuma97@gmail.com>,
	Nick Bowler <nbowler@draconx.ca>
Subject: Re: [PATCH net-next 11/13] sunhme: Combine continued messages
Date: Mon, 19 Sep 2022 10:14:34 -0400	[thread overview]
Message-ID: <cf05390e-a69b-ad34-8c61-c5e9bbdaf5e3@gmail.com> (raw)
In-Reply-To: <14992029.3CObj9AJNb@eto.sf-tec.de>

On 9/19/22 09:23, Rolf Eike Beer wrote:
> Am Montag, 19. September 2022, 01:26:24 CEST schrieb Sean Anderson:
>> This driver seems to have been written under the assumption that messages
>> can be continued arbitrarily. I'm not when this changed (if ever), but such
>> ad-hoc continuations are liable to be rudely interrupted. Convert all such
>> instances to single prints. This loses a bit of timing information (such as
>> when a line was constructed piecemeal as the function executed), but it's
>> easy to add a few prints if necessary. This also adds newlines to the ends
>> of any prints without them.
> 
> I have a similar patch around, but yours catches more places.
> 
>> diff --git a/drivers/net/ethernet/sun/sunhme.c
>> b/drivers/net/ethernet/sun/sunhme.c index 98c38e213bab..9965c9c872a6 100644
>> --- a/drivers/net/ethernet/sun/sunhme.c
>> +++ b/drivers/net/ethernet/sun/sunhme.c
>> @@ -330,7 +331,6 @@ static int happy_meal_bb_read(struct happy_meal *hp,
>>   	int retval = 0;
>>   	int i;
>>
>> -	ASD("happy_meal_bb_read: reg=%d ", reg);
>>
>>   	/* Enable the MIF BitBang outputs. */
>>   	hme_write32(hp, tregs + TCVR_BBOENAB, 1);
> 
> You can remove one of the empty lines here.

OK

>> @@ -1196,15 +1182,15 @@ static void happy_meal_init_rings(struct happy_meal
>> *hp) struct hmeal_init_block *hb = hp->happy_block;
>>   	int i;
>>
>> -	HMD("happy_meal_init_rings: counters to zero, ");
>> +	HMD("counters to zero\n");
>>   	hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0;
>>
>>   	/* Free any skippy bufs left around in the rings. */
>> -	HMD("clean, ");
>> +	HMD("clean\n");
> 
> I don't think this one is actually needed, there isn't much than can happen in
> between these 2 prints.

OK

>> @@ -1282,17 +1268,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal
>> *hp, * XXX so I completely skip checking for it in the BMSR for now. */
>>
>> -#ifdef AUTO_SWITCH_DEBUG
>> -		ASD("%s: Advertising [ ");
>> -		if (hp->sw_advertise & ADVERTISE_10HALF)
>> -			ASD("10H ");
>> -		if (hp->sw_advertise & ADVERTISE_10FULL)
>> -			ASD("10F ");
>> -		if (hp->sw_advertise & ADVERTISE_100HALF)
>> -			ASD("100H ");
>> -		if (hp->sw_advertise & ADVERTISE_100FULL)
>> -			ASD("100F ");
>> -#endif
>> +		ASD("Advertising [ %s%s%s%s]\n",
>> +		    hp->sw_advertise & ADVERTISE_10HALF ? "10H " : "",
>> +		    hp->sw_advertise & ADVERTISE_10FULL ? "10F " : "",
>> +		    hp->sw_advertise & ADVERTISE_100HALF ? "100H " : "",
>> +		    hp->sw_advertise & ADVERTISE_100FULL ? "100F " :
> "");
>>
>>   		/* Enable Auto-Negotiation, this is usually on
> already... */
>>   		hp->sw_bmcr |= BMCR_ANENABLE;
> 
> Completely independent of this driver, but I wonder if there is no generic
> function to print these 10/100/* full/half duplex strings? There are several
> drivers doing this as a quick grep shows.

There's some functions to print just one link mode, but I think generally the
full advertising word is printed in debugs. I'm not too worried since this is
just for debug.

One of my goals is to convert this driver to phylib, but I haven't dived very
deep into it.

--Sean

  reply	other threads:[~2022-09-19 14:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 23:26 [PATCH net-next 00/13] net: sunhme: Cleanups and logging improvements Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 01/13] sunhme: remove unused tx_dump_ring() Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 02/13] sunhme: Remove version Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 03/13] sunhme: forward the error code from pci_enable_device() Sean Anderson
2022-09-20 19:37   ` Jakub Kicinski
2022-09-18 23:26 ` [PATCH net-next 04/13] sunhme: Return an ERR_PTR from quattro_pci_find Sean Anderson
2022-09-19 13:11   ` Rolf Eike Beer
2022-09-19 14:08     ` Sean Anderson
2022-09-20 19:36   ` Jakub Kicinski
2022-09-18 23:26 ` [PATCH net-next 05/13] sunhme: Regularize probe errors Sean Anderson
2022-09-20 19:36   ` Jakub Kicinski
2022-09-18 23:26 ` [PATCH net-next 06/13] sunhme: switch to devres Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 07/13] sumhme: Convert FOO((...)) to FOO(...) Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 08/13] sunhme: Clean up debug infrastructure Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 09/13] sunhme: Convert printk(KERN_FOO ...) to pr_foo(...) Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 10/13] sunhme: Use (net)dev_foo wherever possible Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 11/13] sunhme: Combine continued messages Sean Anderson
2022-09-19 13:23   ` Rolf Eike Beer
2022-09-19 14:14     ` Sean Anderson [this message]
2022-09-18 23:26 ` [PATCH net-next 12/13] sunhme: Use vdbg for spam-y prints Sean Anderson
2022-09-18 23:26 ` [PATCH net-next 13/13] sunhme: Add myself as a maintainer Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf05390e-a69b-ad34-8c61-c5e9bbdaf5e3@gmail.com \
    --to=seanga2@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eike-kernel@sf-tec.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbowler@draconx.ca \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zheyuma97@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®