Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp643535pxk; Wed, 16 Sep 2020 13:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgQSobLrNdUvGxvxPej7k4/urlLCldbp+vrA6TbE6vM7mGMKt6MV5U5NAFKJt9F7ciDvsA X-Received: by 2002:a17:907:724f:: with SMTP id ds15mr26581808ejc.119.1600286857696; Wed, 16 Sep 2020 13:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600286857; cv=none; d=google.com; s=arc-20160816; b=N7FS/JSXJwie5jWvSlMv/eT5puc46aCRedicLpqnMq7+6/fdMWqK0j4zRsg7JwTMjS PGH19Xzd/dL5uvDANWKG6mazkG7jlXCCSEzIOA+th1aNDAIKhRoslfrsPsbNMDHUwg2B 7770bgd5vqdaQqGC39Rsp5R+iFSCoagY95Aj8NVWYUv8SxWv+OzW42SBJI3dMsohYVJ9 w2eLZdS6VCA36mSVmVh8N676LJOCQPD0Th0zXldkeLqQuS0ibYml2yVniKtaXIAsDFlO odwjf9PCZicBJ1aEnH3lVgsIfZPDA/B1wH8Le8B0EODLheGH+HnzxQbgOpRHobh5VK8+ yGhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=T9fvnuQT5tUNVg4dfcPMZex+1bwWdfiOlebeWDaHsh0=; b=uDDCJA7QSDqtD9F5sgpFgd2rH4lw2UKG7LXgTge2LbcTdJlNjuf3VqkjeyPFbyfjUl jt4pNbSwsctAOjIe3xFgmcJ9HHBtNrF6uDXM0/ipa8OgZFR8Z7wdJ3s7HQhxDu9d+A33 2Ngl1vaq7PPH/oVW1ylW6O/okrGHowSCB5MjiP8bezRuFKeZJApN7KD4QS8KLoMUOu1n NtHRoVX5aY6C1RXwuat8V/c+oOpxb9MLSh884Enox41dHdaxdkqhBR0dM3+MfY+an9IS 4uJtfDYyzn+LJ3mGmt4hTE1ifzsd+v3VpHhADD/5b6ZQWyVa+bjcLvYf06+oh2CG+h5g bDug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=Y8JQd5oI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f14si11824786ejq.98.2020.09.16.13.07.13; Wed, 16 Sep 2020 13:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=Y8JQd5oI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbgIPUGU (ORCPT + 99 others); Wed, 16 Sep 2020 16:06:20 -0400 Received: from gateway34.websitewelcome.com ([192.185.148.204]:37726 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbgIPUEv (ORCPT ); Wed, 16 Sep 2020 16:04:51 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 63978AB28D for ; Wed, 16 Sep 2020 15:04:30 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id IdfKkRWATdbRzIdfKk6f7M; Wed, 16 Sep 2020 15:04:30 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=T9fvnuQT5tUNVg4dfcPMZex+1bwWdfiOlebeWDaHsh0=; b=Y8JQd5oINB62RK94IyQyWw++2+ 5cOpAb5mPE6WhnN4YfjjYPy66oQkvyaoib440OR8H69HknmXot7qNyzMhhJamsbBQKASQ7vHbeRTv 3UkA9/2C6dTCy00MTO4rUVjPmFZVCnbyMQiMJsGMwOUSkfOlP17G7n6VYHR2tcN10yQmBxPWGViiZ 4XxcGa86QGQOYQZlnw55P4+oXC0s2kMwJYIGOeFUjACaFFB6JFFNX2vGIKkjTqB40mJ5qWA2SwHQ2 URmA68TxIDQO+shfty8DKdPMEA7WNHd/MXJacCZ8km0pcXFci0T/Akz2Y/EbyMnk+XyMucaDgQrde 81hDkzQw==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:53016 helo=[192.168.15.4]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kIdfJ-00066O-Pe; Wed, 16 Sep 2020 15:04:29 -0500 Subject: Re: [PATCH] net: dsa: mt7530: Add some return-value checks To: Alex Dewar Cc: Sean Wang , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King , Landen Chao , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org References: <20200916195017.34057-1-alex.dewar90@gmail.com> From: "Gustavo A. R. Silva" Autocrypt: addr=gustavo@embeddedor.com; keydata= xsFNBFssHAwBEADIy3ZoPq3z5UpsUknd2v+IQud4TMJnJLTeXgTf4biSDSrXn73JQgsISBwG 2Pm4wnOyEgYUyJ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16aVDTBTPEGwgxXI38f7SUEn+NpbizWdLNz2hc907DvoPm6HEGCanpcAEQEAAcLBZQQY AQgADwUCWywcDAIbDAUJCWYBgAAKCRBHBbTLRwbbMdsZEACUjmsJx2CAY+QSUMebQRFjKavw XB/xE7fTt2ahuhHT8qQ/lWuRQedg4baInw9nhoPE+VenOzhGeGlsJ0Ys52sdXvUjUocKgUQq 6ekOHbcw919nO5L9J2ejMf/VC/quN3r3xijgRtmuuwZjmmi8ct24TpGeoBK4WrZGh/1hAYw4 ieARvKvgjXRstcEqM5thUNkOOIheud/VpY+48QcccPKbngy//zNJWKbRbeVnimua0OpqRXhC rEVm/xomeOvl1WK1BVO7z8DjSdEBGzbV76sPDJb/fw+y+VWrkEiddD/9CSfgfBNOb1p1jVnT 2mFgGneIWbU0zdDGhleI9UoQTr0e0b/7TU+Jo6TqwosP9nbk5hXw6uR5k5PF8ieyHVq3qatJ 9K1jPkBr8YWtI5uNwJJjTKIA1jHlj8McROroxMdI6qZ/wZ1ImuylpJuJwCDCORYf5kW61fcr HEDlIvGc371OOvw6ejF8ksX5+L2zwh43l/pKkSVGFpxtMV6d6J3eqwTafL86YJWH93PN+ZUh 6i6Rd2U/i8jH5WvzR57UeWxE4P8bQc0hNGrUsHQH6bpHV2lbuhDdqo+cM9ehGZEO3+gCDFmK rjspZjkJbB5Gadzvts5fcWGOXEvuT8uQSvl+vEL0g6vczsyPBtqoBLa9SNrSVtSixD1uOgyt AP7RWS474w== Message-ID: Date: Wed, 16 Sep 2020 15:10:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200916195017.34057-1-alex.dewar90@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1kIdfJ-00066O-Pe X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.4]) [187.162.31.110]:53016 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 14 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/20 14:50, Alex Dewar wrote: [..] > > drivers/net/dsa/mt7530.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > [..] > > /* Enable Mediatek header mode on the cpu port */ > mt7530_write(priv, MT7530_PVC_P(port), > @@ -2275,7 +2279,7 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int port) > { > struct mt7530_priv *priv = ds->priv; > phy_interface_t interface; > - int speed; > + int ret, speed; Don't do this. Instead, declare each variable on its own line. In this case, speed before ret. Thanks -- Gustavo