Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2019 11:20:06 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r350822 - stable/12/sys/arm/include
Message-ID:  <201908091120.x79BK66h011817@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Fri Aug  9 11:20:05 2019
New Revision: 350822
URL: https://svnweb.freebsd.org/changeset/base/350822

Log:
  MFC r345296:
  
    Use named field's initializer when constructing <foo>_platform structure.  In
    current code, the delay argument in FDT_PLATFORM_DEF(2) improperly initialize
    refs field from kobj_class structure instead of delay_count field.  This
    causes not working DELAY() function (due to never initialized delay_count) in
    earlier boot stages, until the first timer was attached.

Modified:
  stable/12/sys/arm/include/platformvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/include/platformvar.h
==============================================================================
--- stable/12/sys/arm/include/platformvar.h	Fri Aug  9 10:33:23 2019	(r350821)
+++ stable/12/sys/arm/include/platformvar.h	Fri Aug  9 11:20:05 2019	(r350822)
@@ -90,22 +90,22 @@ typedef struct fdt_platform_class fdt_platform_def_t;
 
 extern platform_method_t fdt_platform_methods[];
 
-#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible,	\
-    delay)								\
-CTASSERT(delay > 0);							\
+#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, _size, _compatible,	\
+    _delay)								\
+CTASSERT(_delay > 0);							\
 static fdt_platform_def_t VAR_NAME ## _fdt_platform = {			\
 	.name = NAME_STR,						\
 	.methods = fdt_platform_methods,				\
-	.fdt_compatible = compatible,					\
+	.fdt_compatible = _compatible,					\
 };									\
 static kobj_class_t VAR_NAME ## _baseclasses[] =			\
 	{ (kobj_class_t)&VAR_NAME ## _fdt_platform, NULL };		\
 static platform_def_t VAR_NAME ## _platform = {				\
-	NAME_STR,							\
-	NAME ## _methods,						\
-	size,								\
-	VAR_NAME ## _baseclasses,					\
-	delay,								\
+	.name = NAME_STR,						\
+	.methods = NAME ## _methods,					\
+	.size = _size,							\
+	.baseclasses = VAR_NAME ## _baseclasses,			\
+	.delay_count = _delay,						\
 };									\
 DATA_SET(platform_set, VAR_NAME ## _platform)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908091120.x79BK66h011817>