Skip to contentSkip to conversation

staging: rtl8192e: use struct pointer to get the size of the struct

PATCH In review Santha Meena Ramamoorthy 2 participants 3 messages Feb 24, 2018 – Feb 28, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: rtl8192e: use struct pointer to get the size of the struct

Use pointer to the structure to get the size of the structure in order to conform to the Linux kernel coding style. Issue found using checkpatch.

---
Change in v2:
- Use single line when the number of characters is less than 80
Change in v3:
- Improve the subject line and the commit message
No code change since v2

 drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtllib_wx.c +1 -2
index 03fbff0..74d4d2d 100644
@@ -371,8 +371,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
 		struct lib80211_crypt_data *new_crypt;
 
 		/* take WEP into use */
-		new_crypt = kzalloc(sizeof(struct lib80211_crypt_data),
-				    GFP_KERNEL);
+		new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
 		if (new_crypt == NULL)
 			return -ENOMEM;
 		new_crypt->ops = lib80211_get_crypto_ops("R-WEP");
Signature · 1 line
2.7.4
Acked-by on v3 1/1
#1 lore raw
Quoted 5 lines · Santha Meena Ramamoorthy

Use pointer to the structure to get the size of the structure in order to conform to the Linux kernel coding style. Issue found using checkpatch.

Quoted 6 lines

---
Change in v2:
- Use single line when the number of characters is less than 80
Change in v3:
- Improve the subject line and the commit message
No code change since v2

Actually, the most recent change description should come first.

julia

Quoted 27 lines
 drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtllib_wx.c +1 -3
index 03fbff0..74d4d2d 100644
@@ -371,8 +371,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
 		struct lib80211_crypt_data *new_crypt;
 
 		/* take WEP into use */
-		new_crypt = kzalloc(sizeof(struct lib80211_crypt_data),
-				    GFP_KERNEL);
+		new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
 		if (new_crypt == NULL)
 			return -ENOMEM;
 		new_crypt->ops = lib80211_get_crypto_ops("R-WEP");
--

2.7.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/1519508793-11537-1-git-send-email-santhameena13%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 19 lines · Julia Lawall
Quoted 5 lines · Santha Meena Ramamoorthy

Use pointer to the structure to get the size of the structure in order to conform to the Linux kernel coding style. Issue found using checkpatch.

Quoted 6 lines

---
Change in v2:
- Use single line when the number of characters is less than 80
Change in v3:
- Improve the subject line and the commit message
No code change since v2

Quoted 3 lines

Actually, the most recent change description should come first.

julia

Sorry, I'll remember that :)

Quoted 28 lines
Quoted 28 lines
 drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtllib_wx.c +1 -3
index 03fbff0..74d4d2d 100644
@@ -371,8 +371,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
 		struct lib80211_crypt_data *new_crypt;
 
 		/* take WEP into use */
-		new_crypt = kzalloc(sizeof(struct lib80211_crypt_data),
-				    GFP_KERNEL);
+		new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
 		if (new_crypt == NULL)
 			return -ENOMEM;
 		new_crypt->ops = lib80211_get_crypto_ops("R-WEP");
--

2.7.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/1519508793-11537-1-git-send-email-santhameena13%40gmail.com.
For more options, visit https://groups.google.com/d/optout.