From: Ajay Singh <ajay.kathat@microchip.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <devel@driverdev.osuosl.org>, <venkateswara.kaja@microchip.com>,
<gregkh@linuxfoundation.org>, <linux-wireless@vger.kernel.org>,
<ganesh.krishna@microchip.com>, <adham.abozaeid@microchip.com>,
<aditya.shankar@microchip.com>
Subject: Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name
Date: Wed, 1 Aug 2018 10:46:00 +0530 [thread overview]
Message-ID: <20180801104600.2716843b@ajaysk-VirtualBox> (raw)
In-Reply-To: <20180730113231.gwqliakpdgbchrre@mwanda>
Hi Dan,
On Mon, 30 Jul 2018 14:32:31 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Mon, Jul 30, 2018 at 03:40:24PM +0530, Ajay Singh wrote:
> > Hi Dan,
> >
> > On Mon, 30 Jul 2018 11:41:13 +0300
> > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > > On Fri, Jul 20, 2018 at 04:35:24AM +0530, Ajay Singh wrote:
> > > > Hi Dan,
> > > >
> > > > On Thu, 19 Jul 2018 12:27:44 +0300
> > > > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > > >
> > > > > On Thu, Jul 19, 2018 at 04:15:01AM +0530, Ajay Singh
> > > > > wrote:
> > > > > > diff --git a/drivers/staging/wilc1000/wilc_wlan.c
> > > > > > b/drivers/staging/wilc1000/wilc_wlan.c index
> > > > > > 85af365..8e71c28 100644 ---
> > > > > > a/drivers/staging/wilc1000/wilc_wlan.c +++
> > > > > > b/drivers/staging/wilc1000/wilc_wlan.c @@ -850,13 +850,13
> > > > > > @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc,
> > > > > > u32 int_status) if (wilc->rx_buffer) buffer =
> > > > > > &wilc->rx_buffer[offset]; else
> > > > > > - goto _end_;
> > > > > > + goto end;
> > > > >
> > > > > This isn't related to your patch but this goto doesn't appear
> > > > > to make any sort of sense. I have no idea what was intended.
> > > > >
> > > >
> > > > Thanks for pointing it out. I will include these changes in
> > > > separate patchset.
> > > >
> > > > Yes, the position of goto label can be moved just before
> > > > wilc_wlan_handle_rxq(wilc), as 'ret' will always be '0' when
> > > > goto statement is executed.
> > > >
> > > > Actually earlier there were few more goto statement in this
> > > > function and single label 'end' was used to handle for
> > > > different cases. But in previous cleanup patches those cases
> > > > were removed. Now this function can be further refactor by
> > > > either moving goto label before wilc_wlan_handle_rxq(wilc) or
> > > > avoid goto use by adding the rx_buffer validation along with
> > > > size check.
> > > >
> > > > i.e
> > > >
> > > > end:
> > > > wilc_wlan_handle_rxq(wilc)
> > > >
> > > >
> > > > OR
> > > >
> > > > if (size > 0 && wilc->rx_buffer) {
> > > >
> > > > ....
> > > > }
> > > > wilc_wlan_handle_rxq(wilc)
> > > >
> > >
> > > Actually looking at it now, you could probably just remove the if
> > > statement. Hopefully wilc->rx_buffer is non-NULL at this point?
> > > Is there really any need to call wilc_wlan_handle_rxq() when we
> > > haven't called wilc_wlan_rxq_add()?
> > >
> >
> > Yes, wilc->rx_buffer would be non NULL value as its only one time
> > allocated buffer. wilc_wlan_handle_rxq() was called without
> > wilc_wlan_rxq_add() just as a fail safe to ensure there are no
> > pending packets in the queue.
>
> The only thing is wilc->quit can be set. Otherwise if ->rx_buffer is
> NULL it would just result in a NULL dereference. (We are deep into
> hypotheticals here because we're discussing impossible code).
>
I have prepared a patch based on the feedback. The patch is submitted
in https://patchwork.kernel.org/patch/10551703/.
Regards,
Ajay
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-08-01 6:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 22:44 [PATCH 00/23] staging: wilc1000: cleanup patch to follow linux coding style Ajay Singh
2018-07-18 22:44 ` [PATCH 01/23] staging: wilc1000: remove unused enum declaration Ajay Singh
2018-07-18 22:44 ` [PATCH 02/23] staging: wilc1000: remove enum connect_status instead use ieee80211_statuscode Ajay Singh
2018-07-18 22:44 ` [PATCH 03/23] staging: wilc1000: remove extra enum defined for data rates Ajay Singh
2018-07-18 22:45 ` [PATCH 04/23] staging: wilc1000: remove extra enums defined for ieee80211_eid Ajay Singh
2018-07-18 22:45 ` [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name Ajay Singh
2018-07-19 9:27 ` Dan Carpenter
2018-07-19 23:05 ` Ajay Singh
2018-07-30 8:41 ` Dan Carpenter
2018-07-30 10:10 ` Ajay Singh
2018-07-30 11:32 ` Dan Carpenter
2018-08-01 5:16 ` Ajay Singh [this message]
2018-08-01 8:11 ` Dan Carpenter
2018-07-18 22:45 ` [PATCH 06/23] staging: wilc1000: rename enum CURRENT_TXRATE to use lowercase Ajay Singh
2018-07-18 22:45 ` [PATCH 07/23] staging: wilc1000: rename enum SITESURVEY " Ajay Singh
2018-07-18 22:45 ` [PATCH 08/23] staging: wilc1000: rename enum AUTHTYPE " Ajay Singh
2018-07-18 22:45 ` [PATCH 09/23] staging: wilc1000: remove unused elements in 'wilc' struct Ajay Singh
2018-07-18 22:45 ` [PATCH 10/23] staging: wilc1000: remove unnecessary elements from 'wilc_priv' struct Ajay Singh
2018-07-18 22:45 ` [PATCH 11/23] staging: wilc1000: removed unused element from wilc_cfg_frame struct Ajay Singh
2018-07-18 22:45 ` [PATCH 12/23] staging: wilc1000: remove the mutliple #define used for same macro Ajay Singh
2018-07-18 22:45 ` [PATCH 13/23] staging: wilc1000: use lowercase for 'IFC_UP' struct element name Ajay Singh
2018-07-18 22:45 ` [PATCH 14/23] staging: wilc1000: remove unnecessary blank line between variable declaration Ajay Singh
2018-07-18 22:45 ` [PATCH 15/23] staging: wilc1000: use single space before opening brances '{' Ajay Singh
2018-07-18 22:45 ` [PATCH 16/23] staging: wilc1000: remove unnecessary type used for wid id Ajay Singh
2018-07-18 22:45 ` [PATCH 17/23] staging: wilc1000: avoid forward declaration for handle_scan_done() Ajay Singh
2018-07-18 22:45 ` [PATCH 18/23] staging: wilc1000: avoid host_int_get_assoc_res_info() forward declaration Ajay Singh
2018-07-18 22:45 ` [PATCH 19/23] staging: wilc1000: avoid forward declaration of host_int_parse_join_bss_param() Ajay Singh
2018-07-18 22:45 ` [PATCH 20/23] staging: wilc1000: avoid setting default value for variable at declaration Ajay Singh
2018-07-18 22:45 ` [PATCH 21/23] staging: wilc1000: use 'int' inplace of 's32' date type Ajay Singh
2018-07-18 22:45 ` [PATCH 22/23] staging: wilc1000: remove unnecessary 'NULL' check from cfg80211_ops callbacks Ajay Singh
2018-07-18 22:45 ` [PATCH 23/23] staging: wilc1000: move variable assignment along with its declaration Ajay Singh
2018-07-19 8:36 ` [PATCH 00/23] staging: wilc1000: cleanup patch to follow linux coding style Claudiu Beznea
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=20180801104600.2716843b@ajaysk-VirtualBox \
--to=ajay.kathat@microchip.com \
--cc=adham.abozaeid@microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=venkateswara.kaja@microchip.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;
as well as URLs for NNTP newsgroup(s).