All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Subbaraya Sundeep <sbhatta@marvell.com>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<sgoutham@marvell.com>, <gakula@marvell.com>,
	<hkelam@marvell.com>, <bbhushan2@marvell.com>,
	<netdev@vger.kernel.org>, Suman Ghosh <sumang@marvell.com>
Subject: Re: [net-next PATCH] octeontx2-pf: Check for DMAC extraction before setting VF DMAC
Date: Fri, 27 Jun 2025 16:59:42 -0700	[thread overview]
Message-ID: <20250627165942.1f70a6da@kernel.org> (raw)
In-Reply-To: <1750851002-19418-1-git-send-email-sbhatta@marvell.com>

On Wed, 25 Jun 2025 17:00:02 +0530 Subbaraya Sundeep wrote:
> +	/* Check if NPC_DMAC feature is set in NPC. If not set then
> +	 * return from the function.
> +	 */
> +	mutex_lock(&pf->mbox.lock);
> +	req = otx2_mbox_alloc_msg_npc_get_field_status(&pf->mbox);
> +	if (!req) {
> +		mutex_unlock(&pf->mbox.lock);
> +		return -ENOMEM;
> +	}
> +
> +	req->field = NPC_DMAC;
> +	ret = otx2_sync_mbox_msg(&pf->mbox);
> +	if (ret) {
> +		mutex_unlock(&pf->mbox.lock);
> +		return ret;
> +	}
> +
> +	rsp = (struct npc_get_field_status_rsp *)otx2_mbox_get_rsp
> +	       (&pf->mbox.mbox, 0, &req->hdr);

This is too ugly. Cast it to a void pointer to avoid the super long
line.

> +	if (IS_ERR(rsp)) {
> +		mutex_unlock(&pf->mbox.lock);
> +		return PTR_ERR(rsp);
> +	}
> +
> +	mutex_unlock(&pf->mbox.lock);
> +
> +	if (!rsp->enable)
> +		return 0;

Please send as a fix, and factor this out to a helper.
-- 
pw-bot: cr

      parent reply	other threads:[~2025-06-27 23:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 11:30 [net-next PATCH] octeontx2-pf: Check for DMAC extraction before setting VF DMAC Subbaraya Sundeep
2025-06-25 19:02 ` Simon Horman
2025-06-26  6:23   ` Subbaraya Sundeep
2025-06-26  7:25     ` Simon Horman
2025-06-27 23:59 ` Jakub Kicinski [this message]

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=20250627165942.1f70a6da@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.