From: Jason Yan <yanaijie@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <wambui.karugax@gmail.com>, <devel@driverdev.osuosl.org>,
<linux-kernel@vger.kernel.org>, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH 2/7] staging: rtl8723bs: os_dep: remove set but not used 'size'
Date: Tue, 28 Apr 2020 20:39:50 +0800 [thread overview]
Message-ID: <a586bc5f-d7af-c1cc-8213-b63639061947@huawei.com> (raw)
In-Reply-To: <20200428122853.GB1253850@kroah.com>
在 2020/4/28 20:28, Greg KH 写道:
> On Mon, Apr 27, 2020 at 11:23:37AM +0800, Jason Yan wrote:
>> And also remove the NULL check before kfree() because kfree() can handle
>> NULL pointers correctly.
>>
>> Fix the following gcc warning:
>>
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:157:6: warning:
>> variable ‘size’ set but not used [-Wunused-but-set-variable]
>> u32 size = 0;
>> ^~~~
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 11 -----------
>> 1 file changed, 11 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
>> index 1ba85a43f05a..b037868fbf22 100644
>> --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
>> +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
>> @@ -154,17 +154,6 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc(
>>
>> static void rtw_spt_band_free(struct ieee80211_supported_band *spt_band)
>> {
>> - u32 size = 0;
>> -
>> - if (!spt_band)
>> - return;
>> -
>> - if (spt_band->band == NL80211_BAND_2GHZ)
>> - {
>> - size = sizeof(struct ieee80211_supported_band)
>> - + sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM
>> - + sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM;
>> - }
>> kfree(spt_band);
>> }
>
> This function can now be removed and replaced with the call to kfree(),
> right? Can you send a follow-on patch to do that?
>
Sure.
> thanks,
>
> greg k-h
>
> .
>
next prev parent reply other threads:[~2020-04-28 12:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 3:23 [PATCH 0/7] staging: rtl8723bs: some code cleanup Jason Yan
2020-04-27 3:23 ` [PATCH 1/7] staging: rtl8723bs: os_dep: remove set but not used 'uintRet' Jason Yan
2020-04-28 12:27 ` Greg KH
2020-04-27 3:23 ` [PATCH 2/7] staging: rtl8723bs: os_dep: remove set but not used 'size' Jason Yan
2020-04-28 12:28 ` Greg KH
2020-04-28 12:39 ` Jason Yan [this message]
2020-04-27 3:23 ` [PATCH 3/7] Staging: rtl8723bs: core: remove set but not used 'ptxservq' Jason Yan
2020-04-27 3:23 ` [PATCH 4/7] staging: rtl8723bs: core: remove set but not used 'algthm' Jason Yan
2020-04-27 3:23 ` [PATCH 5/7] staging: rtl8723bs: core: remove set but not used 'listen_interval' Jason Yan
2020-04-27 3:23 ` [PATCH 6/7] staging: rtl8723bs: core: remove set but not used 'pwrpriv' Jason Yan
2020-04-27 3:23 ` [PATCH 7/7] staging: rtl8723bs: core: remove set but not used 'pframe' Jason Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a586bc5f-d7af-c1cc-8213-b63639061947@huawei.com \
--to=yanaijie@huawei.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hulkci@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wambui.karugax@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®