Skip to contentSkip to conversation

soundwire: remove an unnecessary NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundwire: remove an unnecessary NULL check

The "bus" pointer isn't NULL so the address to a non-zero offset in middle of "bus" cannot be NULL. Delete the NULL check.

---
 drivers/soundwire/generic_bandwidth_allocation.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/soundwire/generic_bandwidth_allocation.c +1 -5
index 6088775b67a5..fdc0db71360e 100644
@@ -342,15 +342,11 @@ static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
 static int sdw_compute_bus_params(struct sdw_bus *bus)
 {
 	unsigned int max_dr_freq, curr_dr_freq = 0;
-	struct sdw_master_prop *mstr_prop = NULL;
+	struct sdw_master_prop *mstr_prop = &bus->prop;
 	int i, clk_values, ret;
 	bool is_gear = false;
 	u32 *clk_buf;
 
-	mstr_prop = &bus->prop;
-	if (!mstr_prop)
-		return -EINVAL;
-
 	if (mstr_prop->num_clk_gears) {
 		clk_values = mstr_prop->num_clk_gears;
 		clk_buf = mstr_prop->clk_gears;
Signature · 1 line
2.28.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Dan Carpenter

The "bus" pointer isn't NULL so the address to a non-zero offset in middle of "bus" cannot be NULL. Delete the NULL check.

Applied, thanks

Signature · 1 line
~Vinod