From patchwork Thu Nov 2 12:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1858529 X-Patchwork-Delegate: dceara@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dPDDxpQG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SLkJ03Wnrz1yQq for ; Thu, 2 Nov 2023 23:50:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 51F734F00E; Thu, 2 Nov 2023 12:50:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 51F734F00E Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dPDDxpQG X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6VzcGgjXCQ4i; Thu, 2 Nov 2023 12:50:34 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9CF954EEEB; Thu, 2 Nov 2023 12:50:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9CF954EEEB Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79464C0039; Thu, 2 Nov 2023 12:50:33 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id DB4CAC0032 for ; Thu, 2 Nov 2023 12:50:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B6A624EEEB for ; Thu, 2 Nov 2023 12:50:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B6A624EEEB X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2lNPcQtnJINe for ; Thu, 2 Nov 2023 12:50:27 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9139B4EED8 for ; Thu, 2 Nov 2023 12:50:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9139B4EED8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698929426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LkZjgyCYS17WutBy43onPdCbh0t7M1pJfiq7qCOjMUc=; b=dPDDxpQGFmVgiNmux0c2ZWPVa9oM1DI1mrivPj1mACGUzZNxPSnojMxPKfr6qiLFdRO7Qq /V6ce0hkJlqu1XaaBtrRWAujxSD2zu4B5xKP8k1LZOnVsHOJ2oFUp80m+APx1z7ngqg7OU vZK4LIPCROPVKwvbzkGPxfj5zOBaZJ0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-ES4QQJPQNx2LsHrZrpeyWg-1; Thu, 02 Nov 2023 08:50:25 -0400 X-MC-Unique: ES4QQJPQNx2LsHrZrpeyWg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C6883C2864D for ; Thu, 2 Nov 2023 12:50:25 +0000 (UTC) Received: from amusil.. (unknown [10.34.130.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77A0D2026D4C; Thu, 2 Nov 2023 12:50:24 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Thu, 2 Nov 2023 13:50:23 +0100 Message-ID: <20231102125023.166612-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [PATCH ovn] treewide: Avoid empty initializer X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The empty initializer (" = {}") is allowed only from C23 and further [0]. Use the supported C99 compatible method instead ("= {0}"). This shouldn't case any trouble because both GCC and Clang generate the same instructions for either of the initializers. [0] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3054.pdf Signed-off-by: Ales Musil Reviewed-By: Ihar Hrachyshka --- controller/ovn-controller.c | 2 +- controller/pinctrl.c | 4 ++-- lib/actions.c | 6 +++--- northd/ovn-northd.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index da7d145ed..a15280cb5 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -4987,7 +4987,7 @@ int main(int argc, char *argv[]) { struct unixctl_server *unixctl; - struct ovn_exit_args exit_args = {}; + struct ovn_exit_args exit_args = {0}; int retval; /* Read from system-id-override file once on startup. */ diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 3c1cecfde..25b1f2933 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -1310,7 +1310,7 @@ fill_ipv6_prefix_state(struct ovsdb_idl_txn *ovnsb_idl_txn, pfd->prefix = in6addr_any; } } else if (pfd->state == PREFIX_PENDING && ovnsb_idl_txn) { - char prefix_str[INET6_ADDRSTRLEN + 1] = {}; + char prefix_str[INET6_ADDRSTRLEN + 1] = {0}; if (!ipv6_string_mapped(prefix_str, &pfd->prefix)) { goto out; } @@ -3788,7 +3788,7 @@ packet_put_ra_dnssl_opt(struct dp_packet *b, ovs_be32 lifetime, char *dnssl_data) { size_t prev_l4_size = dp_packet_l4_size(b); - char dnssl[255] = {}; + char dnssl[255] = {0}; int size; size = encode_ra_dnssl_opt(dnssl_data, dnssl, sizeof(dnssl)); diff --git a/lib/actions.c b/lib/actions.c index b880927b6..a73fe1a1e 100644 --- a/lib/actions.c +++ b/lib/actions.c @@ -3439,7 +3439,7 @@ encode_put_nd_ra_option(const struct ovnact_gen_option *o, case ND_OPT_DNSSL: { - char dnssl[255] = {}; + char dnssl[255] = {0}; int size; size = encode_ra_dnssl_opt(c->string, dnssl, sizeof(dnssl)); @@ -4938,7 +4938,7 @@ format_COMMIT_LB_AFF(const struct ovnact_commit_lb_aff *lb_aff, struct ds *s) bool ipv6 = !IN6_IS_ADDR_V4MAPPED(&lb_aff->vip); if (ipv6) { - char ip_str[INET6_ADDRSTRLEN] = {}; + char ip_str[INET6_ADDRSTRLEN] = {0}; inet_ntop(AF_INET6, &lb_aff->vip, ip_str, INET6_ADDRSTRLEN); ds_put_format(s, "commit_lb_aff(vip = \"[%s]", ip_str); } else { @@ -4953,7 +4953,7 @@ format_COMMIT_LB_AFF(const struct ovnact_commit_lb_aff *lb_aff, struct ds *s) ds_put_cstr(s, "\""); if (ipv6) { - char ip_str[INET6_ADDRSTRLEN] = {}; + char ip_str[INET6_ADDRSTRLEN] = {0}; inet_ntop(AF_INET6, &lb_aff->backend, ip_str, INET6_ADDRSTRLEN); ds_put_format(s, ", backend = \"[%s]", ip_str); } else { diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index b2ec67c06..3ce737821 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -751,7 +751,7 @@ main(int argc, char *argv[]) int res = EXIT_SUCCESS; struct unixctl_server *unixctl; int retval; - struct ovn_exit_args exit_args = {}; + struct ovn_exit_args exit_args = {0}; int n_threads = 1; struct northd_state state = { .had_lock = false, @@ -878,7 +878,7 @@ main(int argc, char *argv[]) run_update_worker_pool(n_threads); /* Main loop. */ - struct northd_engine_context eng_ctx = {}; + struct northd_engine_context eng_ctx = {0}; while (!exit_args.exiting) { update_ssl_config();