* [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
@ 2015-09-15 9:34 Ronit Halder
2015-09-15 9:38 ` [PATCH 2/2] Staging: wilc1000: fix NULL comparison style Ronit Halder
2015-09-15 13:54 ` [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH
0 siblings, 2 replies; 9+ messages in thread
From: Ronit Halder @ 2015-09-15 9:34 UTC (permalink / raw)
To: johnny.kim
Cc: rachel.kim, chris.park, tony.cho, glen.lee, leo.kim, gregkh,
linux-wireless, devel, linux-kernel, Ronit Halder
This patch fixes the warning generated by sparse
"Using plain integer as NULL pointer" by using NULL
instead of zero.
Signed-off-by: Ronit halder <ronit.crj@gmail.com>
---
v2: added a new patch in this patch series to fix the NULL comparison style
drivers/staging/wilc1000/coreconfigurator.c | 14 +++++++-------
drivers/staging/wilc1000/linux_wlan.c | 6 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 544c12d..8164a33 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -525,7 +525,7 @@ u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset)
u16index += (IE_HDR_LEN + pu8msa[u16index + 1]);
}
- return 0;
+ return NULL;
}
/* This function gets the current channel information from
@@ -587,7 +587,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
u16 u16WidID = (u16)WID_NIL;
u16 u16WidLen = 0;
- u8 *pu8WidVal = 0;
+ u8 *pu8WidVal = NULL;
u8MsgType = pu8MsgBuffer[0];
@@ -614,10 +614,10 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
/* parse the WID value of the WID "WID_NEWORK_INFO" */
{
- u8 *pu8msa = 0;
+ u8 *pu8msa = NULL;
u16 u16RxLen = 0;
- u8 *pu8TimElm = 0;
- u8 *pu8IEs = 0;
+ u8 *pu8TimElm = NULL;
+ u8 *pu8IEs = NULL;
u16 u16IEsLen = 0;
u8 u8index = 0;
u32 u32Tsf_Lo;
@@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
/* Get DTIM Period */
pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index);
- if (pu8TimElm != 0)
+ if (pu8TimElm != NULL)
pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3];
pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);
@@ -743,7 +743,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
s32 s32Error = WILC_SUCCESS;
tstrConnectRespInfo *pstrConnectRespInfo = NULL;
u16 u16AssocRespLen = 0;
- u8 *pu8IEs = 0;
+ u8 *pu8IEs = NULL;
u16 u16IEsLen = 0;
pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 63f44f8..d8f17c6 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp)
break;
}
PRINT_D(INT_DBG, "Interrupt received BH\n");
- if (g_linux_wlan->oup.wlan_handle_rx_isr != 0)
+ if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL)
g_linux_wlan->oup.wlan_handle_rx_isr();
else
PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
@@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
#elif (RX_BH_TYPE == RX_BH_KTHREAD)
PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n");
g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH");
- if (g_linux_wlan->rx_bh_thread == 0) {
+ if (g_linux_wlan->rx_bh_thread == NULL) {
PRINT_ER("couldn't create RX BH thread\n");
ret = -ENOBUFS;
goto _fail_;
@@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
/* create tx task */
PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK");
- if (g_linux_wlan->txq_thread == 0) {
+ if (g_linux_wlan->txq_thread == NULL) {
PRINT_ER("couldn't create TXQ thread\n");
ret = -ENOBUFS;
goto _fail_2;
--
2.4.0.GIT
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] Staging: wilc1000: fix NULL comparison style
2015-09-15 9:34 [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder
@ 2015-09-15 9:38 ` Ronit Halder
2015-09-15 13:54 ` [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH
1 sibling, 0 replies; 9+ messages in thread
From: Ronit Halder @ 2015-09-15 9:38 UTC (permalink / raw)
To: johnny.kim
Cc: rachel.kim, chris.park, tony.cho, glen.lee, leo.kim, gregkh,
linux-wireless, devel, linux-kernel, Ronit Halder
Fixed NULL comparison style as suggested by checkpatch.pl with --strict option.
Signed-off-by: Ronit halder <ronit.crj@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/linux_wlan.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 8164a33..872400a 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -670,7 +670,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
/* Get DTIM Period */
pu8TimElm = get_tim_elm(pu8msa, (u16RxLen + FCS_LEN), u8index);
- if (pu8TimElm != NULL)
+ if (pu8TimElm)
pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3];
pu8IEs = &pu8msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN];
u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN);
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index d8f17c6..d2b0ce6 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -412,7 +412,7 @@ static int isr_bh_routine(void *vp)
break;
}
PRINT_D(INT_DBG, "Interrupt received BH\n");
- if (g_linux_wlan->oup.wlan_handle_rx_isr != NULL)
+ if (g_linux_wlan->oup.wlan_handle_rx_isr)
g_linux_wlan->oup.wlan_handle_rx_isr();
else
PRINT_ER("wlan_handle_rx_isr() hasn't been initialized\n");
@@ -1284,7 +1284,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
#elif (RX_BH_TYPE == RX_BH_KTHREAD)
PRINT_D(INIT_DBG, "Creating kthread for Rxq BH\n");
g_linux_wlan->rx_bh_thread = kthread_run(isr_bh_routine, (void *)g_linux_wlan, "K_RXQ_BH");
- if (g_linux_wlan->rx_bh_thread == NULL) {
+ if (!g_linux_wlan->rx_bh_thread) {
PRINT_ER("couldn't create RX BH thread\n");
ret = -ENOBUFS;
goto _fail_;
@@ -1309,7 +1309,7 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
/* create tx task */
PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK");
- if (g_linux_wlan->txq_thread == NULL) {
+ if (!g_linux_wlan->txq_thread) {
PRINT_ER("couldn't create TXQ thread\n");
ret = -ENOBUFS;
goto _fail_2;
--
2.4.0.GIT
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-15 9:34 [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder
2015-09-15 9:38 ` [PATCH 2/2] Staging: wilc1000: fix NULL comparison style Ronit Halder
@ 2015-09-15 13:54 ` Greg KH
2015-09-17 1:43 ` Ronit Halder
1 sibling, 1 reply; 9+ messages in thread
From: Greg KH @ 2015-09-15 13:54 UTC (permalink / raw)
To: Ronit Halder
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
On Tue, Sep 15, 2015 at 03:04:58PM +0530, Ronit Halder wrote:
> This patch fixes the warning generated by sparse
> "Using plain integer as NULL pointer" by using NULL
> instead of zero.
>
> Signed-off-by: Ronit halder <ronit.crj@gmail.com>
> ---
>
> v2: added a new patch in this patch series to fix the NULL comparison style
This patch, and the second one, do not apply to my tree anymore :(
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-15 13:54 ` [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH
@ 2015-09-17 1:43 ` Ronit Halder
2015-09-17 2:22 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Ronit Halder @ 2015-09-17 1:43 UTC (permalink / raw)
To: Greg KH
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
Why not the second one?
None of the line edited in first patch haven't changed after that.
On Tue, Sep 15, 2015 at 7:24 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Sep 15, 2015 at 03:04:58PM +0530, Ronit Halder wrote:
>> This patch fixes the warning generated by sparse
>> "Using plain integer as NULL pointer" by using NULL
>> instead of zero.
>>
>> Signed-off-by: Ronit halder <ronit.crj@gmail.com>
>> ---
>>
>> v2: added a new patch in this patch series to fix the NULL comparison style
>
> This patch, and the second one, do not apply to my tree anymore :(
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-17 1:43 ` Ronit Halder
@ 2015-09-17 2:22 ` Greg KH
2015-09-17 2:58 ` roni
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2015-09-17 2:22 UTC (permalink / raw)
To: Ronit Halder
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Thu, Sep 17, 2015 at 07:13:39AM +0530, Ronit Halder wrote:
> Why not the second one?
Second what?
> None of the line edited in first patch haven't changed after that.
I don't understand what you are asking here :(
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-17 2:22 ` Greg KH
@ 2015-09-17 2:58 ` roni
2015-09-17 3:15 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: roni @ 2015-09-17 2:58 UTC (permalink / raw)
To: Greg KH
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
Sorry for the ambiguity.
I am talking about my second patch in the series.
https://lkml.org/lkml/2015/9/15/293
> > None of the line edited in first patch haven't changed after that.
You applied the version 1 of the first patch in the series
https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527
Since then those lines I changed in the patch mentioned above haven't
changed.
Why my second patch in this series doesn't apply?
regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-17 2:58 ` roni
@ 2015-09-17 3:15 ` Greg KH
2015-09-17 3:39 ` Ronit Halder
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2015-09-17 3:15 UTC (permalink / raw)
To: roni
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:
> Sorry for the ambiguity.
> I am talking about my second patch in the series.
> https://lkml.org/lkml/2015/9/15/293
>
> > > None of the line edited in first patch haven't changed after that.
>
> You applied the version 1 of the first patch in the series
> https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527
>
> Since then those lines I changed in the patch mentioned above haven't
> changed.
>
> Why my second patch in this series doesn't apply?
I don't remember, that was many hundreds of patches ago, sorry. Try it
yourself to see if I messed up. Perhaps someone else had already sent
in that same change before you did?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-17 3:15 ` Greg KH
@ 2015-09-17 3:39 ` Ronit Halder
2015-09-17 6:53 ` Sudip Mukherjee
0 siblings, 1 reply; 9+ messages in thread
From: Ronit Halder @ 2015-09-17 3:39 UTC (permalink / raw)
To: Greg KH
Cc: johnny.kim, rachel.kim, linux-wireless, chris.park, devel,
linux-kernel, tony.cho, leo.kim
On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote:
> On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:
> > Sorry for the ambiguity.
> > I am talking about my second patch in the series.
> > https://lkml.org/lkml/2015/9/15/293
> >
> > > > None of the line edited in first patch haven't changed after that.
> >
> > You applied the version 1 of the first patch in the series
> > https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527
> >
> > Since then those lines I changed in the patch mentioned above haven't
> > changed.
> >
> > Why my second patch in this series doesn't apply?
>
> I don't remember, that was many hundreds of patches ago, sorry. Try it
> yourself to see if I messed up. Perhaps someone else had already sent
> in that same change before you did?
git-apply shows no error if I apply second patch on
staging/staging-testing.
regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero
2015-09-17 3:39 ` Ronit Halder
@ 2015-09-17 6:53 ` Sudip Mukherjee
0 siblings, 0 replies; 9+ messages in thread
From: Sudip Mukherjee @ 2015-09-17 6:53 UTC (permalink / raw)
To: Ronit Halder
Cc: Greg KH, rachel.kim, devel, chris.park, linux-wireless,
johnny.kim, linux-kernel, tony.cho, leo.kim
On Thu, Sep 17, 2015 at 09:09:35AM +0530, Ronit Halder wrote:
> On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote:
> > On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:
<snip>
> >
> > I don't remember, that was many hundreds of patches ago, sorry. Try it
> > yourself to see if I messed up. Perhaps someone else had already sent
> > in that same change before you did?
>
> git-apply shows no error if I apply second patch on
> staging/staging-testing.
If you think your patch still applies properly then please resend it.
regards
sudip
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-09-17 6:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 9:34 [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Ronit Halder
2015-09-15 9:38 ` [PATCH 2/2] Staging: wilc1000: fix NULL comparison style Ronit Halder
2015-09-15 13:54 ` [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero Greg KH
2015-09-17 1:43 ` Ronit Halder
2015-09-17 2:22 ` Greg KH
2015-09-17 2:58 ` roni
2015-09-17 3:15 ` Greg KH
2015-09-17 3:39 ` Ronit Halder
2015-09-17 6:53 ` Sudip Mukherjee
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).