linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Eric Dumazet <edumazet@google.com>,
	Mark Brown <broonie@kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linuxppc-dev@lists.ozlabs.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 1/4] net: wan: Add support for QMC HDLC
Date: Wed, 24 Jan 2024 15:39:27 +0100	[thread overview]
Message-ID: <20240124153927.174f5b7a@bootlin.com> (raw)
In-Reply-To: <7e7c5d46-001c-46db-85ca-eca013225a89@linux.dev>

Hi Vadim,

On Wed, 24 Jan 2024 10:03:45 +0000
Vadim Fedorenko <vadim.fedorenko@linux.dev> wrote:

[...]

> > +static void qmc_hcld_recv_complete(void *context, size_t length, unsigned int flags)
> > +{
> > +	struct qmc_hdlc_desc *desc = context;
> > +	struct net_device *netdev = desc->netdev;
> > +	struct qmc_hdlc *qmc_hdlc = netdev_to_qmc_hdlc(desc->netdev);  
> 
> a line above desc->netdev was stored in netdev. better to reuse it and 
> make declaration part consistent with qmc_hcld_xmit_complete

Yes.
Will updated in the next iteration.

[...]

> > +static netdev_tx_t qmc_hdlc_xmit(struct sk_buff *skb, struct net_device *netdev)
> > +{
> > +	struct qmc_hdlc *qmc_hdlc = netdev_to_qmc_hdlc(netdev);
> > +	struct qmc_hdlc_desc *desc;
> > +	unsigned long flags;
> > +	int ret;
> > +
> > +	spin_lock_irqsave(&qmc_hdlc->tx_lock, flags);
> > +	desc = &qmc_hdlc->tx_descs[qmc_hdlc->tx_out];
> > +	if (desc->skb) {
> > +		/* Should never happen.
> > +		 * Previous xmit should have already stopped the queue.
> > +		 */  
> 
> according to the comment it's better to make if(unlikely(desc->skb)) or
> even WARN_ONCE()
> 

Indeed. I will use WARN_ONCE() in the next iteration.

Thanks for your review,
Hervé

  reply	other threads:[~2024-01-24 14:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 16:49 [PATCH 0/4] Add support for QMC HDLC Herve Codina
2024-01-23 16:49 ` [PATCH 1/4] net: wan: " Herve Codina
2024-01-24 10:03   ` Vadim Fedorenko
2024-01-24 14:39     ` Herve Codina [this message]
2024-01-23 16:49 ` [PATCH 2/4] MAINTAINERS: Add the Freescale QMC HDLC driver entry Herve Codina
2024-01-23 16:49 ` [PATCH 3/4] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support Herve Codina
2024-01-24 10:10   ` Vadim Fedorenko
2024-01-24 15:26     ` Herve Codina
2024-01-24 16:19       ` Vadim Fedorenko
2024-01-23 16:49 ` [PATCH 4/4] net: wan: fsl_qmc_hdlc: Add framer support Herve Codina

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=20240124153927.174f5b7a@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vadim.fedorenko@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).