Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp228451ybg; Thu, 11 Jun 2020 23:11:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCTPFcN1qALslDqLwChtMTPrVIh9vixvFJEYCBoRFCdHij9sb/zOarxZuIrdKtgUpZgnz2 X-Received: by 2002:a17:906:8684:: with SMTP id g4mr11112905ejx.431.1591942318588; Thu, 11 Jun 2020 23:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591942318; cv=none; d=google.com; s=arc-20160816; b=UBz1bEkAxpBd4ThIYPzTL8EwJlT1FAGszUEgbinFyBRfSYtfUelciJ5V2BoCqumHVv 1wGuUuOTG/vr0G/1tzAW7Le3KJw5WOzZKEGQAd2LrYPdIBLC3rCUUWiHnpe4s4YHeeQb j8S0kUx6vutomL8Eivi/rkqR7ywtfnqDICVMRo9QoIX02THCxWJB23XoAt+Uyk7gIH+H gNSxOKuEQ4WXUlu43enlawm4YfSL+9fpcNSweLJCyar0zOkTiWwcUTlBLooXLo7Dxlij 8lhW4BdN+HgRdabhFAWFL3UQNr1JdXL5Lan1iS3gAWKbO7iHLmeAlj3pireHUzSdKGzj 4/Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JEvUUzirrseeTgZyQCQj6IhJaMAfwmJ6wJglPFtIGDY=; b=K4Oatb5b3vrQJOwZPCaGaaaI556MZSFK/sKbiZrbZq+jvVni5jIfa62HAL4g3PoNBj +BX1qlvFdEdpUY8vfkmS7jyJAp6E6NWyFk6S9q4682yGgaHjkSYbLP0QHuLa1LlITmzT xupTvSgrjcoULLnhAzXxXQyMJBpGq8A0S7DwsL5d0DBxIQ8L/Q9E7nzGt9pTUz7nzwqp vaDnmP1vzcCywzaKvzDMGFkMI/smJjxvGTHP5AuqxT/EPpn1m34ivFkSDVeIhJLyJuhh ldHCVt6qde2yG2/cXwRYLilCducIg1sMyt0LeTeArxKlerW1BQb7s0EMKXM1nJwK9jlR mdRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GqiItGxE; 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 f20si3010216edr.380.2020.06.11.23.11.35; Thu, 11 Jun 2020 23:11:58 -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=GqiItGxE; 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 S1726508AbgFLGHu (ORCPT + 99 others); Fri, 12 Jun 2020 02:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgFLGHt (ORCPT ); Fri, 12 Jun 2020 02:07:49 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8309FC03E96F; Thu, 11 Jun 2020 23:07:48 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id ne5so3225318pjb.5; Thu, 11 Jun 2020 23:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JEvUUzirrseeTgZyQCQj6IhJaMAfwmJ6wJglPFtIGDY=; b=GqiItGxEX8++bQb6zbVj9Cn+NBTVFDaXRPDlso+VvCigIG9NEsk6x9CCNr7BlxmxGo ib8zzELIsm1PI9EKOO2okeTgH6pGQ0E9Nf0vaGgVeCoFWblMFGcmjKyDjTSDL++c/+2M t2iX3GlptrM+anUdCphOGeJ1ePRRqPw7nM2TjFgAeAfgXR1A/AXzI5arGaqvy5+apQ+P nFmijyHaiadtW3KA5BHxwf4wYqvAKg2ndBQzeF825qqyiMjTGSoEpKXLAiIf4e8eknho NyC7E+IPQTC32ul7EziR3Ia2RR/I37tiTujejehjhhpWMaNrtlF1b6tEHcMT1LMkZAOB 7kfw== 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; bh=JEvUUzirrseeTgZyQCQj6IhJaMAfwmJ6wJglPFtIGDY=; b=idTwzkBkvo+lCbtFfWSP+XH6KHc0psCxVIUvdJnany5CuhhGAfEmtnu4YqWtb0d2L4 e9YHV6RPcfkmINUY38952T/tqyfyYReh1aYACXuhpUh9Iaq+NfDTzIaNOZhTEo8y8xmy 6mxjbRDe5021yQm2yuAl7FyDv48nygeu2HjHjFtUSmYGxbBS7PoSO9gCsKlxNmpDoJJ8 Y6znUAaMBdxdMOCbBwjvU1lcDl9My0vyaGrPZdAOoko2Y2Ej3jr+M1EXhjCYLBzKS4jC nunUuKaV1j2Zdm1b7cJcRYB5hfg5GL2e+VRO1F2fQL85s/CSoRT5c8L3/LeM83tUb9uG O8Qg== X-Gm-Message-State: AOAM531YjYTeGtAy28MMwQ2GfG0qtmRKEZCLUXv+QGk7VI3NrFQtxmmq ShMMZ2V6EeavZQ6cvjRLkjI= X-Received: by 2002:a17:90a:5e0e:: with SMTP id w14mr11458586pjf.128.1591942068165; Thu, 11 Jun 2020 23:07:48 -0700 (PDT) Received: from localhost ([43.224.245.180]) by smtp.gmail.com with ESMTPSA id g19sm4808563pfo.209.2020.06.11.23.07.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2020 23:07:47 -0700 (PDT) From: Geliang Tang To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Jakub Kicinski Cc: Geliang Tang , netdev@vger.kernel.org, mptcp@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH] mptcp: use list_first_entry_or_null Date: Fri, 12 Jun 2020 14:05:34 +0800 Message-Id: <9958d3f15d2d181eb9d48ffe5bf3251ec900f27a.1591941826.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use list_first_entry_or_null to simplify the code. Signed-off-by: Geliang Tang --- net/mptcp/protocol.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 86d265500cf6..55c65abcad64 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -234,10 +234,7 @@ static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk) { struct mptcp_sock *msk = mptcp_sk(sk); - if (list_empty(&msk->rtx_queue)) - return NULL; - - return list_first_entry(&msk->rtx_queue, struct mptcp_data_frag, list); + return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list); } struct mptcp_subflow_request_sock { -- 2.17.1