Re: [PATCH v4 01/32] xhci: add support to allocate several interrupters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux