From nobody Sat Nov 23 20:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=drigo.nl ARC-Seal: i=1; a=rsa-sha256; t=1731374826; cv=none; d=zohomail.com; s=zohoarc; b=KUrV0z71XdKwb8bxINk3nOZCs9McTmy/cTlgdixXvR/CHgOIn9Ctg5RjGPFIhIfszH8H7gjTouTdTH32ribo2TUU3pquIsdSELZYeMuHlsYlYSr/ZYKaZSDKweo0OYb6IkA08azgkpgvflE0UXbfXkDc7YMaVGIbystSQZPr700= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731374826; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vxk8AH3+BziTGfdR2L2xcNSCPa/LHx//KA7VWVgbqnk=; b=EnqBT8kIoOJN4JeOMXJi8k8uE22bYnkSp8kg4TRsqwOrh01gjo2Sp7cDXCLwKi2eWyW/UCIvhwGtRFfQ5VvGat1oILYLy34WtlO1/IEY01z5yi94e3JRx67FIb08ekXLbSy9B/rUON0EU4tXlTOmAfoZfqAQ1XKgEX3YPMY68UU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731374826212954.9223268714588; Mon, 11 Nov 2024 17:27:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAffk-0001N3-Jc; Mon, 11 Nov 2024 20:26:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAffj-0001Mu-ID for qemu-devel@nongnu.org; Mon, 11 Nov 2024 20:26:23 -0500 Received: from smtp-bc08.mail.infomaniak.ch ([45.157.188.8]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAffh-0007T1-MG for qemu-devel@nongnu.org; Mon, 11 Nov 2024 20:26:23 -0500 Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4XnTJq5XbxzdgZ; Tue, 12 Nov 2024 02:26:19 +0100 (CET) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4XnTJq0qKszlJ2; Tue, 12 Nov 2024 02:26:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=drigo.nl; s=20241108; t=1731374779; bh=vxk8AH3+BziTGfdR2L2xcNSCPa/LHx//KA7VWVgbqnk=; h=From:To:Cc:Subject:Date:From; b=ixz6rZRo+N91Y2F5ki6XUG0PSD0aGqEAeU5SwZVxL5CP4LbdWES7uc5SX4kAb12tj pSY7XcKNfiyLvhxiBb1++dm9KtXq6QZDTJ+tXKHzuenOl6qepx7Z7IYhYPrjRe27un ZnAnTcvNzR11tdP07sbW6wM74NsvcdZKEHI2F1y++sLX09hMWOh74Hrs4fhnzVuild msQx5he+cDDcxCOaerTejUyYKNOTERDShkyQlsSn/R7Wk4JpNbDwlzk0lScccXBZ6o Hddp9Rm8L7tabQ0wspj/eL/qjL70n8PIV1aO19ANvxtwjGf14J80x9KKyFxCibGNNz Vp/tuwClrUeCg== From: Rodrigo Dias Correa To: qemu-devel@nongnu.org Cc: jiri@resnulli.us, jasowang@redhat.com Subject: [PATCH] hw/net/rocker/rocker_of_dpa.c: Remove superfluous error check Date: Tue, 12 Nov 2024 02:26:12 +0100 Message-Id: <20241112012612.317020-1-r@drigo.nl> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Infomaniak-Routing: alpha Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.157.188.8; envelope-from=r@drigo.nl; helo=smtp-bc08.mail.infomaniak.ch X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.671, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @drigo.nl) X-ZM-MESSAGEID: 1731374828676116600 Content-Type: text/plain; charset="utf-8" of_dpa_cmd_add_acl_ip() is called from a single place, and despite the fact that it always returns ROCKER_OK, its return value is still checked by the caller. Change of_dpa_cmd_add_acl_ip() to return void and remove the superfluous check from of_dpa_cmd_add_acl(). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2471 Signed-off-by: Rodrigo Dias Correa Reviewed-by: J=C3=A1n Tomko --- hw/net/rocker/rocker_of_dpa.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c index 5e16056be6..6d29130ec2 100644 --- a/hw/net/rocker/rocker_of_dpa.c +++ b/hw/net/rocker/rocker_of_dpa.c @@ -1635,7 +1635,7 @@ static int of_dpa_cmd_add_multicast_routing(OfDpaFlow= *flow, return ROCKER_OK; } =20 -static int of_dpa_cmd_add_acl_ip(OfDpaFlowKey *key, OfDpaFlowKey *mask, +static void of_dpa_cmd_add_acl_ip(OfDpaFlowKey *key, OfDpaFlowKey *mask, RockerTlv **flow_tlvs) { key->width =3D FLOW_KEY_WIDTH(ip.tos); @@ -1669,8 +1669,6 @@ static int of_dpa_cmd_add_acl_ip(OfDpaFlowKey *key, O= fDpaFlowKey *mask, mask->ip.tos |=3D rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN_MASK]) <<= 6; } - - return ROCKER_OK; } =20 static int of_dpa_cmd_add_acl(OfDpaFlow *flow, RockerTlv **flow_tlvs) @@ -1689,7 +1687,6 @@ static int of_dpa_cmd_add_acl(OfDpaFlow *flow, Rocker= Tlv **flow_tlvs) ACL_MODE_ANY_VLAN, ACL_MODE_ANY_TENANT, } mode =3D ACL_MODE_UNKNOWN; - int err =3D ROCKER_OK; =20 if (!flow_tlvs[ROCKER_TLV_OF_DPA_IN_PPORT] || !flow_tlvs[ROCKER_TLV_OF_DPA_ETHERTYPE]) { @@ -1776,14 +1773,10 @@ static int of_dpa_cmd_add_acl(OfDpaFlow *flow, Rock= erTlv **flow_tlvs) switch (ntohs(key->eth.type)) { case 0x0800: case 0x86dd: - err =3D of_dpa_cmd_add_acl_ip(key, mask, flow_tlvs); + of_dpa_cmd_add_acl_ip(key, mask, flow_tlvs); break; } =20 - if (err) { - return err; - } - if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { action->write.group_id =3D rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]); --=20 2.34.1