* [PATCH v2] defxx: fix build warning
@ 2016-01-25 7:35 Sudip Mukherjee
2016-01-25 15:26 ` Maciej W. Rozycki
2016-01-25 18:52 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2016-01-25 7:35 UTC (permalink / raw)
To: David S. Miller, Maciej W. Rozycki; +Cc: linux-kernel, netdev, Sudip Mukherjee
We are getting many build warnings about:
'bar_start' may be used uninitialized
and
'bar_len' may be used uninitialized
They are not actually uninitialized as dfx_get_bars() will initialize
them properly. But still lets have them initialized just to satisfy the
compiler (gcc 4.8.2).
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
v2: only the first element is zeroed.
drivers/net/fddi/defxx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 7f975a2..de5eaa6 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -533,8 +533,8 @@ static int dfx_register(struct device *bdev)
const char *print_name = dev_name(bdev);
struct net_device *dev;
DFX_board_t *bp; /* board pointer */
- resource_size_t bar_start[3]; /* pointers to ports */
- resource_size_t bar_len[3]; /* resource length */
+ resource_size_t bar_start[3] = {0}; /* pointers to ports */
+ resource_size_t bar_len[3] = {0}; /* resource length */
int alloc_size; /* total buffer size used */
struct resource *region;
int err = 0;
@@ -3697,8 +3697,8 @@ static void dfx_unregister(struct device *bdev)
int dfx_bus_pci = dev_is_pci(bdev);
int dfx_bus_tc = DFX_BUS_TC(bdev);
int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
- resource_size_t bar_start[3]; /* pointers to ports */
- resource_size_t bar_len[3]; /* resource lengths */
+ resource_size_t bar_start[3] = {0}; /* pointers to ports */
+ resource_size_t bar_len[3] = {0}; /* resource lengths */
int alloc_size; /* total buffer size used */
unregister_netdev(dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] defxx: fix build warning
2016-01-25 7:35 [PATCH v2] defxx: fix build warning Sudip Mukherjee
@ 2016-01-25 15:26 ` Maciej W. Rozycki
2016-01-25 18:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2016-01-25 15:26 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: David S. Miller, linux-kernel, netdev
On Mon, 25 Jan 2016, Sudip Mukherjee wrote:
> We are getting many build warnings about:
> 'bar_start' may be used uninitialized
> and
> 'bar_len' may be used uninitialized
>
> They are not actually uninitialized as dfx_get_bars() will initialize
> them properly. But still lets have them initialized just to satisfy the
> compiler (gcc 4.8.2).
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Thanks,
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] defxx: fix build warning
2016-01-25 7:35 [PATCH v2] defxx: fix build warning Sudip Mukherjee
2016-01-25 15:26 ` Maciej W. Rozycki
@ 2016-01-25 18:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-01-25 18:52 UTC (permalink / raw)
To: sudipm.mukherjee; +Cc: macro, linux-kernel, netdev
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Mon, 25 Jan 2016 13:05:20 +0530
> We are getting many build warnings about:
> 'bar_start' may be used uninitialized
> and
> 'bar_len' may be used uninitialized
>
> They are not actually uninitialized as dfx_get_bars() will initialize
> them properly. But still lets have them initialized just to satisfy the
> compiler (gcc 4.8.2).
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-25 18:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 7:35 [PATCH v2] defxx: fix build warning Sudip Mukherjee
2016-01-25 15:26 ` Maciej W. Rozycki
2016-01-25 18:52 ` David Miller
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).