diff mbox series

linux: qed: Remove unnecessary ‘NULL’ values values from Pointer

Message ID 20220919020614.3615-1-zeming@nfschina.com (mailing list archive)
State Rejected
Headers show
Series linux: qed: Remove unnecessary ‘NULL’ values values from Pointer | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Li zeming Sept. 19, 2022, 2:06 a.m. UTC
The pointer p_ret is first assigned and finally used as the return value
of the function.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 include/linux/qed/qed_chain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Sept. 20, 2022, 11:47 p.m. UTC | #1
On Mon, 19 Sep 2022 10:06:14 +0800 Li zeming wrote:
> The pointer p_ret is first assigned and finally used as the return value
> of the function.

This patch doesn't make anything substantially better.
Li zeming Sept. 22, 2022, 1:39 a.m. UTC | #2
Thank you very much for your reply. Before, I found in the test that variable initialization assignment need to execute mov-related assembly instructions. If you remove unnecessary initialization assignments, you should be able to reduce the execution of some instructions.
diff mbox series

Patch

diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h
index a84063492c71..f52c589e6dfa 100644
--- a/include/linux/qed/qed_chain.h
+++ b/include/linux/qed/qed_chain.h
@@ -368,7 +368,7 @@  static inline void qed_chain_return_produced(struct qed_chain *p_chain)
  */
 static inline void *qed_chain_produce(struct qed_chain *p_chain)
 {
-	void *p_ret = NULL, *p_prod_idx, *p_prod_page_idx;
+	void *p_ret, *p_prod_idx, *p_prod_page_idx;
 
 	if (is_chain_u16(p_chain)) {
 		if ((p_chain->u.chain16.prod_idx &