Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1066313pxu; Thu, 8 Oct 2020 02:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrwe6IocFsUAxbPCAXFtLXJejDl2SLwCdgUskjB666VNwUUEOrHXxQnmf/aOgLx+OYkzc3 X-Received: by 2002:a17:906:d7ad:: with SMTP id pk13mr2465884ejb.33.1602148858403; Thu, 08 Oct 2020 02:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602148858; cv=none; d=google.com; s=arc-20160816; b=RIktcr83L5T8GTJD/EWFqIYwZ4J9uoycIvvdE7kHjt5AF2vLIN1+/ag3Zw2Z7Y0Yb6 Hlx7WhL/S/84bWMpVqK1VhdWNqxGpwSLQgyXsTLZPbl/dwo3ebol1Ry4cu/cZO9FnTyM TlO/n4PpVUb15KNJlzQ7emUyYLcwDRbARecZTdvPbGuNGXqtBfQlY0iREQxmIbKfYuB7 OyOrQEhlmAkLenz+tKb/5jJt/xBxQQQYw6xEcc4oH0/5c7HOY0h4cmP/dF29GmVxqUre cQ6yEc/Ir5SqeEOqnOEcCS7GQbq3u49W388l73QWb1jtLtvdxfY69JjHbIFVmAszW84d /X+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=+5KB05uiotlLpkN7miLgLdnMhnV6BhBBdu1i3GMcEmo=; b=V2lWBdm/E9vwOW0SEkFMJ6oHocqgykKEXnURZagmfww94BG/Hh0xkOKEuxZVQpUWwY Fx8gMhdQkHQlZnNYjtFjO9rwG05HQWEJTLd2FVPH9PPD4gUUOTTgLhXiYBZWba6Ec67W MJ8Cck++cBgCFnZ/A5EXjPTP/v1/YASO249ULWnco644Ty2ybsOHHOVP8TRkYSwehWh2 Mh1mvul/bh5ABup+D5uwPoavsjNcDlOepgypS6SzVE7Iy9YG7DU60aoHet9fKuT32tG1 1BFdfEjVRORzvyM4FvpsgI/gOm5uWtuKn3fP61gjrHwnZkRufiyJX1eTEWgD4i/ZduLt DuJw== ARC-Authentication-Results: i=1; mx.google.com; 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 h12si1356067edn.339.2020.10.08.02.20.35; Thu, 08 Oct 2020 02:20: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; 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 S1728769AbgJHJLf (ORCPT + 99 others); Thu, 8 Oct 2020 05:11:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:38526 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbgJHJLf (ORCPT ); Thu, 8 Oct 2020 05:11:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1143EAD32; Thu, 8 Oct 2020 09:11:34 +0000 (UTC) Date: Thu, 8 Oct 2020 11:11:32 +0200 From: Joerg Roedel To: Arvind Sankar Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] x86/boot: Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h Message-ID: <20201008091132.GE3209@suse.de> References: <20201007195351.776555-1-nivedita@alum.mit.edu> <20201007195351.776555-3-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007195351.776555-3-nivedita@alum.mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 03:53:48PM -0400, Arvind Sankar wrote: > Move get_cmd_line_ptr() and COMMAND_LINE_SIZE into misc.h for easier > use from multiple files. > > Signed-off-by: Arvind Sankar > --- > arch/x86/boot/compressed/cmdline.c | 8 -------- > arch/x86/boot/compressed/kaslr.c | 6 ------ > arch/x86/boot/compressed/misc.h | 13 +++++++++++++ > 3 files changed, 13 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c > index f1add5d85da9..d0e1d386749d 100644 > --- a/arch/x86/boot/compressed/cmdline.c > +++ b/arch/x86/boot/compressed/cmdline.c > @@ -12,14 +12,6 @@ static inline char rdfs8(addr_t addr) > return *((char *)(fs + addr)); > } > #include "../cmdline.c" > -unsigned long get_cmd_line_ptr(void) > -{ > - unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr; > - > - cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32; > - > - return cmd_line_ptr; > -} > int cmdline_find_option(const char *option, char *buffer, int bufsize) > { > return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize); > diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c > index b59547ce5b19..f3286a3bef36 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -36,12 +36,6 @@ > #define STATIC > #include > > -#define _SETUP > -#include /* For COMMAND_LINE_SIZE */ > -#undef _SETUP > - > -extern unsigned long get_cmd_line_ptr(void); > - > /* Simplified build-specific string for starting entropy. */ > static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" > LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION; > diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h > index 6d31f1b4c4d1..95aacc361f78 100644 > --- a/arch/x86/boot/compressed/misc.h > +++ b/arch/x86/boot/compressed/misc.h > @@ -25,6 +25,10 @@ > #include > #include > > +#define _SETUP > +#include /* For COMMAND_LINE_SIZE */ > +#undef _SETUP > + > #define BOOT_CTYPE_H > #include > > @@ -70,6 +74,15 @@ static inline void debug_puthex(unsigned long value) > #endif > > /* cmdline.c */ > +static inline > +unsigned long get_cmd_line_ptr(void) > +{ > + unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr; > + > + cmd_line_ptr |= (u64)boot_params->ext_cmd_line_ptr << 32; > + > + return cmd_line_ptr; > +} > int cmdline_find_option(const char *option, char *buffer, int bufsize); > int cmdline_find_option_bool(const char *option); Reviewed-by: Joerg Roedel