Thread (7 messages) flat view 7 messages, 2 authors, 2018-06-28

[PATCH v2 2/5] net: emaclite: Simplify if-else statements

From: joe@perches.com (Joe Perches)
Date: 2018-06-28 11:04:32
Also in: lkml, netdev

On Thu, 2018-06-28 at 13:09 +0530, Radhey Shyam Pandey wrote:
Remove else as it is not required with if doing a return.
Fixes below checkpatch warning.
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
[]
quoted hunk ↗ jump to hunk
@@ -1052,13 +1051,13 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
 {
 	u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL);
 
-	if (p) {
-		return (bool)*p;
-	} else {
+	if (!p) {
 		dev_warn(&ofdev->dev, "Parameter %s not found,"
 			"defaulting to false\n", s);
Please coalesce the format onto a single line
and add the missing space after the comma.
 		return false;
 	}
+
+	return (bool)*p;
 }
 
 static const struct net_device_ops xemaclite_netdev_ops;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help