Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3047686yba; Sat, 11 May 2019 02:33:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR59NW37KI9vIT1qQFrFlnbX1TlBNL2iBfMFWTm+YdlpR3Cs4gYoy2BBrWqyoE0ovqb2Ll X-Received: by 2002:aa7:8dc3:: with SMTP id j3mr20449872pfr.141.1557567205389; Sat, 11 May 2019 02:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557567205; cv=none; d=google.com; s=arc-20160816; b=db28pZv6YMZ8oCk7ZUhImgm98rhOaovUCrr4GrYMJlEYK8XSPkA/VC0n0J2RdjuruC WHKRoUJ0ZS4Qlh8nW6gAkiCl0HLS3di8Jg0mibgffiwzYXLVf1bU5k+4YWe5MWRB/56x OuM7aqcU1eitJ82P0A/Rz8WutE8BB1TOxPnmjeamIE/Gl36Vjf7XC5yvVUtdKh2QMcIA hP5C5w1icKR9oQt04H3O/+b/btXOBx1BQElgvft4ZmXXNv40yESt/XweRYL2YzN7obfg x8ANR68iz1fLzu0nUk+rhNkBILKmFQtyjwah2fRmG3+WoxcnyjB3xhS8PFq3x0/jZTQc BN2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=cjTU4+uCmuJ0Yl4gp0FKzJLeKrgb5vL6eBPDXpXp/sA=; b=RFPDcEveWOOQa566xU2ysM84zhVhDR+8L0YnLxiBIWirlKjT/GXPukGH2MEH3nih5B vz2x7MiTa19V1naZ/Chz17BvxGFvLTwVDEpJgUA+iUJGCknExoOiiKFvV8n4QJfJWEOY emIaoKHqlcXhpTplDEWIi0yQ1CYJ+FWTpvQDG8AzfA95Ks8HjPKOOiiq+ec5bFEYlIEd PMbPNRIm0902l/5MAcPjGtQM4rABPRz+K0Uz50RG5FFsECJNyw3TM57o73aLCZOtVWMH 1q+VgrGPtU1K7u4Z3Uwuc9tS0eTtHys6TQwgVejIHlGPQiNCV2j4iVzlvh7q0z7JKVZL k/EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=isjLUCTo; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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. [209.132.180.67]) by mx.google.com with ESMTP id 14si9645663ple.218.2019.05.11.02.32.52; Sat, 11 May 2019 02:33:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=isjLUCTo; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 S1726941AbfEKJcg (ORCPT + 99 others); Sat, 11 May 2019 05:32:36 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41875 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfEKJcg (ORCPT ); Sat, 11 May 2019 05:32:36 -0400 Received: by mail-pl1-f193.google.com with SMTP id f12so1938249plt.8; Sat, 11 May 2019 02:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=cjTU4+uCmuJ0Yl4gp0FKzJLeKrgb5vL6eBPDXpXp/sA=; b=isjLUCToOhKYz4fsEzEXiHviDVgUBwtR4ealGTQhSNkBISnGWNBD/U53iUBuPYU8Sl XJU+PZdLZw8iQEbxjiIY+IVqRn6YciuB2IoCoWEc39mOtH6bwLquQMMNJq62STuxAO3l UN366TgrQy8PNWqonJ8I2dOo9cvc4WwIbMtwORDRzodYNBbXfTBP6dbm88BE7A4ca+S3 kjo698hHF44VZ7lEnwJaS5F6g8Df1K/apa2CXcBMxjXSOK0U6Ro6HZwShC+A19YJ/D3p rs/Ec7Um85PbYxfLXuqlHvp2L0xyuSTUNUKm5adQN7szjTNAbV1lTscNdWDwoap9SwzB eOPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=cjTU4+uCmuJ0Yl4gp0FKzJLeKrgb5vL6eBPDXpXp/sA=; b=NiVr3MWmwkPMJW6RvDQY5xRu1jLM7+7GtjcJjJtFNN5eyEl79+tJGE+tdQBpmP/yK2 MjXqQC4PnAnoAsxKXE4EFnEvti3rsvoZPHW7ZxCANBTG3F/x5H+OJCrrYmdRjksPPyYM Rf6f5sPjz9rPGEe1nmpU1CeFSZaL8oRvWnbIqvdcf0G1VQqTuhblvZU4NTZt37loskL4 Y7zUZ6kKAGCxHscjWzMcQrdkpjbQMqf+fawpwTaPfrQSnX5OKoDr/jfjRjzRbbHraX7D /ZB54T/qVPtR5V4iN+uT6siqi3H1w6cn2UfUD0SYvWwBGY7o9PesLPHqF/bPmNH6UMBn p6oA== X-Gm-Message-State: APjAAAUk6ubtNnCZlUyihn/lruC5QkM7azdGZ/kZkHyhmN5AbA3uCDIh d8meB1LB7i53MzdDSp8OBvM= X-Received: by 2002:a17:902:2a07:: with SMTP id i7mr19428997plb.125.1557567155676; Sat, 11 May 2019 02:32:35 -0700 (PDT) Received: from bharath12345-Inspiron-5559 ([103.110.42.34]) by smtp.gmail.com with ESMTPSA id o73sm22880681pfi.137.2019.05.11.02.32.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 May 2019 02:32:35 -0700 (PDT) Date: Sat, 11 May 2019 15:02:28 +0530 From: Bharath Vedartham To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] nfs/dns_resolve.c: Move redundant headers to the top Message-ID: <20190511093228.GA8757@bharath12345-Inspiron-5559> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org NFS uses either the kernel's DNS service or its own depending on whether CONFIG_NFS_USE_KERNEL_DNS is enabled or not. 4 header files which are: (i) #include (ii) #include (iii) #include (iv) #include "dns_resolve.h" These 4 header files are used regardless of whether CONFIG_NFS_USE_KERNEL_DNS is enabled or not. But they have been included under #ifdef CONFIG_NFS_USE_KERNEL_DNS and also the #else section(if CONFIG_NFS_USE_KERNEL_DNS is not enabled). Move these redundant headers to the top of the file i.e include them before #ifdef CONFIG_NFS_USE_KERNEL_DNS. Tested by compiling the kernel and also running ./scripts/checkincludes.pl on fs/nfs/dns_resolve.c Signed-off-by: Bharath Vedartham --- fs/nfs/dns_resolve.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index a7d3df8..b34e575 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -7,14 +7,15 @@ * Resolves DNS hostnames into valid ip addresses */ -#ifdef CONFIG_NFS_USE_KERNEL_DNS - #include #include #include -#include #include "dns_resolve.h" +#ifdef CONFIG_NFS_USE_KERNEL_DNS + +#include + ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, struct sockaddr *sa, size_t salen) { @@ -33,24 +34,19 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, #else -#include #include #include #include #include -#include #include #include #include -#include -#include #include #include #include #include #include "nfs4_fs.h" -#include "dns_resolve.h" #include "cache_lib.h" #include "netns.h" -- 2.7.4