From 701cb208fb160d2f14aff1b9cd425c481e2b003a Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 8 May 2014 11:37:34 +0200 Subject: [PATCH] am7xxx: don't use partial designated initializers Compilers may warn about missing fields in initializers when more checks are enabled with STRICT_COMPILATION_CHECKS=ON: .../src/am7xxx.c:1131:31: error: missing field 'direction' initializer [-Werror,-Wmissing-field-initializers] struct am7xxx_header h = { 0 }; ^ 1 error generated. --- src/am7xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/am7xxx.c b/src/am7xxx.c index ffdd59c..7122658 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -1128,7 +1128,7 @@ AM7XXX_PUBLIC int am7xxx_get_device_info(am7xxx_device *dev, am7xxx_device_info *device_info) { int ret; - struct am7xxx_header h = { 0 }; + struct am7xxx_header h; if (dev->device_info) { memcpy(device_info, dev->device_info, sizeof(*device_info)); @@ -1139,6 +1139,7 @@ AM7XXX_PUBLIC int am7xxx_get_device_info(am7xxx_device *dev, if (ret < 0) return ret; + memset(&h, 0, sizeof(h)); ret = read_header(dev, &h); if (ret < 0) return ret; -- 2.1.4