[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190419192217.GB11144@kroah.com>
Date: Fri, 19 Apr 2019 21:22:17 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Bhanusree Mahesh <bhanusreemahesh@...il.com>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: rtl8723bs: core: Replace rtw_malloc with kmalloc
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@...uxfoundation.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@...il.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
Powered by blists - more mailing lists