Skip to contentSkip to conversation

drm/exynos/decon: Add include guard to the Exynos7 header

PATCH In review Krzysztof Kozlowski 2 participants 6 messages Jun 19, 2017 – Jun 20, 2017

Subsystems (4)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/2 drm/exynos/decon: Add include guard to the Exynos7 header

Although header is included only once but still having an include guard is a good practice. To avoid confusion, add SoC prefix to existing Exynos5433 header include guard.

---
 include/video/exynos5433_decon.h | 6 +++---
 include/video/exynos7_decon.h    | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
include/video/exynos5433_decon.h +3 -3
index 78957c9626f5..b30362da5692 100644
@@ -6,8 +6,8 @@
  * published by the Free Software Foundationr
  */
 
-#ifndef EXYNOS_REGS_DECON_H
-#define EXYNOS_REGS_DECON_H
+#ifndef EXYNOS5433_REGS_DECON_H
+#define EXYNOS5433_REGS_DECON_H
 
 /* Exynos543X DECON */
 #define DECON_VIDCON0			0x0000
@@ -206,4 +206,4 @@
 #define CRCCTRL_CRCEN			(0x1 << 0)
 #define CRCCTRL_MASK			(0x7)
 
-#endif /* EXYNOS_REGS_DECON_H */
+#endif /* EXYNOS5433_REGS_DECON_H */
include/video/exynos7_decon.h +5 -0
index a62b11b613f6..d28829659a17 100644
@@ -9,6 +9,9 @@
  * option) any later version.
  */
 
+#ifndef EXYNOS7_REGS_DECON_H
+#define EXYNOS7_REGS_DECON_H
+
 /* VIDCON0 */
 #define VIDCON0					0x00
 
@@ -347,3 +350,5 @@
 
 #define DECON_UPDATE_SLAVE_SYNC			(1 << 4)
 #define DECON_UPDATE_STANDALONE_F		(1 << 0)
+
+#endif /* EXYNOS7_REGS_DECON_H */
Signature · 1 line
2.9.3
author maintainer
#1 lore raw

PATCH 2/2 drm/exynos/decon: Move headers from global to local place

The DECON headers contain only defines for registers. There are no other drivers using them so this should be put locally to the Exynos DRM driver. Keeping headers local helps managing the code.

---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c                          | 3 +--
 drivers/gpu/drm/exynos/exynos7_drm_decon.c                             | 2 +-
 .../exynos5433_decon.h => drivers/gpu/drm/exynos/regs-decon5433.h      | 0
 include/video/exynos7_decon.h => drivers/gpu/drm/exynos/regs-decon7.h  | 3 +--
 4 files changed, 3 insertions(+), 5 deletions(-)
 rename include/video/exynos5433_decon.h => drivers/gpu/drm/exynos/regs-decon5433.h (100%)
 rename include/video/exynos7_decon.h => drivers/gpu/drm/exynos/regs-decon7.h (99%)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +1 -2
index 5792ca88ab7a..5aca8c16f2bc 100644
@@ -19,13 +19,12 @@
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
-#include <video/exynos5433_decon.h>
-
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_plane.h"
 #include "exynos_drm_iommu.h"
+#include "regs-decon5433.h"
 
 #define DSD_CFG_MUX 0x1004
 #define DSD_CFG_MUX_TE_UNMASK_GLOBAL BIT(13)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +1 -1
index 3e88269fdc2e..387e436c97d2 100644
@@ -25,13 +25,13 @@
 
 #include <video/of_display_timing.h>
 #include <video/of_videomode.h>
-#include <video/exynos7_decon.h>
 
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_plane.h"
 #include "exynos_drm_drv.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_iommu.h"
+#include "regs-decon7.h"
 
 /*
  * DECON stands for Display and Enhancement controller.
drivers/gpu/drm/exynos/regs-decon5433.h renamed from include/video/exynos5433_decon.h +0 -0
similarity index 100%
rename from include/video/exynos5433_decon.h
rename to drivers/gpu/drm/exynos/regs-decon5433.h
drivers/gpu/drm/exynos/regs-decon7.h renamed from include/video/exynos7_decon.h +1 -2
similarity index 99%
rename from include/video/exynos7_decon.h
rename to drivers/gpu/drm/exynos/regs-decon7.h
index d28829659a17..8fe4c44f12f3 100644
@@ -1,5 +1,4 @@
-/* include/video/exynos7_decon.h
- *
+/*
  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  * Author: Ajay Kumar <[email protected]>
  *
Signature · 1 line
2.9.3
#2 lore raw
In reply to Krzysztof Kozlowski
Quoted 15 lines · Krzysztof Kozlowski

Although header is included only once but still having an include guard is a good practice. To avoid confusion, add SoC prefix to existing Exynos5433 header include guard.

---
 include/video/exynos5433_decon.h | 6 +++---
 include/video/exynos7_decon.h    | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
include/video/exynos5433_decon.h +0 -0
index 78957c9626f5..b30362da5692 100644

include/video/exynos5433_decon.h line 11

Quoted 8 lines
include/video/exynos5433_decon.h +2 -2
@@ -6,8 +6,8 @@
  * published by the Free Software Foundationr
  */
 
