All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] staging: rtl8192e: use struct pointer to get the size of the struct
@ 2018-02-24 21:46 Santha Meena Ramamoorthy
  2018-02-25  9:12 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-02-24 21:46 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel, 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.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
---
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(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index 03fbff0..74d4d2d 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -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



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

end of thread, other threads:[~2018-02-28 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-24 21:46 [PATCH v3] staging: rtl8192e: use struct pointer to get the size of the struct Santha Meena Ramamoorthy
2018-02-25  9:12 ` [Outreachy kernel] " Julia Lawall
2018-02-28 18:17   ` Santha Meena Ramamoorthy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.