Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp304027pxk; Thu, 24 Sep 2020 06:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6dq86tuR3v7h/AIXoyOw53nAFemVo+fW3W/2wEkp/Gsh5FQMwxDXAOrRV/uQ9ChbsCtMb X-Received: by 2002:a50:f1d1:: with SMTP id y17mr948884edl.231.1600953335300; Thu, 24 Sep 2020 06:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600953335; cv=none; d=google.com; s=arc-20160816; b=V5bdTojhu48H/JPqUpayYuW2poOXlZ0KpOLGwMGuv+oU/p4jZTKaqORSpIN8XZLqql OLO51NjVIGmZ+lq+MeeiL07LpnviR3VXB52/3DosV/dCcmnDmkYlsHw6ATusFUwoYPNa 4Sc3dIPT9ZITLyYFYvsp25YmcvuOYTRr4wz7MsHYx+m13OSAihELhf+unbJDEBddzCbS JHZjg336Ez/ny1b4bqoOnvHtjy9aplPID2YQTAGDwauWrcb+tBDmpl/nbY1vHfnaT0eE j/JvKfcGFgsdGBwEmgm4DgWsrei3+El1NK3Mhb6jlsIFm8H0o6E8FvYbjzKxp5F2yhCo Wsnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=fAIKdX6Q8v6X6iiHvQpMrhkDP+drcMiwEPPTPZj0rvw=; b=QU3OS1h2WQQnKCuuHML4vk63Fhl7oBF2weXudWDey9QE2Wu5SLnwPLagsY8tXgKGmt z1sQfZ0AUbw6FdYpvOb9VrkYEgMSssPXl5B/vZz/JhOhETPTQUkvWHOkxgs8xxTrdfWj cJl+6Ll+V2899I5HI6J5WEzu5HenH1oK3y7R4G5vXTjK1yYxu/Ovrdubb8GypPGXFt8p 65dVu7u756c33DIQAqTZZ6uTW0nKvrwZYsaG5gOjNgenaQ+CD8HXSLrQ2M9l/CP9tkH4 uV6J6DHOjQyAxav0dEJIh2K/VuKX2ow+DdYd3uIB7/onG1rx4hgdN4PYmP/Q3gEA1oBz Uniw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=maJ20F6E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si2427113eda.448.2020.09.24.06.15.11; Thu, 24 Sep 2020 06:15:35 -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=pass header.i=@gmail.com header.s=20161025 header.b=maJ20F6E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbgIXNLx (ORCPT + 99 others); Thu, 24 Sep 2020 09:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbgIXNLx (ORCPT ); Thu, 24 Sep 2020 09:11:53 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43A1C0613CE; Thu, 24 Sep 2020 06:11:52 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id z4so3778339wrr.4; Thu, 24 Sep 2020 06:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=fAIKdX6Q8v6X6iiHvQpMrhkDP+drcMiwEPPTPZj0rvw=; b=maJ20F6EGsDJEim/bn2SH7SAi5AhsgRO1Ou/NdSDvJ8bad8V10rA0qkN9VcPuFXOxF 8hCDaJozazVQ/EdNOFUemlgtfLN4qDfhWNKqDzdSnL1v+D8LYePxnPpYh4LhIPdGbeCF 8b661AurKiqj2W9Techzj6W6U0G60bB7j8YkplNkq+JbNARKQZuFXPPUVCde5V2W+Oeu 01UjZMLeLXqW+t5NdKlw7U8MPgMrbYS2Wh/neePdBoMxbFfymPfNTvNO5wP9z/Ar4rSo BvZxEDQ4/6iLrJYgi7gy863iv524Ychrd52L4phMSEwNJX1eo6AgYhdwmP7H4M6gnrIE w2rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fAIKdX6Q8v6X6iiHvQpMrhkDP+drcMiwEPPTPZj0rvw=; b=lSVtlxwx8lWRAPTgo0n9Jb7Lnge/jpTWOe0FHQjXxDjEIGbZzYzgLNdywV9aR6gAwM HFj1DUNXqMQOV1ZkEg5xcEmr6/ZXhpBVxh8Qzz3WseFcnyYWa3+irzCvqSsYyt+G+k1t 1xSmgUPt8ldkls7IwWmzbrnuLPTL82IGAqSi1wiJ1DyiPQjWKUGDjrpeo2yov04Pus/y qE+E6fQX5tiukGZYqOdB4xnIvtpmpyv/2JFdDtVMjjBuaKQC57RKUA6YDA2deFalq58y 7w9VjJ2M30H6b85uAsDCfC7/DU+uFb8zkjujMAa1yNbvZfxC4UpacXf/7+Xi6pgI1MUx 9eAA== X-Gm-Message-State: AOAM531ZLvXz8NOVjg8N8FcsTVo7pd9HRIjYj+Lga2kb1biPRpGsYqyq Xv9dM3lHy4sCeBhyQwly2izgEGtmIXIbcpfr X-Received: by 2002:a05:6000:85:: with SMTP id m5mr5014939wrx.160.1600953111296; Thu, 24 Sep 2020 06:11:51 -0700 (PDT) Received: from [10.101.10.94] ([176.12.107.132]) by smtp.gmail.com with ESMTPSA id p11sm3302323wma.11.2020.09.24.06.11.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 06:11:50 -0700 (PDT) Subject: Re: [PATCH v2] net: dsa: mt7530: Add some return-value checks To: Landen Chao Cc: Sean Wang , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <1600327978.11746.22.camel@mtksdccf07> <20200919192809.29120-1-alex.dewar90@gmail.com> <1600949604.11746.27.camel@mtksdccf07> From: Alex Dewar Message-ID: <9db38be8-9926-b74b-c860-018486b17f3a@gmail.com> Date: Thu, 24 Sep 2020 14:11:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1600949604.11746.27.camel@mtksdccf07> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-24 13:13, Landen Chao wrote: > Hi Alex, > > Thanks for your patch. By linux/scripts/checkpatch.pl > > On Sun, 2020-09-20 at 03:28 +0800, Alex Dewar wrote: > [..] >> @@ -1631,9 +1635,11 @@ mt7530_setup(struct dsa_switch *ds) >> mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK, >> PCR_MATRIX_CLR); >> >> - if (dsa_is_cpu_port(ds, i)) >> - mt753x_cpu_port_enable(ds, i); >> - else >> + if (dsa_is_cpu_port(ds, i)) { >> + ret = mt753x_cpu_port_enable(ds, i); >> + if (ret) >> + return ret; >> + } else >> mt7530_port_disable(ds, i); > CHECK: braces {} should be used on all arms of this statement > CHECK: Unbalanced braces around else statement >> >> /* Enable consistent egress tag */ >> @@ -1785,9 +1791,11 @@ mt7531_setup(struct dsa_switch *ds) >> >> mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR); >> >> - if (dsa_is_cpu_port(ds, i)) >> - mt753x_cpu_port_enable(ds, i); >> - else >> + if (dsa_is_cpu_port(ds, i)) { >> + ret = mt753x_cpu_port_enable(ds, i); >> + if (ret) >> + return ret; >> + } else >> mt7530_port_disable(ds, i); > CHECK: braces {} should be used on all arms of this statement > CHECK: Unbalanced braces around else statement > > [..] > regards landen Hi Landen, Sorry about this... I usually run checkpatch over my patches. Would you like me to send a separate fix or a v3? Best, Alex