* [PATCH] staging: wilc1000: host_interface.c: Fix build warning
@ 2015-07-29 14:06 Chandra S Gorentla
2015-07-29 14:20 ` Dan Carpenter
2015-07-29 21:12 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Chandra S Gorentla @ 2015-07-29 14:06 UTC (permalink / raw)
To: johnny.kim, rachel.kim, dean.lee, chris.park, gregkh
Cc: linux-wireless, devel, linux-kernel, Chandra S Gorentla
Fixed - warning: ‘*((void *)&strHostIFmsg+4).pu8Head’ may be used uninitialized
Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index c089e73..f610903 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7113,7 +7113,7 @@ s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval,
{
s32 s32Error = WILC_SUCCESS;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
- tstrHostIFmsg strHostIFmsg;
+ tstrHostIFmsg strHostIFmsg = {};
tstrHostIFSetBeacon *pstrSetBeaconParam = &strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon;
if (pstrWFIDrv == NULL)
--
2.4.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: wilc1000: host_interface.c: Fix build warning
2015-07-29 14:06 [PATCH] staging: wilc1000: host_interface.c: Fix build warning Chandra S Gorentla
@ 2015-07-29 14:20 ` Dan Carpenter
2015-07-29 15:22 ` Chandra Gorentla
2015-07-29 21:12 ` Greg KH
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-07-29 14:20 UTC (permalink / raw)
To: Chandra S Gorentla
Cc: johnny.kim, rachel.kim, dean.lee, chris.park, gregkh, devel,
linux-wireless, linux-kernel
On Wed, Jul 29, 2015 at 07:36:59PM +0530, Chandra S Gorentla wrote:
> Fixed - warning: ‘*((void *)&strHostIFmsg+4).pu8Head’ may be used uninitialized
>
I can't reproduce this warning and the original code looks fine to me.
When you say the word "fix" it means the code is buggy. Otherwise we
are just silencing warnings or cleaning up code. It's not clear from
the patch description what is happening here, is it a bug or a warning
only?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: wilc1000: host_interface.c: Fix build warning
2015-07-29 14:20 ` Dan Carpenter
@ 2015-07-29 15:22 ` Chandra Gorentla
0 siblings, 0 replies; 4+ messages in thread
From: Chandra Gorentla @ 2015-07-29 15:22 UTC (permalink / raw)
To: Dan Carpenter
Cc: johnny.kim, rachel.kim, dean.lee, chris.park, gregkh,
linux-wireless, devel, linux-kernel
On Wed, Jul 29, 2015 at 05:20:37PM +0300, Dan Carpenter wrote:
> On Wed, Jul 29, 2015 at 07:36:59PM +0530, Chandra S Gorentla wrote:
> > Fixed - warning: ‘*((void *)&strHostIFmsg+4).pu8Head’ may be used uninitialized
> >
>
> I can't reproduce this warning and the original code looks fine to me.
>
> When you say the word "fix" it means the code is buggy. Otherwise we
> are just silencing warnings or cleaning up code. It's not clear from
> the patch description what is happening here, is it a bug or a warning
> only?
>
> regards,
> dan carpenter
>
Following is the build log -
----
gcs@gcs-HP-Compaq-nx6320:~/linux/git-linux$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- SUBFOLDER=drivers/staging/wilc1000/
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
CHK include/generated/compile.h
CHK kernel/config_data.h
CC [M] drivers/staging/wilc1000/host_interface.o
drivers/staging/wilc1000/host_interface.c: In function ‘host_int_add_beacon’:
drivers/staging/wilc1000/host_interface.c:7116:16: warning: ‘*((void *)&strHostIFmsg+4).pu8Head’ may be used uninitialized in this function [-Wuninitialized]
LD [M] drivers/staging/wilc1000/wilc1000.o
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 85 modules
CC drivers/staging/wilc1000/wilc1000.mod.o
LDFINAL [M] drivers/staging/wilc1000/wilc1000.ko
gcs@gcs-HP-Compaq-nx6320:~/linux/git-linux$
----
Proposed fix removes this warning.
Currently the 'wilc1000' driver in staging is marked as BROKEN in its
KConfig file at 'drivers/staging/wilc1000/'. I had to remove this line
to execute the above make command.
Thanks,
chandra
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: wilc1000: host_interface.c: Fix build warning
2015-07-29 14:06 [PATCH] staging: wilc1000: host_interface.c: Fix build warning Chandra S Gorentla
2015-07-29 14:20 ` Dan Carpenter
@ 2015-07-29 21:12 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-07-29 21:12 UTC (permalink / raw)
To: Chandra S Gorentla
Cc: johnny.kim, rachel.kim, dean.lee, chris.park, linux-wireless,
devel, linux-kernel
On Wed, Jul 29, 2015 at 07:36:59PM +0530, Chandra S Gorentla wrote:
> Fixed - warning: ‘*((void *)&strHostIFmsg+4).pu8Head’ may be used uninitialized
The warning is incorrect, look at the code, I don't see anything wrong
with it. I suggest upgrading to a newer version of gcc that doesn't
report incorrect things like this, gcc 5.2 works fine for me here.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-29 21:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29 14:06 [PATCH] staging: wilc1000: host_interface.c: Fix build warning Chandra S Gorentla
2015-07-29 14:20 ` Dan Carpenter
2015-07-29 15:22 ` Chandra Gorentla
2015-07-29 21:12 ` Greg KH
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).