Skip to contentSkip to conversation

amd/amdgpu: optimise CONFIG_X||CONFIG_X_MODULE to IS_ENABLED(X)

PATCH In review Bernard Zhao 2 participants 2 messages Nov 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amd/amdgpu: optimise CONFIG_X||CONFIG_X_MODULE to IS_ENABLED(X)

Optimise CONFIG_<X> || CONFIG_<X>_MODULE to IS_ENABLED(<X>). This change also fix check_patch.pl warning:
WARNING: Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +3 -3
index 165b02e267b0..f1980cd1f402 100644
@@ -64,7 +64,7 @@ struct amdgpu_atif {
 	struct amdgpu_atif_notifications notifications;
 	struct amdgpu_atif_functions functions;
 	struct amdgpu_atif_notification_cfg notification_cfg;
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
 	struct backlight_device *bd;
 #endif
 	struct amdgpu_dm_backlight_caps backlight_caps;
@@ -447,7 +447,7 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
 		DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
 
 		if (req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) {
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
 			if (atif->bd) {
 				DRM_DEBUG_DRIVER("Changing brightness to %d\n",
 						 req.backlight_level);
@@ -806,7 +806,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 	}
 	adev->atif = atif;
 
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
 	if (atif->notifications.brightness_change) {
 		if (amdgpu_device_has_dc_support(adev)) {
 #if defined(CONFIG_DRM_AMD_DC)
Signature · 1 line
2.29.0
maintainer Acked-by on v1 1/1
#1 lore raw

Am 18.11.20 um 04:43 schrieb Bernard Zhao:

Quoted 8 lines

Optimise CONFIG_<X> || CONFIG_<X>_MODULE to IS_ENABLED(<X>). This change also fix check_patch.pl warning:
WARNING: Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)

Quoted 27 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +2 -2
index 165b02e267b0..f1980cd1f402 100644
@@ -64,7 +64,7 @@ struct amdgpu_atif {
  	struct amdgpu_atif_notifications notifications;
  	struct amdgpu_atif_functions functions;
  	struct amdgpu_atif_notification_cfg notification_cfg;
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
  	struct backlight_device *bd;
  #endif
  	struct amdgpu_dm_backlight_caps backlight_caps;
@@ -447,7 +447,7 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
  		DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
 
  		if (req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) {
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
  			if (atif->bd) {
  				DRM_DEBUG_DRIVER("Changing brightness to %d\n",
  						 req.backlight_level);

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c int amdgpu_acpi_init(struct amdgpu_device *adev) · line 812

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +1 -1
@@ -806,7 +806,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
  	}
  	adev->atif = atif;
 
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
  	if (atif->notifications.brightness_change) {
  		if (amdgpu_device_has_dc_support(adev)) {
  #if defined(CONFIG_DRM_AMD_DC)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx