Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp535143pxt; Fri, 6 Aug 2021 07:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX0G3d4w/nQF7NMnrFfc0Hy+wZvCz+w6gkF8IOGcGRyFkpzxqfe4nu207vIwIkbuwpuYIV X-Received: by 2002:a6b:1642:: with SMTP id 63mr952534iow.68.1628261669041; Fri, 06 Aug 2021 07:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628261669; cv=none; d=google.com; s=arc-20160816; b=ViKrI6Ff276iTWo4IpC++YjMBirYr96IGc68dWw9svZtIRVjplZ/WkmhWtFSnNHcnJ W8HypXHMuvvUZz//YPJhO4bM3n9UHt1TW5RANqUK7UCdDoP+XF74COo/QP3xGGc7isVT OK0IgcnS3EC86tdBGZKfgKAOEl1HwbnAIimPNQ3bBU2ILpH9J88Bw7j5R2E12lFr1ueC 1/ykxA0+MJxiBqjw8tDqkeQwvGhbRR859v5ZQvZDWt8VBP7mg7Q+t79svubYXzAAcp6V ek3aS51XUkD62htS03FiuHYlLO8EqGdd81LdCN4Kgiy7+NmSkP0yEtDLyPk6wCblRzn8 +v0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=Iw/Qld2BXHBhuZYypT5bN2CCKgDqDnynAHMjC5IKYhw=; b=I9l4wBUXQqqfL4iJVVRftMM2lAvCJ5CbqacHqyLfRAFBk4EV9f449rY4jhRHVSd1/Z dAfvvQSDsfQFsDZ4jF77ToIFHU9mGSH8ogGtCPiS4UWWEHz0NaDTcVDfneLlmNh3k+7B Uc9Gp/TbYBb8H+vm4gh1/EmpeqTe1c/AStey+DEUsCIdpr6AjVK2C+xr0F+o2tHErCnh i1Ti49LOJkOe2o7nd8fnYZ1CJDcnkijKQOxBe5vpgVkwnJYGu+7gAeh+5Gn1z9gBhOsz fOCmg8myKOLk6pvq7nyk2wtalXs9I3qzWtAtbe1gV/1NYLPvD4v4vN1s7DpQgOPo41te yAug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20150623.gappssmtp.com header.s=20150623 header.b=bAuhZuxu; 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 b11si12215461ilj.10.2021.08.06.07.54.17; Fri, 06 Aug 2021 07:54:28 -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=@tessares-net.20150623.gappssmtp.com header.s=20150623 header.b=bAuhZuxu; 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 S243895AbhHFI6j (ORCPT + 99 others); Fri, 6 Aug 2021 04:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbhHFI6j (ORCPT ); Fri, 6 Aug 2021 04:58:39 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB0FCC061799 for ; Fri, 6 Aug 2021 01:58:22 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id hs10so14122059ejc.0 for ; Fri, 06 Aug 2021 01:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20150623.gappssmtp.com; s=20150623; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Iw/Qld2BXHBhuZYypT5bN2CCKgDqDnynAHMjC5IKYhw=; b=bAuhZuxuGSyYxPQn5X+Har7aoOkIEccdwEP6EtLovSPxgCEtOc1Xu8fMKZ740wXuY4 8y2h444bZoljFnbwX5td/YoN0oYU9d+iQM2ArWXpJtbR0ZAajjYfZGt4MK5VLkkKJPon n7qiFiw/n6OArpr/D8vO4mauFptmiqu9sJk3jE9lrSg2cH4naqDt7atF29DovPILkgEX tAPm0vBv6ySPI2IxPGnFpeDMvSiFvRPzGLk1kbkIokGld4ot4pQGAVNAmU6g/sKwvkAx l02Ocaklk5fmuT8P1yC2ib+wjgfmDct3ga28KyLUNKVxCQi+YFe80w3g3838FNNL8wCZ AzFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Iw/Qld2BXHBhuZYypT5bN2CCKgDqDnynAHMjC5IKYhw=; b=gsTvj57ic3wAuEsP2Z0D9gbJrEwvmnL3L6CtRNUj08ol83cQetlSz+OtLc6/0/ZTAd MItHnrL8l3yy4Dxz63zUIIMXINaNlrKspmhFC17XzCWjF1kgqP3Ch2OWvwshWABHeh03 WZPmLnKvC2PnNKS6h4YR5O41ZwGJFGC9nWSxnBLvKaI/j13/q/xaLIbC+Bgr47V7izGR 9PM+lGejJzvls4Qww1D+0DpLSryyCRY2BNrp9Bz8Q4If72nZnFZ0VL+a23IQr4p97FtV vupEBWi5VBSctOTTPhxf/9rsTWcfJS6Y4EhYlOq2nD9U8XJM86Yi7X0cGkFhjr81+4M2 8cTQ== X-Gm-Message-State: AOAM5326J4kVPk3wNcO9noQ6/EYbNN1bc8yS2Ni82DWeIAIIFmvk4ai/ mm0M9lWoV50QE+nryh9adg9s8Qr5t3Zmkr+s X-Received: by 2002:a17:906:138d:: with SMTP id f13mr8998205ejc.34.1628240301420; Fri, 06 Aug 2021 01:58:21 -0700 (PDT) Received: from tsr-lap-08.nix.tessares.net (94.105.102.61.dyn.edpnet.net. [94.105.102.61]) by smtp.gmail.com with ESMTPSA id mh10sm2648924ejb.32.2021.08.06.01.58.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Aug 2021 01:58:21 -0700 (PDT) To: Yajun Deng , davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210806063847.21639-1-yajun.deng@linux.dev> From: Matthieu Baerts Subject: Re: [PATCH net-next] net: Remove redundant if statements Message-ID: <4b175501-50c1-fedf-1eaf-05c0de67c3c8@tessares.net> Date: Fri, 6 Aug 2021 10:58:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210806063847.21639-1-yajun.deng@linux.dev> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yajun, Thank you for sharing this patch. On 06/08/2021 08:38, Yajun Deng wrote: > The if statement already move into sock_{put , hold}, > just remove it. I was wondering in which subtree you had 'sock_put' checking the socket pointer but then I realised you sent another patch just before adding this check: "net: sock: add the case if sk is NULL" Please next time send them in the same series to clearly indicate that this is the 2nd patch (2/2) and it depends on patch 1/2. Related to the modification in MPTCP part: it looks OK but we do a few other calls to 'sock_put()' where we don't need to check if the socket is NULL or not. In other words, if your patch "net: sock: add the case if sk is NULL" is accepted, then the modification in "net/mptcp/subflow.c" is OK for us. Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net