Skip to contentSkip to conversation

Staging: Do not print message if kzalloc() failed.

PATCH Superseded Sandhya Bankar 2 participants 7 messages Mar 1, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Staging: Do not print message if kzalloc() failed.

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

Sandhya Bankar (4):
Staging: lustre: Do not print message if kzalloc() failed.
Staging: rtl8188eu: Do not print message if kzalloc() failed.
Staging: rtl8188eu: rtw_efuse: Do not print message if kzalloc() failed.
Staging: wlan-ng: Do not print message if kzalloc() failed.

 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ----
 drivers/staging/rtl8188eu/core/rtw_cmd.c        | 3 +--
 drivers/staging/rtl8188eu/core/rtw_efuse.c      | 3 +--
 drivers/staging/wlan-ng/prism2sta.c             | 1 -
 4 files changed, 2 insertions(+), 9 deletions(-)
Signature · 1 line
1.8.3.4
#1 lore raw

PATCH 1/4 Staging: lustre: Do not print message if kzalloc() failed.

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -4
index 1f3e8e8..c7b0729 100644
@@ -1938,10 +1938,6 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req)
 	body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
 	op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
 	if (!op_data) {
-		CWARN("%s: cannot allocate op_data to release open handle for "
-		      DFID "\n",
-		      ll_get_fsname(sb, NULL, 0), PFID(&body->fid1));
-
 		return;
 	}
 
Signature · 1 line
1.8.3.4
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/4] Staging: lustre: Do not print message if kzalloc() failed.

Quoted 13 lines · Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -0
index 1f3e8e8..c7b0729 100644

drivers/staging/lustre/lustre/llite/llite_lib.c void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req) · line 1941

Quoted 8 lines
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -4
@@ -1938,10 +1938,6 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req)
 	body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
 	op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
 	if (!op_data) {
-		CWARN("%s: cannot allocate op_data to release open handle for "
-		      DFID "\n",
-		      ll_get_fsname(sb, NULL, 0), PFID(&body->fid1));
-
 		return;

Same problem.

julia

Quoted 12 lines
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -1
 	}
 
--

1.8.3.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/a9225769650e278d513f73c69521c9a52d20808f.1456822984.git.bankarsandhya512%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

PATCH 2/4 Staging: rtl8188eu: Do not print message if kzalloc() failed.

In reply to Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +1 -2
index 1de7929..e5a6b7a 100644
@@ -394,9 +394,8 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid));
 
 	pcmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-	if (pcmd == NULL) {
+	if (!pcmd) {
 		res = _FAIL;
-		RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
 		goto exit;
 	}
 	/* for IEs is fix buf size */
Signature · 1 line
1.8.3.4
#4 lore raw

PATCH 3/4 Staging: rtl8188eu: rtw_efuse: Do not print message if kzalloc() failed.

In reply to Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +1 -2
index fd8cf47..34d789c 100644
@@ -104,8 +104,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	u8 u1temp = 0;
 
 	efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
-	if (efuseTbl == NULL) {
-		DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
+	if (!efuseTbl) {
 		return;
 	}
 
Signature · 1 line
1.8.3.4
#5 lore raw

Re: [Outreachy kernel] [PATCH 3/4] Staging: rtl8188eu: rtw_efuse: Do not print message if kzalloc() failed.

Quoted 13 lines · Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
index fd8cf47..34d789c 100644

drivers/staging/rtl8188eu/core/rtw_efuse.c efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) · line 109

Quoted 8 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +1 -2
@@ -104,8 +104,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	u8 u1temp = 0;
 
 	efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
-	if (efuseTbl == NULL) {
-		DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
+	if (!efuseTbl) {
 		return;
 	}

Now there is only one statement in the branch and the braces are not needed.

julia

#6 lore raw

PATCH 4/4 Staging: wlan-ng: Do not print message if kzalloc() failed.

In reply to Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/wlan-ng/prism2sta.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/wlan-ng/prism2sta.c +0 -1
index 131223a..e245732 100644
@@ -1886,7 +1886,6 @@ static wlandevice_t *create_wlan(void)
 	hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL);
 
 	if (!wlandev || !hw) {
-		pr_err("%s: Memory allocation failure.\n", dev_info);
 		kfree(wlandev);
 		kfree(hw);
 		return NULL;
Signature · 1 line
1.8.3.4