DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: huangdengdui <huangdengdui@huawei.com>
Cc: <dev@dpdk.org>, <lihuisong@huawei.com>, <fengchengwen@huawei.com>,
	<liuyonglong@huawei.com>
Subject: Re: [PATCH 2/3] net/hns3: fix unrelease VLAN resource when init fail
Date: Wed, 10 Sep 2025 09:03:22 -0700	[thread overview]
Message-ID: <20250910090322.263689bf@hermes.local> (raw)
In-Reply-To: <7c8afba1-feb3-4150-8e4e-60655a0c7191@huawei.com>

On Thu, 21 Aug 2025 20:16:25 +0800
huangdengdui <huangdengdui@huawei.com> wrote:

> On 2025/8/13 22:51, Stephen Hemminger wrote:
> > On Wed, 13 Aug 2025 15:33:16 +0800
> > Dengdui Huang <huangdengdui@huawei.com> wrote:
> >   
> >> +static void
> >> +hns3_uninit_hardware(struct hns3_hw *hw)
> >> +{
> >> +	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
> >> +
> >> +	(void)hns3_uninit_umv_space(hw);  
> > 
> > Overall, the patch looks good. But why the (void) cast here.
> > The compiler allows ignoring return value unless the must check attribute is set.  
> 
> Our internal coding standards require that when we do not check the return value of a function,
> we use `(void)` to indicate that we have thoroughly considered that it is unnecessary to handle the return value here.

Having a close or uninit function return an error code is rarely useful.
The application is left with "what now scenario".

This style goes back to 90's BSD style. Probably when your coding standards were written..

PS: if you want to force checking of return value, there are attributes for that.


  reply	other threads:[~2025-09-10 16:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  7:33 [PATCH 0/3] net/hns3: bugfix for hns3 Dengdui Huang
2025-08-13  7:33 ` [PATCH 1/3] net/hns3: fix inconsistent lock Dengdui Huang
2025-08-13 21:06   ` Stephen Hemminger
2025-08-21 12:20     ` huangdengdui
2025-09-08 11:53     ` Thomas Monjalon
2025-09-08 19:58       ` Stephen Hemminger
2025-09-08 20:20         ` Thomas Monjalon
2025-09-09  1:53           ` huangdengdui
2025-08-21 12:24   ` David Marchand
2025-08-22  4:00     ` huangdengdui
2025-08-13  7:33 ` [PATCH 2/3] net/hns3: fix unrelease VLAN resource when init fail Dengdui Huang
2025-08-13 14:51   ` Stephen Hemminger
2025-08-21 12:16     ` huangdengdui
2025-09-10 16:03       ` Stephen Hemminger [this message]
2025-08-13  7:33 ` [PATCH 3/3] net/hns3: fix overwrite mbuf in vector path Dengdui Huang
2025-08-22  6:04 ` [PATCH v2 0/4] net/hns3: bugfix for hns3 Dengdui Huang
2025-08-22  6:04   ` [PATCH v2 1/4] net/hns3: fix inconsistent lock Dengdui Huang
2025-08-22  6:04   ` [PATCH v2 2/4] net/hns3: enable lock annotations check Dengdui Huang
2025-08-22  6:04   ` [PATCH v2 3/4] net/hns3: fix unrelease VLAN resource when init fail Dengdui Huang
2025-08-22  6:04   ` [PATCH v2 4/4] net/hns3: fix overwrite mbuf in vector path Dengdui Huang

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=20250910090322.263689bf@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=huangdengdui@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=liuyonglong@huawei.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;
as well as URLs for NNTP newsgroup(s).