kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soundwire: remove an unnecessary NULL check
@ 2020-09-23  8:32 Dan Carpenter
  2020-09-23 10:16 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-09-23  8:32 UTC (permalink / raw)
  To: Vinod Koul, Bard Liao
  Cc: Sanyog Kale, kernel-janitors, Pierre-Louis Bossart, alsa-devel

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/soundwire/generic_bandwidth_allocation.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index 6088775b67a5..fdc0db71360e 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -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;
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soundwire: remove an unnecessary NULL check
  2020-09-23  8:32 [PATCH] soundwire: remove an unnecessary NULL check Dan Carpenter
@ 2020-09-23 10:16 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-09-23 10:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kernel-janitors, Sanyog Kale, Bard Liao, Pierre-Louis Bossart,
	alsa-devel

On 23-09-20, 11:32, Dan Carpenter wrote:
> 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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-23 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  8:32 [PATCH] soundwire: remove an unnecessary NULL check Dan Carpenter
2020-09-23 10:16 ` Vinod Koul

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).