-#ifndef EXYNOS_REGS_DECON_H
-#define EXYNOS_REGS_DECON_H
+#ifndef EXYNOS5433_REGS_DECON_H
+#define EXYNOS5433_REGS_DECON_H
 

Drop the _REGS_ part from the guard on each header? The file name/path does not have it, plus it'll save some WTF moments when exynos{5433,7}_regs_decon.h comes about.

Regards,
Emil

author maintainer
#3 lore raw
Quoted 19 lines · Emil Velikov
Quoted 18 lines · Krzysztof Kozlowski

Although header is included only once but still having an include guard is a good practice. To avoid confusion, add SoC prefix to existing Exynos5433 header include guard.

---
 include/video/exynos5433_decon.h | 6 +++---
 include/video/exynos7_decon.h    | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
include/video/exynos5433_decon.h +0 -0
index 78957c9626f5..b30362da5692 100644
@@ -6,8 +6,8 @@
  * published by the Free Software Foundationr
  */
 
Quoted 8 lines

include/video/exynos5433_decon.h line 11

Quoted 5 lines
include/video/exynos5433_decon.h +2 -2
-#ifndef EXYNOS_REGS_DECON_H
-#define EXYNOS_REGS_DECON_H
+#ifndef EXYNOS5433_REGS_DECON_H
+#define EXYNOS5433_REGS_DECON_H
 

Drop the _REGS_ part from the guard on each header? The file name/path does not have it, plus it'll save some WTF moments when exynos{5433,7}_regs_decon.h comes about.

So maybe it makes sense to reorder these patches and use the guard name matching final file name?

Best regards,
Krzysztof

#4 lore raw
Quoted 29 lines · Krzysztof Kozlowski
Quoted 19 lines · Emil Velikov
Quoted 18 lines · Krzysztof Kozlowski

Although header is included only once but still having an include guard is a good practice. To avoid confusion, add SoC prefix to existing Exynos5433 header include guard.

---
 include/video/exynos5433_decon.h | 6 +++---
 include/video/exynos7_decon.h    | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
include/video/exynos5433_decon.h +0 -0
index 78957c9626f5..b30362da5692 100644
@@ -6,8 +6,8 @@
  * published by the Free Software Foundationr
  */
 
Quoted 8 lines

include/video/exynos5433_decon.h line 11

Quoted 5 lines
include/video/exynos5433_decon.h +2 -2
-#ifndef EXYNOS_REGS_DECON_H
-#define EXYNOS_REGS_DECON_H
+#ifndef EXYNOS5433_REGS_DECON_H
+#define EXYNOS5433_REGS_DECON_H
 

Drop the _REGS_ part from the guard on each header? The file name/path does not have it, plus it'll save some WTF moments when exynos{5433,7}_regs_decon.h comes about.

Quoted 3 lines

So maybe it makes sense to reorder these patches and use the guard name matching final file name?

That sounds better, IMHO.

-Emil

author maintainer
#5 lore raw
Quoted 30 lines · Emil Velikov
Quoted 29 lines · Krzysztof Kozlowski
Quoted 27 lines · Emil Velikov
Quoted 15 lines · Krzysztof Kozlowski

Although header is included only once but still having an include guard is a good practice. To avoid confusion, add SoC prefix to existing Exynos5433 header include guard.

---
 include/video/exynos5433_decon.h | 6 +++---
 include/video/exynos7_decon.h    | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
include/video/exynos5433_decon.h +0 -0
index 78957c9626f5..b30362da5692 100644

include/video/exynos5433_decon.h line 11

Quoted 8 lines
include/video/exynos5433_decon.h +2 -2
@@ -6,8 +6,8 @@
  * published by the Free Software Foundationr
  */
 
-#ifndef EXYNOS_REGS_DECON_H
-#define EXYNOS_REGS_DECON_H
+#ifndef EXYNOS5433_REGS_DECON_H
+#define EXYNOS5433_REGS_DECON_H
 

Drop the _REGS_ part from the guard on each header? The file name/path does not have it, plus it'll save some WTF moments when exynos{5433,7}_regs_decon.h comes about.

Quoted 4 lines
Quoted 3 lines

So maybe it makes sense to reorder these patches and use the guard name matching final file name?

That sounds better, IMHO.

OK then, I'll re-order the patches and use matching name (EXYNOS_REGS_DECON{5433,7}_H).

Best regards,
Krzysztof