提交 62f2aaab 编写于 作者: S Sudip Mukherjee 提交者: David S. Miller

defxx: fix build warning

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: NSudip Mukherjee <sudip@vectorindia.org>
Acked-by: NMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 36df7455
...@@ -533,8 +533,8 @@ static int dfx_register(struct device *bdev) ...@@ -533,8 +533,8 @@ static int dfx_register(struct device *bdev)
const char *print_name = dev_name(bdev); const char *print_name = dev_name(bdev);
struct net_device *dev; struct net_device *dev;
DFX_board_t *bp; /* board pointer */ DFX_board_t *bp; /* board pointer */
resource_size_t bar_start[3]; /* pointers to ports */ resource_size_t bar_start[3] = {0}; /* pointers to ports */
resource_size_t bar_len[3]; /* resource length */ resource_size_t bar_len[3] = {0}; /* resource length */
int alloc_size; /* total buffer size used */ int alloc_size; /* total buffer size used */
struct resource *region; struct resource *region;
int err = 0; int err = 0;
...@@ -3697,8 +3697,8 @@ static void dfx_unregister(struct device *bdev) ...@@ -3697,8 +3697,8 @@ static void dfx_unregister(struct device *bdev)
int dfx_bus_pci = dev_is_pci(bdev); int dfx_bus_pci = dev_is_pci(bdev);
int dfx_bus_tc = DFX_BUS_TC(bdev); int dfx_bus_tc = DFX_BUS_TC(bdev);
int dfx_use_mmio = DFX_MMIO || dfx_bus_tc; int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
resource_size_t bar_start[3]; /* pointers to ports */ resource_size_t bar_start[3] = {0}; /* pointers to ports */
resource_size_t bar_len[3]; /* resource lengths */ resource_size_t bar_len[3] = {0}; /* resource lengths */
int alloc_size; /* total buffer size used */ int alloc_size; /* total buffer size used */
unregister_netdev(dev); unregister_netdev(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册