From patchwork Mon Mar 1 13:32:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 388635 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3353031jap; Mon, 1 Mar 2021 05:34:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3quT3JDRCRB1FPaeYXaRUpgRg/2ugRTtRf7mo6TGoGoXkJ4Yla+LMAat0t4s/GKj2i5A+ X-Received: by 2002:aa7:cb8a:: with SMTP id r10mr16384060edt.152.1614605676772; Mon, 01 Mar 2021 05:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614605676; cv=none; d=google.com; s=arc-20160816; b=ZnWaoS36zGSD8KpJFPo8aAUd9wTT/JaptnML8/qK7/h81UuKqq9tTMgC0dlI8u1WVA LHpLUC0qlKiWlorA80ganOJ+bcJQTRMxiypW5ldSqK2peJ2QS/1zGH6jfjpo6ijUAXMt iTOzBzWzxJzCCd3zg3tNDswsusGimrfhZTdqrvJxWdXN2qxlqa3B31atOSMMGl+gtF6f 6sCt0DLCKNaiwnFIrh1R3GiRFWPKvl3Fixb3befiSgtyFaH9TmfzdNuv2R+/13iDoiTz ndzvfW4YwxziWFkwQgB2DpawOyoFG3ttvpo2W0Sg5aNHG1nuk06XsPctCGRNMQG2menl we2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pcHwrN0wdUgHRkW93Ilur7+SDuQt+zWeqr8EgwbfNpo=; b=Yd9OaHx1FH1/Oi7UycTSHqoo9aqj68nPGm7WrD9FjWkQx7TyQWyqG6xckhHnCB5N89 ZAPQlPLkzpuZSpwI0DkpRFTB7ezZSk3TkLZRGU0c/doop3mQDeewmDrL5yv7jzbHYtUe Ag02E3HtGpXWSRZUax8NsU9DvLNqhylViI5q6Ph1YknB7UV0Nl53DMPgQl58twwJysRz WG1UwoNoGKHWWYCb7B0AVprTCI7qbdjJXabIL7uQhrH+oPpLndJOFcyNL8pXSioeU3YC RcuE0ysfICEcd7X52ABh65HBcdHSmCo4/dYhK5SSF+fRuPLCbKjbTqFuOVjwBXrJTf7A ltfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nDVoUXsC; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si11037053edd.127.2021.03.01.05.34.36; Mon, 01 Mar 2021 05:34:36 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=nDVoUXsC; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235845AbhCANed (ORCPT + 9 others); Mon, 1 Mar 2021 08:34:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235777AbhCANd2 (ORCPT ); Mon, 1 Mar 2021 08:33:28 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE32C061756 for ; Mon, 1 Mar 2021 05:32:47 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id p15so10472623ljc.13 for ; Mon, 01 Mar 2021 05:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pcHwrN0wdUgHRkW93Ilur7+SDuQt+zWeqr8EgwbfNpo=; b=nDVoUXsCLk26fGNNhSXXaXw6sR/qR9qagJ+MuZURL55GuNY25R96U9wauI0HryK0jp ez7dndZwAJfpv9ohgkDmAK7JWHMlNfjWwJWrnCs8mlgFSht5bk+cORgnPvDAH9fkNCMI SWEwSSNKp43YmycTufGOGOgVKUWbWDQYTtWKC/Hpqn58qT5O72+ejnFVuxhkk2fAJ2aR /9cRkhp0HkG+iXcY98nQAiE05WsOFVtx2FH3fHKk9+Fdp0dPDIpv4gy+L+cuDWyUhRyq 7SLKXrTzus5JMedgDKnDonZGGEIdb0wwiJhr7r6AEW6jl6mo9TN5u3a7/3UdooMa9Mf/ d8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pcHwrN0wdUgHRkW93Ilur7+SDuQt+zWeqr8EgwbfNpo=; b=XCbP5FWCubGxk8gJrWMlZkDKMtykOJJkHEmEjxk+PiIWy4afcXg/MefkMZKLf/aptP tNhSpa0Vxg3BFWSSFTg8/TyGLPbbzuHiCXnLWBGmLBt+JfmafH/wDCQP5iUrOXJPGwBv yhzJFzwTyeaPyf8DKN1v5GG+DqLZArbs9VBm+YV5w2QzW6hER/XOfyNQHdk2PVHqpMg/ q0wnVcErxlThoOJdxeybxJnFJex6gatw2/WulAqNBfHYxnIs56bZjDz1SiB/KicjS5u9 p8t9Ob9acPqMY1HPPn8w4YEz5+e78GEhrpr81q5HkC4ggjS3AFptDVe9tO4scYzH6FSC p7ig== X-Gm-Message-State: AOAM531vqAJHxYc2WWrs3WWMULBdMEduwCjb0jaLn9Jb3aYFTmkFy2Kf bfTxZF9Rr1Ca280kakwQKZS1fQ== X-Received: by 2002:a2e:9791:: with SMTP id y17mr5165862lji.343.1614605566175; Mon, 01 Mar 2021 05:32:46 -0800 (PST) Received: from localhost.localdomain (c-d7cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.215]) by smtp.gmail.com with ESMTPSA id c9sm2310066lft.144.2021.03.01.05.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 05:32:45 -0800 (PST) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Linus Walleij , DENG Qingfang , Mauri Sandberg Subject: [PATCH net 1/3] net: dsa: rtl4_a: Pad using __skb_put_padto() Date: Mon, 1 Mar 2021 14:32:39 +0100 Message-Id: <20210301133241.1277164-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The eth_skb_pad() function will cause a double free on failure since dsa_slave_xmit() will try to free the frame if we return NULL. Fix this by using __skb_put_padto() instead. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Reported-by: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 Reviewed-by: Florian Fainelli diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index c17d39b4a1a0..804d756dd80a 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -40,7 +40,7 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, u16 out; /* Pad out to at least 60 bytes */ - if (unlikely(eth_skb_pad(skb))) + if (__skb_put_padto(skb, ETH_ZLEN, false)) return NULL; if (skb_cow_head(skb, RTL4_A_HDR_LEN) < 0) return NULL; From patchwork Mon Mar 1 13:32:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 388634 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3352906jap; Mon, 1 Mar 2021 05:34:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJXnPRztop0Q8f8BDQyGNCYj26ZJa9bqb8NB8REdvdaVlJeGrK0GHhlJxGYUJ1K4JIpFyk X-Received: by 2002:aa7:c3c7:: with SMTP id l7mr16516969edr.207.1614605665357; Mon, 01 Mar 2021 05:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614605665; cv=none; d=google.com; s=arc-20160816; b=oMvDOExlGy0SlcLKkXZu1AxY3VOec/moobHVpVRtPKoxem+xoUfal1J2bqTX/Voyf0 vRDTbnJFmwD0UaGxE765bIhbBkdSyny3ICCCQ1fPEydoLGC3fNR4euy4DZZ8F5rGcTAm dezA4Yj/h4Pe/7A38WTaWIlVkEti3kBwfRfKYuyD8B58ak/4WixlJTA0I+oQzuWoy13k FVzw8bptSE3uQWC7k//oS6vCmD0xrL4jEywT44qRmQHDi+HSyPPYADX2zuuU3ZNbwMdj n7ZfxjSyUaQm01efsaLHTKxRFZ6DGPNgvXAk4/7BOrGAV3A4Bg73E0QWj5s9KKU1bhEI JTgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cYZerRT2x1qlGnIcE8x6N2LpmT6kXCgWE2D5TP/WfCs=; b=t2OlgvhYf/nBDNwIfRKgqNohnMP7XG7Ok6w+0hRoZdnsMRgwyaH2VyYE7JTrsyP3Z4 qpoG3v0mr9DEBSjCnrPGEK1aXWWC1EZ3KLy33fk+gVklLJpGY2X4s8VThz8pmdFmYrno 1CKxcFVfwYrqAEm+IR5f09LDoz/aAXg4cBbX0tMRTQ8ju9nCkW4CIJ/a6dNbFYtPYXeN Oaao7qXw+FoTtYoBeSaitL4sKEYWQI5E4y1YMW39i3IXxrhwsg0acBlDcOB7oljzcjO4 qjd2jmCdZ3oRIhIZecyuJOlLzMRfMlie4YV6XIitTd2Ft3islhW0zBzCHyfRERMFeHVT P34g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wKzXFcDL; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si11037053edd.127.2021.03.01.05.34.25; Mon, 01 Mar 2021 05:34:25 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=wKzXFcDL; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235830AbhCANdx (ORCPT + 9 others); Mon, 1 Mar 2021 08:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235814AbhCANd3 (ORCPT ); Mon, 1 Mar 2021 08:33:29 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C12AC061788 for ; Mon, 1 Mar 2021 05:32:49 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id e7so25535873lft.2 for ; Mon, 01 Mar 2021 05:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cYZerRT2x1qlGnIcE8x6N2LpmT6kXCgWE2D5TP/WfCs=; b=wKzXFcDLjNyyRoslx3XcGuzfeszZwxSUcGtgTwhw+Y3Hp51/yhR3A4MGHWVgreAN1x hqUmNnCKT0MzuDnHrMC2sqDuere+4CpfTK30Zh9q3+YBF4hbk8WRE6AfH+ulCqd+/ozb IyIruRdLbFzaSSbSdHLXUvLm3RZfSdFWdRt3MwBk8GUsSX/YsN/vOJac3U5nBkkbcmWF PU6Ut6S+XWdx80tyfDhbi32War2XktED/mAnE/SQC0oAwLI9ey/c87+JWcaOu+MBDF1P os2EfNbn1k8m2rEyM8mxtZ9I9Z+xilAWMTg6dPcbiiHg5bA9yVaWIDMW3YEwOrIcXZan pTxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cYZerRT2x1qlGnIcE8x6N2LpmT6kXCgWE2D5TP/WfCs=; b=QiOZ6AC8x3BGarY7QKEAz8QuMGQ7c3Y1RV6feSRUiNK6LATIdJRV5Rc875rl8Hq/XM O5b/eqFcnlSqoNPY3ggPFlOqQCd1uYrUQ7Efcc9i9EH7BZSfMnfgic2SvueVNVXqjie3 KUu20KhTmmDmckU2Ur8bzxwPrIKyCkoGrB3qTERp8VwrHKU9MnTIFrSKH2+sIBULjHg4 dZ6Whc1z+MhnTreniXjMvQAgHm8PU3HMIEna3ClpcQub/W2ShERIF5csR/F+BD3i/UO/ QOgMvNq4bzhS6wiXjUmgjHsKLgXHPRP5Me8GDRy82I8O6TaqxL552Ccmchn7rkvYBcQg riBA== X-Gm-Message-State: AOAM5320+pwStEPr84/OhFPg9wG4SHktfO/+8P1kFv6x0vb9Sg7s9yL2 LzE9zwyBsyBrAW9aLRLNafbC2Q== X-Received: by 2002:a19:7d06:: with SMTP id y6mr9808950lfc.644.1614605567969; Mon, 01 Mar 2021 05:32:47 -0800 (PST) Received: from localhost.localdomain (c-d7cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.215]) by smtp.gmail.com with ESMTPSA id c9sm2310066lft.144.2021.03.01.05.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 05:32:47 -0800 (PST) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Linus Walleij , DENG Qingfang , Mauri Sandberg Subject: [PATCH net 2/3] net: dsa: rtl4_a: Drop skb_cow_head() Date: Mon, 1 Mar 2021 14:32:40 +0100 Message-Id: <20210301133241.1277164-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301133241.1277164-1-linus.walleij@linaro.org> References: <20210301133241.1277164-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The DSA core already provides the tag headroom, drop this. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Reported-by: Andrew Lunn Reported-by: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 2 -- 1 file changed, 2 deletions(-) -- 2.29.2 Reviewed-by: Florian Fainelli diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index 804d756dd80a..8098d81f660b 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -42,8 +42,6 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, /* Pad out to at least 60 bytes */ if (__skb_put_padto(skb, ETH_ZLEN, false)) return NULL; - if (skb_cow_head(skb, RTL4_A_HDR_LEN) < 0) - return NULL; netdev_dbg(dev, "add realtek tag to package to port %d\n", dp->index); From patchwork Mon Mar 1 13:32:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 388636 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3353258jap; Mon, 1 Mar 2021 05:34:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj0Bi30+XBAbKvUTHKaDDlaDVT4DXwhmEWIHw1oQUn+89OF7srg1LwebMnDO5roCHNR/cQ X-Received: by 2002:a17:906:3c0b:: with SMTP id h11mr16201118ejg.347.1614605696008; Mon, 01 Mar 2021 05:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614605696; cv=none; d=google.com; s=arc-20160816; b=Dc1mYBfPpZs5zW0CPIT0kgTMxsix5ccFgMpWWAmEz3LWfZ0TVexexDESM2GFczEjKT 86ONj69hHetnWivbmbazZfkkKIty/XhqGxzr126rrJk3DXdohS8iiZRxyL8T1sJa0/EJ EXZqzVRcARHqHQNPL3lelPFNk3J1+ZH41xsgJeooE6dx4NnzT/aHFu3Kaq7siPtvq2lf KVKrVe4Wx8LQlsUuqlNNKXDl8sVIc3MCFSka3gddNtpm96ZUxfzDLKFoPXxedZNAOOB2 rqObQVN9G5ucXMnB1gKa5A9M2yVvdbrXQPHOjZkG+wlxlTrIA/iYh1e9WRmTsZMgASkI QlOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wQalGovUJHUxAGD0LzoropIg8ifJImgRXYB/UBdo/FM=; b=ZVdJ7/lSKIXNteviICIhnNUTJlwk534FEWkJws2/YxNAu3PeOkA5LoO9mxN5SGOLrs CV6BTRCk3ISAtKOTfo1QH5D8P+Xx6SYbzTG6u4LlgXtuP2771NuvZWYtQMqryU0fhXEn zcOQIrSOer54B1fffulAMK+zDc+HKItsB9hFjfKrINe7phbrjQWLCpd1WGxJb5l3s8fi OGLd6JF5INl3/IBcQV3vYPJ0HJPneAqTM46dAjO2RDdvhT58d6LRHUGPZLG457crWpuQ XOaMFED1KJ0ajtrlq1a2+wxiB+0LYoAquzNkUS2AoEL1EL9jyDuoFsg91JwEJl1nmt2P 0gLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EcfV03XO; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si11037053edd.127.2021.03.01.05.34.55; Mon, 01 Mar 2021 05:34:56 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=EcfV03XO; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235780AbhCANel (ORCPT + 9 others); Mon, 1 Mar 2021 08:34:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235748AbhCANdb (ORCPT ); Mon, 1 Mar 2021 08:33:31 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23A20C06178A for ; Mon, 1 Mar 2021 05:32:51 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id e2so12222428ljo.7 for ; Mon, 01 Mar 2021 05:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wQalGovUJHUxAGD0LzoropIg8ifJImgRXYB/UBdo/FM=; b=EcfV03XOGJFa9Su6i6rEg7ozmay2Y73SCwaXy9mUdFcf8VZB9iqoLYtxN1eJ0TZMyv GiIuYkz9/oeMG/srJECF6wVRcmfw2T7N7jg8MtFawuKNqscHpDP7gsl6JgXBl/k4s4Wi 0TugNsfm0WtHV7xLute+ltCZkoCPfuX5AxJuseCPTWO73hFfRV7h9/jCIh97tlRz8a23 fLlHUATlHqnuHUVVrCWkt5dSZa153HOQ/VK49Wjv1pFffmJtrt6P2HI2yyq1XerJKGs2 CqLC+JYqhzzYhhiUNKGXTXgUFCGONenhdiwhJBh8D2++tRe2wILIX2H1hwpJ/sk5bjgM 12VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wQalGovUJHUxAGD0LzoropIg8ifJImgRXYB/UBdo/FM=; b=B9iFO1DzOzAN9sVXIAl7kkF+Ap/mDD0bHYAKl9me+nHaDvHJ5TQU4vQX2p9ias3h+J 3tWE9lD25DQjb4HbqR4ZeSqf2p/ZJcXxf+mhEPVoAfJAaYGxsZTzjBy1esPb5KJpDqUH JRe4Cl4IsEOr8hs1JQ3SbIvJkeDjPa7YUbNM223Q+q7HR0iHixsEgZffENJnRsbvdSEd v84TCCSZJody+RDLKYOIjnZmte9SM0OOM3qZInsalVDQtFsywIW4QivraJ3Hm7wsQH7m hfvEhTBkNHdyv2YQ/5z0Ud+nsErIKqvW+sQeZDtThCpZXUlD4XOCwfvss456z/M3fPaS OxYw== X-Gm-Message-State: AOAM531cs8Woq54y3Phl4xSozUI9uqFRzMcpZTe5ZGzm3xYXP20bhqWc /iUgxAlAafSjN8MR6qOwJGNRMw== X-Received: by 2002:a2e:9b90:: with SMTP id z16mr9190897lji.71.1614605569686; Mon, 01 Mar 2021 05:32:49 -0800 (PST) Received: from localhost.localdomain (c-d7cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.215]) by smtp.gmail.com with ESMTPSA id c9sm2310066lft.144.2021.03.01.05.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 05:32:49 -0800 (PST) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Linus Walleij , DENG Qingfang , Mauri Sandberg Subject: [PATCH net 3/3] net: dsa: rtl4_a: Syntax fixes Date: Mon, 1 Mar 2021 14:32:41 +0100 Message-Id: <20210301133241.1277164-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301133241.1277164-1-linus.walleij@linaro.org> References: <20210301133241.1277164-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some errors spotted in the initial patch: use reverse christmas tree for nice code looks and fix a spelling mistake. Reported-by: Andrew Lunn Reported-by: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.29.2 Reviewed-by: Florian Fainelli diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index 8098d81f660b..9da56c5ea9dc 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -36,8 +36,8 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, { struct dsa_port *dp = dsa_slave_to_port(dev); u8 *tag; - u16 *p; u16 out; + u16 *p; /* Pad out to at least 60 bytes */ if (__skb_put_padto(skb, ETH_ZLEN, false)) @@ -55,7 +55,7 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, *p = htons(RTL4_A_ETHERTYPE); out = (RTL4_A_PROTOCOL_RTL8366RB << 12) | (2 << 8); - /* The lower bits is the port numer */ + /* The lower bits are the port numer */ out |= (u8)dp->index; p = (u16 *)(tag + 2); *p = htons(out);