lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 Jul 2023 12:00:52 +0200
From:   Oliver Neukum <oneukum@...e.com>
To:     Wesley Cheng <quic_wcheng@...cinc.com>, agross@...nel.org,
        andersson@...nel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
        catalin.marinas@....com, will@...nel.org, mathias.nyman@...el.com,
        gregkh@...uxfoundation.org, lgirdwood@...il.com,
        broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
        srinivas.kandagatla@...aro.org, bgoswami@...cinc.com,
        Thinh.Nguyen@...opsys.com
Cc:     linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-usb@...r.kernel.org, alsa-devel@...a-project.org,
        quic_jackp@...cinc.com, pierre-louis.bossart@...ux.intel.com,
        oneukum@...e.com, albertccwang@...gle.com, o-takashi@...amocchi.jp,
        Mathias Nyman <mathias.nyman@...ux.intel.com>
Subject: Re: [PATCH v4 01/32] xhci: add support to allocate several
 interrupters

On 25.07.23 04:33, Wesley Cheng wrote:

Hi,

this is more of a stylistic remark, but this:

[..]
> +	/* Find available secondary interrupter, interrupter 0 is reserverd for primary */
> +	for (i = 1; i < xhci->max_interrupters; i++) {
> +		if (xhci->interrupters[i] == NULL) {
> +			err = xhci_add_interrupter(xhci, ir, i);
> +			break;
> +		}
> +	}
> +
> +	spin_unlock_irq(&xhci->lock);
> +
> +	if (!err) {

Making the non error case a conditional return is ...

> +		xhci_dbg(xhci, "Add secondary interrupter %d, max interrupters %d\n",
> +			 i, xhci->max_interrupters);
> +		return ir;
> +	}
> +
> +	xhci_warn(xhci, "Failed to add secondary interrupter, max interrupters %d\n",
> +		  xhci->max_interrupters);
> +
> +	xhci_free_interrupter(xhci, ir);
> +
> +	return NULL;
> +}

Was this taken out of a style guide that teaches to avoid "goto"
at any cost?

	Regards
		Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