diff mbox

[1/3] ARM: ATAGS: move atags.h to include/asm so it can be included by files outside kernel/

Message ID 1450965658-2675-2-git-send-email-ivo.g.dimitrov.75@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ivaylo Dimitrov Dec. 24, 2015, 2 p.m. UTC
This is needed by a follow-up patch that saves atags on RX51 device

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 arch/arm/include/asm/atags.h  | 20 ++++++++++++++++++++
 arch/arm/kernel/atags.h       | 20 --------------------
 arch/arm/kernel/atags_parse.c |  3 +--
 arch/arm/kernel/setup.c       |  3 +--
 4 files changed, 22 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/include/asm/atags.h
 delete mode 100644 arch/arm/kernel/atags.h

Comments

Russell King - ARM Linux Dec. 24, 2015, 3:35 p.m. UTC | #1
On Thu, Dec 24, 2015 at 04:00:56PM +0200, Ivaylo Dimitrov wrote:
> This is needed by a follow-up patch that saves atags on RX51 device
> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> ---
>  arch/arm/include/asm/atags.h  | 20 ++++++++++++++++++++
>  arch/arm/kernel/atags.h       | 20 --------------------

Please generate diffs with -M so that it can detect renames and provide
a more sensible diffstat and patch output (so we can see any changes
through the rename.)  However...

>  arch/arm/kernel/atags_parse.c |  3 +--
>  arch/arm/kernel/setup.c       |  3 +--
>  4 files changed, 22 insertions(+), 24 deletions(-)
>  create mode 100644 arch/arm/include/asm/atags.h
>  delete mode 100644 arch/arm/kernel/atags.h
> 
> diff --git a/arch/arm/include/asm/atags.h b/arch/arm/include/asm/atags.h
> new file mode 100644
> index 0000000..ec4164d
> --- /dev/null
> +++ b/arch/arm/include/asm/atags.h
> @@ -0,0 +1,20 @@
> +#ifdef CONFIG_ATAGS_PROC
> +extern void save_atags(struct tag *tags);
> +#else
> +static inline void save_atags(struct tag *tags) { }
> +#endif
> +
> +void convert_to_tag_list(struct tag *tags);
> +
> +#ifdef CONFIG_ATAGS
> +const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer,
> +	unsigned int machine_nr);
> +#else
> +static inline const struct machine_desc *
> +setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
> +{
> +	early_print("no ATAGS support: can't continue\n");
> +	while (true);
> +	unreachable();
> +}
> +#endif
> diff --git a/arch/arm/kernel/atags.h b/arch/arm/kernel/atags.h
> deleted file mode 100644
> index ec4164d..0000000
> --- a/arch/arm/kernel/atags.h
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -#ifdef CONFIG_ATAGS_PROC
> -extern void save_atags(struct tag *tags);
> -#else
> -static inline void save_atags(struct tag *tags) { }
> -#endif

I'd think I'd prefer moving just the above save_atags declaration to
arch/arm/include/asm/setup.h so we're not allowing the rest of this
to be exposed to anyone who includes asm/atags.h.

Thanks.
Ivaylo Dimitrov Dec. 24, 2015, 4:37 p.m. UTC | #2
Nokia N900 legacy userspace needs ATAGS passed by the bootloder to be
available in /proc/atags. With DT booted kernel this information is
no longer availabe. Fix that by saving ATAGS data early in the boot 
stage so it can be exported in /proc/atags later

Ivaylo Dimitrov (2):
  ARM: ATAGS: move save_atags() to include/asm
    arch/arm/include/asm/setup.h
  OMAP: RX51: save ATAGS data in the early boot stage

 arch/arm/include/asm/setup.h        |  6 ++++++
 arch/arm/kernel/atags.h             |  6 ------
 arch/arm/mach-omap2/board-generic.c | 12 +++++++++++-
 3 files changed, 17 insertions(+), 7 deletions(-)
kernel test robot Dec. 25, 2015, 12:56 a.m. UTC | #3
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
Hi Ivaylo,

[auto build test ERROR on omap/for-next]
[also build test ERROR on v4.4-rc6 next-20151223]

