From patchwork Tue Nov 19 14:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 844273 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:8b:b0:382:43a8:7b94 with SMTP id m11csp1181577wrx; Tue, 19 Nov 2024 06:25:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXulMmrzxlilRRf9sj3q9g5R/Go9jpkm3X6YiYBt0ErUn5ivN3I1UyseUd87089GSlwTjHAJg==@linaro.org X-Google-Smtp-Source: AGHT+IF/GyAsusJDZ4rBONtsbH80KWgg9HqKpccPyDPZ0f7EhCIvYKkOZN1sSwGkM9MjylcKG+MV X-Received: by 2002:a05:622a:293:b0:460:9380:dabf with SMTP id d75a77b69052e-46363ebfdbfmr230621821cf.47.1732026317137; Tue, 19 Nov 2024 06:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732026317; cv=none; d=google.com; s=arc-20240605; b=JuiIvGOV2Efdkz7GJY5Op7CiS8wqIVh4O2sDdpAdWU+8n0oRj/Xf0QVcwECMlAwzJt roQAYa71QCvfVPjqIxHG6uXEix0XqPbH5dFxgP1C8Rf4HE5X8We5CSv4wB7jcRhCVy/E WA6gRP1w45upLGPdkzT4tMt72YBv7VYBi7QjYrLC1LnELqO53QpNBtEABx7JUEzMIwh1 ZcA61tO1oVQqQJpbP474BuQqo6zHTieo5ARXbfcza5LzmODYj+mQmJQ2K8pSnRReV2xO qZ9RyAvklK3TPs0OuYtqBzLuSBjU/OXhXMUFr7SFsQp5llm6ylaYuvwaJemUY25FQI0I PkwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HY8iA1JcrinboJKdqzd9q3NbVD25Sy0Ej7yrNivMt5k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=EBVxKlsnK45KxGA4ZLcnHapKhgOJMyRiqZk4lC5yuy3GA+294TfWbx7NgNb2XB5qVL GF5fsbsncnZBmobZ/KxY6LXteFAaGWQdBx/RzUxB7eOgfdSfaReW+cGKOWop4I0hPYHm 5JVRmB7GSx/fetTSBIJgFsjLAU1Z3EVCCm60koLW6pHSAfoHw8gb30Y2sq0ZO5XAoV2e NDCanTVZmmSYQWsgWv9TmT2Gvr4PklG1nD+DG4moojFh6gT/fsiQ5zW4ObQgrlZrVQ0k ZdVigx+ohqJSSLW/kIgb+d2ZfzbqTkrdyF9VyHpGkJHT9xFXdCdMCeq4J6YwwsCSBVTA QPnQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HHMfho9e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46392b9b027si22535731cf.67.2024.11.19.06.25.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Nov 2024 06:25:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HHMfho9e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDP8g-0005vX-FG; Tue, 19 Nov 2024 09:23:34 -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 1tDP8Z-0005pc-QX for qemu-devel@nongnu.org; Tue, 19 Nov 2024 09:23:27 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDP8X-0006CJ-JS for qemu-devel@nongnu.org; Tue, 19 Nov 2024 09:23:27 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-382442b7d9aso899235f8f.1 for ; Tue, 19 Nov 2024 06:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732026204; x=1732631004; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HY8iA1JcrinboJKdqzd9q3NbVD25Sy0Ej7yrNivMt5k=; b=HHMfho9esUe8CT0+P19NuGahjWwMZEgi6NHoJYyl/SVTguS0w1ulQIOLQAf0GI1Z7w FRdkclvJs4QJoz1Ax/7K4AoGwWErRYZPdrZIWll4Oq3CIJ2kLp2mrsjkqICQAp1mjHZr 0WlvczHRU/U0M3Z/WY6Ou2wUv0+9a3PI0z8kX3xlaJy3Zx+bSLr4SfnNTFHgJmfIrN0O U2F6Feq6xbvHPV3o9lqNAh9ZTuD+cHohF0qOpsZ2qQ5DEcigGgwQQrnR26xRAEYtHkRC H/rubweyJ+27SGziYj/kWIxmEVwpBQpjy8I+a8rH3T8X7zkphqtCh9AQNLECtUQYCOFf EwIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732026204; x=1732631004; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HY8iA1JcrinboJKdqzd9q3NbVD25Sy0Ej7yrNivMt5k=; b=sAeZenrdGytl3LJOm0W7nx052QGPjytNf8cqjXH0LqQsOpK9SNVD4g+y0++80uZEGc eP0Bif9mtqaQAAt3rVNcqmwDVc5BU/NQghWnFLxlbpCBk4URIueq+qwMIATvA8fH1rjq B1SNthu5QCcsDQe25+xcpFANBXkqEWHH3FQq82s/pdaEubfYrFL63zaawhSvbhQ8ZKBM iQ2MXPDrCPeGpx2XlXPAIluLW3dMgonLEUOckR0hi+xWho64DDESXjVIBsAK5AyHDO6j oNxGFI1BY+AwlbaHN1J9o+ifonczlr2M5aQCByGkVst8P6aL/d6+0UbtOVVPODB0F/eW l/xg== X-Gm-Message-State: AOJu0Yzh6Db/RXC1+zcQJmcOLiMBSdtApq9FWg4mAae0YzSnxJRrDf0J J3WBWcATEYk1rwMrtTk7c/GfP1U6d6Cvp+gV1+BUiQVcoFuIhAJbnnCdpcVPN8ZDvWFsX9hreh+ M X-Received: by 2002:a05:6000:381:b0:382:4f4e:1cb6 with SMTP id ffacd0b85a97d-3824f4e21c2mr1626634f8f.28.1732026203921; Tue, 19 Nov 2024 06:23:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432dac21a15sm193049985e9.38.2024.11.19.06.23.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 06:23:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/15] hw/net/rocker/rocker_of_dpa.c: Remove superfluous error check Date: Tue, 19 Nov 2024 14:23:08 +0000 Message-Id: <20241119142321.1853732-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241119142321.1853732-1-peter.maydell@linaro.org> References: <20241119142321.1853732-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Rodrigo Dias Correa 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án Tomko Message-id: 20241114075051.404284-1-r@drigo.nl Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/net/rocker/rocker_of_dpa.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c index 5e16056be66..3378f63110b 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; } -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 = FLOW_KEY_WIDTH(ip.tos); @@ -1669,8 +1669,6 @@ static int of_dpa_cmd_add_acl_ip(OfDpaFlowKey *key, OfDpaFlowKey *mask, mask->ip.tos |= rocker_tlv_get_u8(flow_tlvs[ROCKER_TLV_OF_DPA_IP_ECN_MASK]) << 6; } - - return ROCKER_OK; } 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, RockerTlv **flow_tlvs) ACL_MODE_ANY_VLAN, ACL_MODE_ANY_TENANT, } mode = ACL_MODE_UNKNOWN; - int err = ROCKER_OK; 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, RockerTlv **flow_tlvs) switch (ntohs(key->eth.type)) { case 0x0800: case 0x86dd: - err = of_dpa_cmd_add_acl_ip(key, mask, flow_tlvs); + of_dpa_cmd_add_acl_ip(key, mask, flow_tlvs); break; } - if (err) { - return err; - } - if (flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]) { action->write.group_id = rocker_tlv_get_le32(flow_tlvs[ROCKER_TLV_OF_DPA_GROUP_ID]);