From patchwork Mon Oct 23 14:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1853785 X-Patchwork-Delegate: horms@verge.net.au 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=YpZsjUbN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::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 4SDcpd1DJFz23jn for ; Tue, 24 Oct 2023 01:22:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7540B421BC; Mon, 23 Oct 2023 14:22:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7540B421BC 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=YpZsjUbN 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 iG3nfDXrcTIR; Mon, 23 Oct 2023 14:22:29 +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 7BCA242157; Mon, 23 Oct 2023 14:22:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7BCA242157 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5F3EEC0071; Mon, 23 Oct 2023 14:22:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 29419C0032 for ; Mon, 23 Oct 2023 14:22:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 36D59610F5 for ; Mon, 23 Oct 2023 14:22:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 36D59610F5 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YpZsjUbN X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id plAlFwoOH1aj for ; Mon, 23 Oct 2023 14:22:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8102A611B2 for ; Mon, 23 Oct 2023 14:22:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8102A611B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698070943; 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: in-reply-to:in-reply-to:references:references; bh=di/vLoePwKdTPoDQnXHFhp5JfuarNkKMmYh5hynMD74=; b=YpZsjUbNaEQM7v8YjtbfdBWcWhV26Asm/AFQ/8ccX0QcpYBgi+zyp6JJhZxxYsZmVh4hQb VSrPR78QJK+FfGrDLBwoh4O4nFNudyO93vD62HGb6zW48PyGz3HgiGY6zR5CTU4dpHOGBn Zdy5Q4eYmf9ugf6KuTyYziIG172f2VQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-226-hVvfpnODOLy-ELMYspafxw-1; Mon, 23 Oct 2023 10:22:20 -0400 X-MC-Unique: hVvfpnODOLy-ELMYspafxw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0302185A7AA; Mon, 23 Oct 2023 14:22:19 +0000 (UTC) Received: from ebuild.redhat.com (unknown [10.39.195.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 180118CEF; Mon, 23 Oct 2023 14:22:18 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Mon, 23 Oct 2023 16:22:16 +0200 Message-ID: <169807093673.1031379.2520647757996269696.stgit@ebuild> In-Reply-To: <169807091380.1031379.16553136292085455374.stgit@ebuild> References: <169807091380.1031379.16553136292085455374.stgit@ebuild> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH v2 1/5] general: Fix Clang's static analyzer 'Dead initialization' warnings. 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" Acked-by: Simon Horman Signed-off-by: Eelco Chaudron --- lib/meta-flow.c | 4 ++-- lib/ofp-actions.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/meta-flow.c b/lib/meta-flow.c index 474344194..aa7cf1fcb 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -2751,8 +2751,8 @@ static char * mf_from_integer_string(const struct mf_field *mf, const char *s, uint8_t *valuep, uint8_t *maskp) { + const char *err_str; char *tail; - const char *err_str = ""; int err; err = parse_int_string(s, valuep, mf->n_bytes, &tail); @@ -2785,8 +2785,8 @@ syntax_error: static char * mf_from_packet_type_string(const char *s, ovs_be32 *packet_type) { + const char *err_str; char *tail; - const char *err_str = ""; int err; if (*s != '(') { diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index d7e5f542a..da7b1dd31 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -4230,10 +4230,12 @@ encode_DELETE_FIELD(const struct ofpact_delete_field *delete_field, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { - struct nx_action_delete_field *nadf = put_NXAST_DELETE_FIELD(out); - size_t size = out->size; + size_t size; - out->size = size - sizeof nadf->pad; + put_NXAST_DELETE_FIELD(out); + size = out->size; + + out->size = size - MEMBER_SIZEOF(struct nx_action_delete_field, pad); nx_put_mff_header(out, delete_field->field, 0, false); out->size = size; }