]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: core: Guard against including dm.h in header files
authorSimon Glass <sjg@chromium.org>
Sun, 19 Jul 2020 16:15:59 +0000 (10:15 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 4 Aug 2020 02:19:54 +0000 (22:19 -0400)
Header files generally should not include header files just for a struct,
since forward declarations work just as well and reduce overhead.

Add a warning for dm.h being included, since this has crept into U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/dm.h

index 2e1afda440207b637c97a2d535acc48a0b30a55b..a1b84169e64a552ee0c7980395b308fe20fdac22 100644 (file)
@@ -3,6 +3,10 @@
  * Copyright (c) 2013 Google, Inc
  */
 
+#ifdef _DM_H_
+#warning "Suspect dm.h is included from a header file - please fix"
+#endif
+
 #ifndef _DM_H_
 #define _DM_H_