From patchwork Tue May 9 10:44:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 760011 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wMbc83trDz9s75 for ; Tue, 9 May 2017 20:45:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QYRUmhkI"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id BC7E8C21C51; Tue, 9 May 2017 10:45:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7FF0CC21C25; Tue, 9 May 2017 10:44:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CE72CC21C25; Tue, 9 May 2017 10:44:57 +0000 (UTC) Received: from mail-io0-f195.google.com (mail-io0-f195.google.com [209.85.223.195]) by lists.denx.de (Postfix) with ESMTPS id AB9BEC21C1F for ; Tue, 9 May 2017 10:44:55 +0000 (UTC) Received: by mail-io0-f195.google.com with SMTP id 12so11484694iol.1 for ; Tue, 09 May 2017 03:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nZFcXUzLU5XgQyF7JsbU0avqfETBYEYY7rGdle9hWXQ=; b=QYRUmhkIVR6v1eAN/qu66Xd9rdMjmR1rRZbP2kNisRXD+6m0sL+ovn674TKIJEVKYz fB5uUpI0zYczsqRjhVTPUIrcGtL5xjEEkLvmLUGkGcWZAQzlhym6aX4DvN1BGJlr9vhC FS24hoKPLTRvPrTvHjGXlEnW5yVKDehM+eoLXKdfm2JwXGcibMvb/w7PTsdu7uhEC0Cq T6i2MIa59jFZ20LybfUNI5baZF8woSHM+CMVmc4lJcU/fvnTfcAjR1pPJM5aZ828aM+q jUzwqHCQuz6v/Jp2fzdnmJW9SovfVm5vr4X5GrFUs6VwSRE319FafVpxk6CvhsX/41Gz IFEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nZFcXUzLU5XgQyF7JsbU0avqfETBYEYY7rGdle9hWXQ=; b=bgYidXOFHFw8y2Fc5+z+aS22O5fhsDt+VWBxroubqxFNL+RFli/zel22wYbRR8Gwjs FqGi3LjfUrl2Yag9s9V8V2Fccjb3I2XHl/8avvDMZShR+do9AaZlum7nPBGkqgFNwueq fB2/xh9aut7aAuUjrX4ZmJS2HEtRU0cB9vuGLUSMtdpZsIDgYI8ZSPuaFO5096tb2dOX CUnoAuUqNnrR5YwM0UJuBOEHDF3EHBbnFAJ4gvQWpcfFXhRXAuHmvmGj5KboLT+/9w3Z EohRxXfHtvWJsgcZTbFD1L13InTAVg5YuQIYb+g5BMGhIIhutpCDEth4Ijmaftd4TBsD OQ4g== X-Gm-Message-State: AN3rC/5ks6niNV6CCkMVprysm2KlOQzdcvFe723QO1MOTxEVHcsRzYpF X5Y+kqV2/tDNfTyouxJ/go8W9p/0BA== X-Received: by 10.107.130.25 with SMTP id e25mr27621505iod.31.1494326694575; Tue, 09 May 2017 03:44:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.158.5 with HTTP; Tue, 9 May 2017 03:44:53 -0700 (PDT) Received: by 10.79.158.5 with HTTP; Tue, 9 May 2017 03:44:53 -0700 (PDT) In-Reply-To: <1494296075-29477-14-git-send-email-trini@konsulko.com> References: <1494296075-29477-1-git-send-email-trini@konsulko.com> <1494296075-29477-14-git-send-email-trini@konsulko.com> From: Chris Packham Date: Tue, 9 May 2017 22:44:53 +1200 Message-ID: To: Tom Rini X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: Kevin Smith , Joe Hershberger , u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 14/17] net: phy: mv88e61xx: Fix uninitialized variable warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" On 9/05/2017 2:13 PM, "Tom Rini" wrote: The variable 'res' may be unused uninitialized if our call to mv88e61xx_port_read (register read) fails and we goto the error handling section. In this case we set 'res' to -EIO to indicate why we failed. Cc: Joe Hershberger Cc: Chris Packham Cc: Kevin Smith Cc: Prafulla Wadaskar Signed-off-by: Tom Rini --- drivers/net/phy/mv88e61xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Looks good. Reviewed-by: Chris Packham } while (--timeout); -- 1.9.1 diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index a2fd1686fc3b..3d2f6b98ad0e 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -655,8 +655,10 @@ static int mv88e61xx_read_port_config(struct phy_device *phydev, u8 port) do { val = mv88e61xx_port_read(phydev, port, PORT_REG_STATUS); - if (val < 0) + if (val < 0) { + res = -EIO; goto unforce; + } if (val & PORT_REG_STATUS_LINK) break;