* [PATCH v2] staging: use structure pointer to get the size of the structure
@ 2018-02-24 20:51 Santha Meena Ramamoorthy
2018-02-24 20:56 ` [Outreachy kernel] " Hetavi (Haley) Shah
2018-02-24 21:03 ` Julia Lawall
0 siblings, 2 replies; 5+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-02-24 20:51 UTC (permalink / raw)
To: gregkh; +Cc: garsilva, outreachy-kernel, Santha Meena Ramamoorthy
Use pointer to the structure to get the size of the structure. 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
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] 5+ messages in thread* Re: [Outreachy kernel] [PATCH v2] staging: use structure pointer to get the size of the structure
2018-02-24 20:51 [PATCH v2] staging: use structure pointer to get the size of the structure Santha Meena Ramamoorthy
@ 2018-02-24 20:56 ` Hetavi (Haley) Shah
2018-02-24 21:07 ` Julia Lawall
2018-02-24 21:03 ` Julia Lawall
1 sibling, 1 reply; 5+ messages in thread
From: Hetavi (Haley) Shah @ 2018-02-24 20:56 UTC (permalink / raw)
To: Santha Meena Ramamoorthy; +Cc: gregkh, garsilva, outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]
Hello,
I have recently found out about this project and would like to make some
contributions.
May I know what is the first contribution that I can start with?
Thank you,
Haley Shah.
On Sat, Feb 24, 2018 at 2:51 PM, Santha Meena Ramamoorthy <
santhameena13@gmail.com> wrote:
> Use pointer to the structure to get the size of the structure. 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
> 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
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/outreachy-kernel/1519505516-10389-1-git-send-
> email-santhameena13%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
[-- Attachment #2: Type: text/html, Size: 3043 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH v2] staging: use structure pointer to get the size of the structure
2018-02-24 20:51 [PATCH v2] staging: use structure pointer to get the size of the structure Santha Meena Ramamoorthy
2018-02-24 20:56 ` [Outreachy kernel] " Hetavi (Haley) Shah
@ 2018-02-24 21:03 ` Julia Lawall
2018-02-24 21:21 ` Santha Meena Ramamoorthy
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-02-24 21:03 UTC (permalink / raw)
To: Santha Meena Ramamoorthy; +Cc: gregkh, garsilva, outreachy-kernel
Sorry for not noticing this before, but the subject line needs to be more
specific than staging. Use git log --oneline on the file to see what
others have done before.
On Sat, 24 Feb 2018, Santha Meena Ramamoorthy wrote:
> Use pointer to the structure to get the size of the structure.
It would also be good to say why this is a good idea. The code remains
correct even if the type changes.
Also, it looks liek you have not followed the get_maintainer call
suggested in the tutorial. Greg is the only maintainer listed on this
code.
julia
> 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
> 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
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1519505516-10389-1-git-send-email-santhameena13%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH v2] staging: use structure pointer to get the size of the structure
2018-02-24 21:03 ` Julia Lawall
@ 2018-02-24 21:21 ` Santha Meena Ramamoorthy
0 siblings, 0 replies; 5+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-02-24 21:21 UTC (permalink / raw)
To: Julia Lawall, outreachy-kernel
On Sat, Feb 24, 2018 at 10:03:54PM +0100, Julia Lawall wrote:
> Sorry for not noticing this before, but the subject line needs to be more
> specific than staging. Use git log --oneline on the file to see what
> others have done before.
>
> On Sat, 24 Feb 2018, Santha Meena Ramamoorthy wrote:
>
> > Use pointer to the structure to get the size of the structure.
>
> It would also be good to say why this is a good idea. The code remains
> correct even if the type changes.
>
> Also, it looks liek you have not followed the get_maintainer call
> suggested in the tutorial. Greg is the only maintainer listed on this
> code.
>
> julia
Sorry, I'll fix them now.
Thanks,
Santha
>
> > 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
> > 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
> >
> > --
> > 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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1519505516-10389-1-git-send-email-santhameena13%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-24 21:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-24 20:51 [PATCH v2] staging: use structure pointer to get the size of the structure Santha Meena Ramamoorthy
2018-02-24 20:56 ` [Outreachy kernel] " Hetavi (Haley) Shah
2018-02-24 21:07 ` Julia Lawall
2018-02-24 21:03 ` Julia Lawall
2018-02-24 21:21 ` 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.