url:    https://github.com/0day-ci/linux/commits/Ivaylo-Dimitrov/OMAP-RX51-save-atags-data-to-be-exported-on-proc-atags/20151224-220541
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git for-next
config: arm-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> arch/arm/kernel/atags_compat.c:29:19: fatal error: atags.h: No such file or directory
    #include "atags.h"
                      ^
   compilation terminated.

vim +29 arch/arm/kernel/atags_compat.c

^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  13   * NOTE:
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  14   *  The old struct param_struct is deprecated, but it will be kept in
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  15   *  the kernel for 5 years from now (2001). This will allow boot loaders
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  16   *  to convert to the new struct tag way.
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  17   */
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  18  #include <linux/types.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  19  #include <linux/kernel.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  20  #include <linux/string.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  21  #include <linux/init.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  22  
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  23  #include <asm/setup.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  24  #include <asm/mach-types.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  25  #include <asm/page.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  26  
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  27  #include <asm/mach/arch.h>
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  28  
aa783b6f arch/arm/kernel/atags_compat.c Nicolas Pitre  2012-09-01 @29  #include "atags.h"
0fc1c832 arch/arm/kernel/compat.c       Ben Dooks      2006-03-15  30  
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  31  /*
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  32   * Usage:
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  33   *  - do not go blindly adding fields, add them at the end
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  34   *  - when adding fields, don't rely on the address until
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  35   *    a patch from me has been released
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  36   *  - unused fields should be zero (for future expansion)
^1da177e arch/arm/kernel/compat.c       Linus Torvalds 2005-04-16  37   *  - this structure is relatively short-lived - only

:::::: The code at line 29 was first introduced by commit
:::::: aa783b6fd60b3844e199b1c2d2f4068f3caa1358 ARM: 7505/1: split out ATAGS parsing

:::::: TO: Nicolas Pitre <nicolas.pitre@linaro.org>
:::::: CC: Russell King <rmk+kernel@arm.linux.org.uk>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/arch/arm/include/asm/atags.h b/arch/arm/include/asm/atags.h
new file mode 100644
index 0000000..ec4164d
--- /dev/null
+++ b/arch/arm/include/asm/atags.h
@@ -0,0 +1,20 @@ 
+#ifdef CONFIG_ATAGS_PROC
+extern void save_atags(struct tag *tags);
+#else
+static inline void save_atags(struct tag *tags) { }
+#endif
+
+void convert_to_tag_list(struct tag *tags);
+
+#ifdef CONFIG_ATAGS
+const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer,
+	unsigned int machine_nr);
+#else
+static inline const struct machine_desc *
+setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
+{
+	early_print("no ATAGS support: can't continue\n");
+	while (true);
+	unreachable();
+}
+#endif
diff --git a/arch/arm/kernel/atags.h b/arch/arm/kernel/atags.h
deleted file mode 100644
index ec4164d..0000000
--- a/arch/arm/kernel/atags.h
+++ /dev/null
@@ -1,20 +0,0 @@ 
-#ifdef CONFIG_ATAGS_PROC
-extern void save_atags(struct tag *tags);
-#else
-static inline void save_atags(struct tag *tags) { }
-#endif
-
-void convert_to_tag_list(struct tag *tags);
-
-#ifdef CONFIG_ATAGS
-const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer,
-	unsigned int machine_nr);
-#else
-static inline const struct machine_desc *
-setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
-{
-	early_print("no ATAGS support: can't continue\n");
-	while (true);
-	unreachable();
-}
-#endif
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 68c6ae0..faac2d1 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -28,8 +28,7 @@ 
 #include <asm/system_info.h>
 #include <asm/page.h>
 #include <asm/mach/arch.h>
-
-#include "atags.h"
+#include <asm/atags.h>
 
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 20edd34..aa0193a 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -60,8 +60,7 @@ 
 #include <asm/unwind.h>
 #include <asm/memblock.h>
 #include <asm/virt.h>
-
-#include "atags.h"
+#include <asm/atags.h>
 
 
 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)