From patchwork Wed Feb 23 14:00:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1596701 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=KbPrqIz6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K3d4x5fjqz9sG7 for ; Thu, 24 Feb 2022 01:01:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 687AF83C97; Wed, 23 Feb 2022 15:01:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="KbPrqIz6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 95CF983BA2; Wed, 23 Feb 2022 15:01:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EA95683B58 for ; Wed, 23 Feb 2022 15:01:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x52d.google.com with SMTP id q17so44592266edd.4 for ; Wed, 23 Feb 2022 06:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jQEMABl5/rciOmBNg8p1ply1SatAGS3nx3m0dUtUTOU=; b=KbPrqIz6tSQEqeZyMY+H6t7fukQahZnpPL/drtZ8zqo+jlcPlnb9vFEgHZGOm5ytkj rALpCVNHjG6b7M19FQd7GOTqzlyxAFVL8l/BDJNhQscYTfcitfX7Pa8/YhYTJ59DXeD3 hZKDCeUPN4CJgtKfjFE3y9GPvvjf4nQWVmb3l8bzhs5+6FB51aTyN+xrwIkY1/jH3uzw hT1X+F/YZdy6iTX88b2eubF2whZdFUBFcSnuC7Uy2AWO9m6yqX98+3ivUnsmiBYGSnGh kNAp7+LVeHds71l1+UAz6yQ//2I21zEDf2k9Nj8CvZu0mnJ6Fr4evMLi/GInapMGTaML pwrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jQEMABl5/rciOmBNg8p1ply1SatAGS3nx3m0dUtUTOU=; b=k7GWzt5Au66m4fwkxtVdC8GOKICNcYQRFBV0uGwWRnp3XuXw7p3FxmioVQr0zkp1xl laUexhupCGssLawnNEGVGsOOWGGd7BWqSQSyVpl36nyOENjtBvCGWa4aZqCRRN7amiRY VSyzVAG0Yw0mwqYEqs+iWBJmassHj9XM9nKEN2dZf+vEJU1O5tq6GYkHRRaXrBICkciu 1exXF/bBQWF3MHryvT3wexj6UuEMNW2LsRZjgd+QBAWJXHWnPvjEPRqEtgqf4ekhJBfT E2SLmucRCaNmzDutEu7Ua5QiO5almh1niS5PKdWrmSaxzrd1tWfWe/ytDrMaWpIJj1yY N4PQ== X-Gm-Message-State: AOAM531FaMHl21yUd17vv+EbxdTABTQ8BRLANpzSuThz7Uo08Fvw1SQN B21wvHXEu7jlmod3oJAEND7flHE0N/0KgA== X-Google-Smtp-Source: ABdhPJxMIgPhsPqc6+bSuAHCcmgyI32s/YEtFPyW0w+NHzicS9BPGVXN8SeBJho1LiTGXqYptTny/w== X-Received: by 2002:a50:f0d0:0:b0:413:362a:1563 with SMTP id a16-20020a50f0d0000000b00413362a1563mr3317710edm.393.1645624869296; Wed, 23 Feb 2022 06:01:09 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id q12sm11284539edv.99.2022.02.23.06.01.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Feb 2022 06:01:08 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ashok Reddy Soma Subject: [PATCH 3/4] xilinx: common: Optimise updating ethaddr from eeprom Date: Wed, 23 Feb 2022 15:00:58 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Ashok Reddy Soma In board_late_init_xilinx() eth*addr are updated from the values read from eeprom. Ideally the MAC addresses are updated sequencially. So if any MAC address is invalid, it means there are no further valid values. So optimise this logic by replacing continue with break. Signed-off-by: Ashok Reddy Soma Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 0068cb879263..db089c4a0b17 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -416,7 +416,7 @@ int board_late_init_xilinx(void) for (i = 0; i < EEPROM_HDR_NO_OF_MAC_ADDR; i++) { if (!desc->mac_addr[i]) - continue; + break; if (is_valid_ethaddr((const u8 *)desc->mac_addr[i])) ret |= eth_env_set_enetaddr_by_index("eth",