All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc
@ 2019-04-19 10:22 Bhanusree Pola
  2019-04-19 11:22 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Bhanusree Pola @ 2019-04-19 10:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, devel

Replace rtw_malloc with kmalloc to make code OS independent
use kmalloc second argument as GFP_ATOMIC as these are called by functions
that holds lock.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 18fabf5..6a6683c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -128,7 +128,7 @@ static void update_BCNTIM(struct adapter *padapter)
 		}
 
 		if (remainder_ielen > 0) {
-			pbackup_remainder_ie = rtw_malloc(remainder_ielen);
+			pbackup_remainder_ie = kmalloc(remainder_ielen,GFP_ATOMIC);
 			if (pbackup_remainder_ie && premainder_ie)
 				memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
 		}
@@ -1686,7 +1686,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
 	remainder_ielen = ielen - wps_offset - wps_ielen;
 
 	if (remainder_ielen > 0) {
-		pbackup_remainder_ie = rtw_malloc(remainder_ielen);
+		pbackup_remainder_ie = kmalloc(remainder_ielen,GFP_ATOMIC);
 		if (pbackup_remainder_ie)
 			memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
 	}
-- 
2.7.4


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

* Re: [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc
  2019-04-19 10:22 [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc Bhanusree Pola
@ 2019-04-19 11:22 ` Greg Kroah-Hartman
  2019-04-19 13:32   ` Bhanusree Mahesh
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-19 11:22 UTC (permalink / raw)
  To: Bhanusree Pola; +Cc: devel, linux-kernel

On Fri, Apr 19, 2019 at 03:52:43PM +0530, Bhanusree Pola wrote:
> Replace rtw_malloc with kmalloc to make code OS independent
> use kmalloc second argument as GFP_ATOMIC as these are called by functions
> that holds lock.
> 
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index 18fabf5..6a6683c 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -128,7 +128,7 @@ static void update_BCNTIM(struct adapter *padapter)
>  		}
>  
>  		if (remainder_ielen > 0) {
> -			pbackup_remainder_ie = rtw_malloc(remainder_ielen);
> +			pbackup_remainder_ie = kmalloc(remainder_ielen,GFP_ATOMIC);

Always run checkpatch.pl on your patches so you do nto get grumpy
maintainers telling you to run checkpatch.pl on your code :)

Why not fix up all of the callers of this function?  And are you sure
that GFP_ATOMIC is the correct thing to do here?

thanks,

greg k-h

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

* Re: [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc
  2019-04-19 11:22 ` Greg Kroah-Hartman
@ 2019-04-19 13:32   ` Bhanusree Mahesh
  2019-04-19 19:22     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Bhanusree Mahesh @ 2019-04-19 13:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel

On Fri, 19 Apr 2019 at 16:52, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Fri, Apr 19, 2019 at 03:52:43PM +0530, Bhanusree Pola wrote:
> > Replace rtw_malloc with kmalloc to make code OS independent
> > use kmalloc second argument as GFP_ATOMIC as these are called by functions
> > that holds lock.
> >
> > Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_ap.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > index 18fabf5..6a6683c 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > @@ -128,7 +128,7 @@ static void update_BCNTIM(struct adapter *padapter)
> >               }
> >
> >               if (remainder_ielen > 0) {
> > -                     pbackup_remainder_ie = rtw_malloc(remainder_ielen);
> > +                     pbackup_remainder_ie = kmalloc(remainder_ielen,GFP_ATOMIC);
>
> Always run checkpatch.pl on your patches so you do nto get grumpy
> maintainers telling you to run checkpatch.pl on your code :)

>
> Why not fix up all of the callers of this function?

There are many callers of this function. Should I send the whole thing
as of patch series?

>And are you sure
> that GFP_ATOMIC is the correct thing to do here?

yes, because it is called by the function which holds the lock.
correct me if I'm wrong.

>
> thanks,
>
> greg k-h

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

* Re: [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc
  2019-04-19 13:32   ` Bhanusree Mahesh
@ 2019-04-19 19:22     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-19 19:22 UTC (permalink / raw)
  To: Bhanusree Mahesh; +Cc: devel, linux-kernel

On Fri, Apr 19, 2019 at 07:02:47PM +0530, Bhanusree Mahesh wrote:
> On Fri, 19 Apr 2019 at 16:52, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, Apr 19, 2019 at 03:52:43PM +0530, Bhanusree Pola wrote:
> > > Replace rtw_malloc with kmalloc to make code OS independent
> > > use kmalloc second argument as GFP_ATOMIC as these are called by functions
> > > that holds lock.
> > >
> > > Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> > > ---
> > >  drivers/staging/rtl8723bs/core/rtw_ap.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > > index 18fabf5..6a6683c 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > > @@ -128,7 +128,7 @@ static void update_BCNTIM(struct adapter *padapter)
> > >               }
> > >
> > >               if (remainder_ielen > 0) {
> > > -                     pbackup_remainder_ie = rtw_malloc(remainder_ielen);
> > > +                     pbackup_remainder_ie = kmalloc(remainder_ielen,GFP_ATOMIC);
> >
> > Always run checkpatch.pl on your patches so you do nto get grumpy
> > maintainers telling you to run checkpatch.pl on your code :)
> 
> >
> > Why not fix up all of the callers of this function?
> 
> There are many callers of this function. Should I send the whole thing
> as of patch series?

Yes, that would be good.

> >And are you sure
> > that GFP_ATOMIC is the correct thing to do here?
> 
> yes, because it is called by the function which holds the lock.

What lock?

> correct me if I'm wrong.

I don't know, but you should document why you did it this way in the
changelog comment so that people can review it.

thanks,

greg k-h

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

end of thread, other threads:[~2019-04-19 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19 10:22 [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc Bhanusree Pola
2019-04-19 11:22 ` Greg Kroah-Hartman
2019-04-19 13:32   ` Bhanusree Mahesh
2019-04-19 19:22     ` Greg Kroah-Hartman

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.