Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/4] qmi: Remove redundant NULL check in qmi_param_new
@ 2024-04-22 21:40 Denis Kenzior
  2024-04-22 21:40 ` [PATCH 2/4] qmi: voicecall: Fix up code style violations Denis Kenzior
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Denis Kenzior @ 2024-04-22 21:40 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

l_new cannot fail, and thus cannot return NULL.  Remove the check and
simplify the code.
---
 drivers/qmimodem/qmi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index 5032233ec1ec..dfd41317651c 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -2345,13 +2345,7 @@ struct qmi_device *qmi_device_new_qrtr(void)
 
 struct qmi_param *qmi_param_new(void)
 {
-	struct qmi_param *param;
-
-	param = l_new(struct qmi_param, 1);
-	if (!param)
-		return NULL;
-
-	return param;
+	return l_new(struct qmi_param, 1);
 }
 
 void qmi_param_free(struct qmi_param *param)
-- 
2.44.0


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

end of thread, other threads:[~2024-04-22 22:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22 21:40 [PATCH 1/4] qmi: Remove redundant NULL check in qmi_param_new Denis Kenzior
2024-04-22 21:40 ` [PATCH 2/4] qmi: voicecall: Fix up code style violations Denis Kenzior
2024-04-22 21:40 ` [PATCH 3/4] qmi: voicecall: Remove ternary conditional use Denis Kenzior
2024-04-22 21:40 ` [PATCH 4/4] qmi: voicecall: Remove redundant initialization to NULL Denis Kenzior
2024-04-22 22:30 ` [PATCH 1/4] qmi: Remove redundant NULL check in qmi_param_new patchwork-bot+ofono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox