ieee802154: fix gcc-4.9 warnings

Message ID 20170912101636.3811626-1-arnd@arndb.de
State New
Headers show
Series
  • ieee802154: fix gcc-4.9 warnings
Related show

Commit Message

Arnd Bergmann Sept. 12, 2017, 10:16 a.m.
All older compiler versions up to gcc-4.9 produce these
harmless warnings:

drivers/net/ieee802154/ca8210.c: In function 'ca8210_skb_tx':
drivers/net/ieee802154/ca8210.c:1947:9: warning: missing braces around initializer [-Wmissing-braces]

This changes the syntax to something that works on all versions
without warnings.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/net/ieee802154/ca8210.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.0

Comments

Stefan Schmidt Sept. 12, 2017, 10:24 a.m. | #1
Hello.

On 09/12/2017 12:16 PM, Arnd Bergmann wrote:
> All older compiler versions up to gcc-4.9 produce these

> harmless warnings:

> 

> drivers/net/ieee802154/ca8210.c: In function 'ca8210_skb_tx':

> drivers/net/ieee802154/ca8210.c:1947:9: warning: missing braces around initializer [-Wmissing-braces]

> 

> This changes the syntax to something that works on all versions

> without warnings.

> 

> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>   drivers/net/ieee802154/ca8210.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c

> index 24a1eabbbc9d..e6b8ce81a6c3 100644

> --- a/drivers/net/ieee802154/ca8210.c

> +++ b/drivers/net/ieee802154/ca8210.c

> @@ -1944,7 +1944,7 @@ static int ca8210_skb_tx(

>   )

>   {

>   	int status;

> -	struct ieee802154_hdr header = { 0 };

> +	struct ieee802154_hdr header = { };

>   	struct secspec secspec;

>   	unsigned int mac_len;

>   



Acked-by: Stefan Schmidt <stefan@osg.samsung.com>


regards
Stefan Schmidt
Marcel Holtmann Sept. 12, 2017, 2:22 p.m. | #2
Hi Arnd,

> All older compiler versions up to gcc-4.9 produce these

> harmless warnings:

> 

> drivers/net/ieee802154/ca8210.c: In function 'ca8210_skb_tx':

> drivers/net/ieee802154/ca8210.c:1947:9: warning: missing braces around initializer [-Wmissing-braces]

> 

> This changes the syntax to something that works on all versions

> without warnings.

> 

> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

> drivers/net/ieee802154/ca8210.c | 2 +-

> 1 file changed, 1 insertion(+), 1 deletion(-)


patch has been applied to bluetooth-next tree.

Regards

Marcel

Patch

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 24a1eabbbc9d..e6b8ce81a6c3 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1944,7 +1944,7 @@  static int ca8210_skb_tx(
 )
 {
 	int status;
-	struct ieee802154_hdr header = { 0 };
+	struct ieee802154_hdr header = { };
 	struct secspec secspec;
 	unsigned int mac_len;