Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2074300rdh; Sat, 25 Nov 2023 12:27:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFN7jjO+t6CjM34S6Hstp4S1wMw7VFqTpXH7ZLvDn7AmSNRovFsvEFFQ/LwD/UMC4GoBvR9 X-Received: by 2002:a05:6a00:1914:b0:68b:e29c:b69 with SMTP id y20-20020a056a00191400b0068be29c0b69mr9753798pfi.9.1700944061874; Sat, 25 Nov 2023 12:27:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700944061; cv=pass; d=google.com; s=arc-20160816; b=0GUxNFQKFSiIscscuxaGTIApEq2rorIz6oFEhrEHwEok4AF715WfYDO7wPV6flMvp3 idHahaF8UtYtUzhG46q6YhbBy/Ueqh5HOOprIKMskbgoRhX/HSVT1eTGqfQI/9u/xEQF sIaFpOE1piNYKLzh+kQR8tV/IXmI3fJJRzvHydIg88EzpAuM6gmE+w+GmxNQFuMVG4Sh 1MgmFwKKh++ny2dyTZdaKQE0mrdDmPlCQoFgqn9sRfvW7QD0q1CvbfJOpsDE0pl3RHHk 7NbxbCTbI6eRM+OB+LUpeLMuE6mwguzLs7t1OatTzeVOKGKrgzn6shCs5tJjeZfRFeUn jbPA== ARC-Message-Signature: i=2; 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=jokTckctzJGZx54kn2OoTfaUts6J5fPPiEFPTgkvFQU=; fh=lWFC9d7jJSiNqATg8HCbo845G0U9cpMSp26bBLEa5gM=; b=j02Xh3zAyLrh7uLw8v+FLAVElUGosI6/FUx1tGHnix3dK84bP329WoW8vKFjjb69bZ mNrkZXl1pmK1wCZUZKT9Vsvc1OTm5/YCrm1SZBNB05Y2WxHz0BYIHvKD+P3TOzLmOf/F lkNn/Sac/IFNu4Kfq//Q/cDP+xDoXs7Qh3b5Nj9fWqFWgeyTXBJ7wRRHLtMZOKfu0Ork sXotAW9dxc9s7Qty+56JYt8VFBxfaUuw8juUUZ3aqqzWKMGs+71cbSEuz4ogUuEQ4LJH o30WIxMwvRbTXzKuCssSr4KwiFalALhS+Y9X4hSdmMhWik78NhmXfT/qRN4bdk+TNA8z r9KQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=aDWr574r; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siddh.me Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z10-20020a056a00240a00b006cbc1f9b4e0si6653299pfh.261.2023.11.25.12.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:27:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=aDWr574r; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siddh.me Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 886B0801E0FE; Sat, 25 Nov 2023 12:27:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbjKYU1K (ORCPT + 99 others); Sat, 25 Nov 2023 15:27:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbjKYU1F (ORCPT ); Sat, 25 Nov 2023 15:27:05 -0500 Received: from sender-of-o51.zoho.in (sender-of-o51.zoho.in [103.117.158.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B582110; Sat, 25 Nov 2023 12:27:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700943997; cv=none; d=zohomail.in; s=zohoarc; b=CG/6YhYXSiA5o5lvnsjgbz7aLpPRNl4YXm976la8f/2GIZvRCRzdhQb2f4dKW/TT/QNVQaG5auUOiW0MNHU3dIXOfP1xzLahWzQ1BGH6e1E9FL3uJ49uwfJXBNdeLJ3kLLZnfMgDO985BxpQQk6v95aS/gcjB0FniKVyYcaxTWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1700943997; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=jokTckctzJGZx54kn2OoTfaUts6J5fPPiEFPTgkvFQU=; b=P7LvR7B5qeEGzTC+VoxGb//U+UGwUXPt4R7tYkjO9TwhGl/uQAu87JPGOadm6DIYmqBzd8OG++Tv27oWUrCpVhihB0PbXC/s6qJ4lGOQK3y6lMMKGaMBUaOoM9qoMmWvqkqlMyeS083z02Z3eNVpVR+O1jqSK5+NzhFHoL2OLWg= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1700943997; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=jokTckctzJGZx54kn2OoTfaUts6J5fPPiEFPTgkvFQU=; b=aDWr574rrke4JA3n2T/oeX65rRJaWiCazf5v/whS1uwzqo7U6qyXXk28tmoNPI9Q lpTlK02r6wV1f5BkhKTouF+Ae+DLCwPVn4EnNxOMh5plyBRoNAZLKFm59OPQUzOs5/E YacV251mdlRVJQx+A/bz0yu8+Q+5Ckxaw0nVbUK4= Received: from kampyooter.. (110.226.61.26 [110.226.61.26]) by mx.zoho.in with SMTPS id 1700943996154743.8918060401706; Sun, 26 Nov 2023 01:56:36 +0530 (IST) From: Siddh Raman Pant To: Krzysztof Kozlowski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] nfc: llcp_sock_sendmsg: Reformat code to make the smaller block indented Date: Sun, 26 Nov 2023 01:56:19 +0530 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:27:39 -0800 (PST) The block for datagram sending is a significantly bigger chunk of the function compared to the other scenario. Thus, put the significantly smaller block inside the if-block. Signed-off-by: Siddh Raman Pant --- net/nfc/llcp_sock.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 603f2219b62f..3f1a39e54aa1 100644 --- a/net/nfc/llcp_sock.c +++ b/net/nfc/llcp_sock.c @@ -795,34 +795,32 @@ static int llcp_sock_sendmsg(struct socket *sock, struct msghdr *msg, return -ENODEV; } - if (sk->sk_type == SOCK_DGRAM) { - if (sk->sk_state != LLCP_BOUND) { - release_sock(sk); - return -ENOTCONN; - } + if (sk->sk_type != SOCK_DGRAM) { + release_sock(sk); - DECLARE_SOCKADDR(struct sockaddr_nfc_llcp *, addr, - msg->msg_name); + if (sk->sk_state != LLCP_CONNECTED) + return -ENOTCONN; - if (msg->msg_namelen < sizeof(*addr)) { - release_sock(sk); - return -EINVAL; - } + return nfc_llcp_send_i_frame(llcp_sock, msg, len); + } + if (sk->sk_state != LLCP_BOUND) { release_sock(sk); - - return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap, - msg, len); + return -ENOTCONN; } - if (sk->sk_state != LLCP_CONNECTED) { + DECLARE_SOCKADDR(struct sockaddr_nfc_llcp *, addr, msg->msg_name); + + if (msg->msg_namelen < sizeof(*addr)) { release_sock(sk); - return -ENOTCONN; + return -EINVAL; } release_sock(sk); - return nfc_llcp_send_i_frame(llcp_sock, msg, len); + return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap, + msg, len); + } static int llcp_sock_recvmsg(struct socket *sock, struct msghdr *msg, -- 2.42.0