From nobody Sat Nov 23 17:00:06 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=1731570725; cv=none; d=zohomail.com; s=zohoarc; b=ara9avqu8qMmmOEyI/kko3R4zmjKRefSj5iyrgbVQSRA8DWckCsdY2UayQtQ88dPrzK0qJEm4xjZOvZYDfiaTGc3FBTXsEXyTR0VkxGx5ptZujfrFtqtbpbQU+Yt9Jtvx6BHx7EL02n09aL+LL1YLFCSpo3MSfOpD8rn7CVLouc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731570725; h=Content-Type: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=n0iFUy/NdvkPBD+EsAMfR1bi4Xv41RHEHyWU8FzvQdM=; b=DbINYfoVk1TPUTIV77GNoWolhFAbhG+q3AiMLYZyct9HuWvJOXPPDSPKMVLJVDLHq9QdWPjo3TGGSgQR+Y/QOvZRBda/Gn8CwGRuC5jkORU9T8Qk3XFN9xjbQPeVTazySBUh9zoNuaMDNh07Jz/dddROTsqbR7EKDUg/vRddjok= 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 1731570725151854.4688747621574; Wed, 13 Nov 2024 23:52:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBUdK-000424-LU; Thu, 14 Nov 2024 02:51:18 -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 1tBUdI-00041t-Hy for qemu-devel@nongnu.org; Thu, 14 Nov 2024 02:51:16 -0500 Received: from smtp-8fa9.mail.infomaniak.ch ([2001:1600:7:10::8fa9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBUdF-0006sb-OJ for qemu-devel@nongnu.org; Thu, 14 Nov 2024 02:51:16 -0500 Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Xpslm2dKGzXtK; Thu, 14 Nov 2024 08:51:00 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Xpsll2TrpzsT0; Thu, 14 Nov 2024 08:50:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=drigo.nl; s=20241108; t=1731570660; bh=n0iFUy/NdvkPBD+EsAMfR1bi4Xv41RHEHyWU8FzvQdM=; h=From:To:Cc:Subject:Date:From; b=LcolhpcA6fusY5IaRihFOu/gnWyVXiPKeh9yVu6SpC+zBRMweyTtmM+Ch0HdB1QzZ DvRVptQGUM2IoOs8CdcqWJlOQGR3MjtnCBr3dRngJZip08xqhQ0Jsp5m5aNsl+FdGK eZR2vHTBOsLqblUst/iXoWKztg44AkJLfJ09Fzqw1utgQzeFSvE/De3+gcJ2O4/69G U+zjmx2S8/MeiZ/4G+gxW/KnuTDyBdUHpy59SCxbMLgdWZNAaoeUj5tGrH0AkopY/E zWBIt2sPniLU/YkWk9YqX+iBJYyOZ0cD23U6SyzLxWTJwQ0v+y9jHP7vXOsD7KQVSb na0x1rpOD4IhQ== From: Rodrigo Dias Correa To: qemu-devel@nongnu.org Cc: jiri@resnulli.us, jasowang@redhat.com, jtomko@redhat.com Subject: [PATCH v2] hw/net/rocker/rocker_of_dpa.c: Remove superfluous error check Date: Thu, 14 Nov 2024 08:50:51 +0100 Message-Id: <20241114075051.404284-1-r@drigo.nl> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2001:1600:7:10::8fa9; envelope-from=r@drigo.nl; helo=smtp-8fa9.mail.infomaniak.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1731570727815116600 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 | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) changelog: v2: fixed misaligned line diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c index 5e16056be6..3378f63110 100644 --- a/hw/net/rocker/rocker_of_dpa.c +++ b/hw/net/rocker/rocker_of_dpa.c @@ -1635,8 +1635,8 @@ 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, - RockerTlv **flow_tlvs) +static void of_dpa_cmd_add_acl_ip(OfDpaFlowKey *key, OfDpaFlowKey *mask, + RockerTlv **flow_tlvs) { key->width =3D FLOW_KEY_WIDTH(ip.tos); =20 @@ -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