All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPICA: Fix return
@ 2022-11-08 11:43 wangkailong
  2022-11-08 13:06   ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: wangkailong @ 2022-11-08 11:43 UTC (permalink / raw)
  To: Moore, Rafael J. Wysocki, Wentland, Li, Siqueira, Deucher,
	Christian König, Pan, Xinhui, Airlie, Vetter
  Cc: linux-acpi, devel, linux-kernel, amd-gfx, dri-devel

return is not a function, parentheses are not required

Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
 drivers/acpi/acpica/evsci.c                     | 12 +++++-------
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++----------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index 3915ff61412b..63dd2aa2d16a 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void)
 
 	/* Are there any host-installed SCI handlers? */
 
-	if (!acpi_gbl_sci_handler_list) {
-		return (int_status);
-	}
+	if (!acpi_gbl_sci_handler_list)
+		return int_status;
 
 	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
 
@@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void)
 	}
 
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
-	return (int_status);
+	return int_status;
 }
 
 /*******************************************************************************
@@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void)
 	    acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
 					     acpi_ev_sci_xrupt_handler);
 
-	if (!acpi_gbl_sci_handler_list) {
-		return (status);
-	}
+	if (!acpi_gbl_sci_handler_list)
+		return status;
 
 	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
 
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 38d71b5c1f2d..66661a20117b 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -29,7 +29,6 @@
 #include "core_types.h"
 #include "resource.h"
 #include "ipp.h"
-#include "timing_generator.h"
 #include "dc_dmub_srv.h"
 
 #define DC_LOGGER dc->ctx->logger
@@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref)
 
 void dc_stream_release(struct dc_stream_state *stream)
 {
-	if (stream != NULL) {
+	if (stream != NULL)
 		kref_put(&stream->refcount, dc_stream_free);
-	}
 }
 
 struct dc_stream_state *dc_create_stream_for_sink(
@@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes(
 	struct dc  *dc;
 	bool reset_idle_optimizations = false;
 
-	if (NULL == stream) {
+	if (stream == NULL) {
 		dm_error("DC: dc_stream is NULL!\n");
 		return false;
 	}
-	if (NULL == attributes) {
+	if (attributes == NULL) {
 		dm_error("DC: attributes is NULL!\n");
 		return false;
 	}
@@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position(
 	struct dc  *dc = stream->ctx->dc;
 	bool reset_idle_optimizations = false;
 
-	if (NULL == stream) {
+	if (stream == NULL) {
 		dm_error("DC: dc_stream is NULL!\n");
 		return false;
 	}
 
-	if (NULL == position) {
+	if (position == NULL) {
 		dm_error("DC: cursor position is NULL!\n");
 		return false;
 	}
@@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc,
 		}
 	}
 
-	if (!isDrc) {
+	if (!isDrc)
 		stream->writeback_info[stream->num_wb_info++] = *wb_info;
-	}
 
 	if (dc->hwss.enable_writeback) {
 		struct dc_stream_status *stream_status = dc_stream_get_status(stream);
@@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
 	/* remove writeback info for disabled writeback pipes from stream */
 	for (i = 0, j = 0; i < stream->num_wb_info; i++) {
 		if (stream->writeback_info[i].wb_enabled) {
-			if (j < i)
+			if (i != j)
 				/* trim the array */
 				stream->writeback_info[j] = stream->writeback_info[i];
 			j++;
-- 
2.36.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPICA: Fix return
  2022-11-08 11:43 [PATCH] ACPICA: Fix return wangkailong
  2022-11-08 13:06   ` Rafael J. Wysocki
@ 2022-11-08 13:06   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-11-08 13:06 UTC (permalink / raw)
  To: wangkailong
  Cc: Moore, Rafael J. Wysocki, Wentland, Li, Siqueira, Deucher,
	Christian König, Pan, Xinhui, Airlie, Vetter, linux-acpi,
	linux-kernel, amd-gfx, dri-devel

On Tue, Nov 8, 2022 at 12:48 PM <wangkailong@jari.cn> wrote:
>
> return is not a function, parentheses are not required
>
> Signed-off-by: KaiLong Wang <wangkailong@jari.cn>

ACPICA material is to be submitted to the upstream project at GitHub
(please see MAINTAINERS for the link).

You may notice, however, that your changes do not align with the
coding style there.

Moreover, the patch contains non-ACPICA changes that are not mentioned
in the changelog.

> ---
>  drivers/acpi/acpica/evsci.c                     | 12 +++++-------
>  drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++----------
>  2 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
> index 3915ff61412b..63dd2aa2d16a 100644
> --- a/drivers/acpi/acpica/evsci.c
> +++ b/drivers/acpi/acpica/evsci.c
> @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void)
>
>         /* Are there any host-installed SCI handlers? */
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (int_status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return int_status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void)
>         }
>
>         acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
> -       return (int_status);
> +       return int_status;
>  }
>
>  /*******************************************************************************
> @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void)
>             acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
>                                              acpi_ev_sci_xrupt_handler);
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 38d71b5c1f2d..66661a20117b 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -29,7 +29,6 @@
>  #include "core_types.h"
>  #include "resource.h"
>  #include "ipp.h"
> -#include "timing_generator.h"
>  #include "dc_dmub_srv.h"
>
>  #define DC_LOGGER dc->ctx->logger
> @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref)
>
>  void dc_stream_release(struct dc_stream_state *stream)
>  {
> -       if (stream != NULL) {
> +       if (stream != NULL)
>                 kref_put(&stream->refcount, dc_stream_free);
> -       }
>  }
>
>  struct dc_stream_state *dc_create_stream_for_sink(
> @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes(
>         struct dc  *dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
> -       if (NULL == attributes) {
> +       if (attributes == NULL) {
>                 dm_error("DC: attributes is NULL!\n");
>                 return false;
>         }
> @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position(
>         struct dc  *dc = stream->ctx->dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
>
> -       if (NULL == position) {
> +       if (position == NULL) {
>                 dm_error("DC: cursor position is NULL!\n");
>                 return false;
>         }
> @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc,
>                 }
>         }
>
> -       if (!isDrc) {
> +       if (!isDrc)
>                 stream->writeback_info[stream->num_wb_info++] = *wb_info;
> -       }
>
>         if (dc->hwss.enable_writeback) {
>                 struct dc_stream_status *stream_status = dc_stream_get_status(stream);
> @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
>         /* remove writeback info for disabled writeback pipes from stream */
>         for (i = 0, j = 0; i < stream->num_wb_info; i++) {
>                 if (stream->writeback_info[i].wb_enabled) {
> -                       if (j < i)
> +                       if (i != j)
>                                 /* trim the array */
>                                 stream->writeback_info[j] = stream->writeback_info[i];
>                         j++;
> --
> 2.36.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPICA: Fix return
@ 2022-11-08 13:06   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-11-08 13:06 UTC (permalink / raw)
  To: wangkailong
  Cc: Pan, Xinhui, Li, Rafael J. Wysocki, Siqueira, Moore, amd-gfx,
	linux-kernel, linux-acpi, dri-devel, Deucher,
	Christian König

On Tue, Nov 8, 2022 at 12:48 PM <wangkailong@jari.cn> wrote:
>
> return is not a function, parentheses are not required
>
> Signed-off-by: KaiLong Wang <wangkailong@jari.cn>

ACPICA material is to be submitted to the upstream project at GitHub
(please see MAINTAINERS for the link).

You may notice, however, that your changes do not align with the
coding style there.

Moreover, the patch contains non-ACPICA changes that are not mentioned
in the changelog.

> ---
>  drivers/acpi/acpica/evsci.c                     | 12 +++++-------
>  drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++----------
>  2 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
> index 3915ff61412b..63dd2aa2d16a 100644
> --- a/drivers/acpi/acpica/evsci.c
> +++ b/drivers/acpi/acpica/evsci.c
> @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void)
>
>         /* Are there any host-installed SCI handlers? */
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (int_status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return int_status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void)
>         }
>
>         acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
> -       return (int_status);
> +       return int_status;
>  }
>
>  /*******************************************************************************
> @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void)
>             acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
>                                              acpi_ev_sci_xrupt_handler);
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 38d71b5c1f2d..66661a20117b 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -29,7 +29,6 @@
>  #include "core_types.h"
>  #include "resource.h"
>  #include "ipp.h"
> -#include "timing_generator.h"
>  #include "dc_dmub_srv.h"
>
>  #define DC_LOGGER dc->ctx->logger
> @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref)
>
>  void dc_stream_release(struct dc_stream_state *stream)
>  {
> -       if (stream != NULL) {
> +       if (stream != NULL)
>                 kref_put(&stream->refcount, dc_stream_free);
> -       }
>  }
>
>  struct dc_stream_state *dc_create_stream_for_sink(
> @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes(
>         struct dc  *dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
> -       if (NULL == attributes) {
> +       if (attributes == NULL) {
>                 dm_error("DC: attributes is NULL!\n");
>                 return false;
>         }
> @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position(
>         struct dc  *dc = stream->ctx->dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
>
> -       if (NULL == position) {
> +       if (position == NULL) {
>                 dm_error("DC: cursor position is NULL!\n");
>                 return false;
>         }
> @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc,
>                 }
>         }
>
> -       if (!isDrc) {
> +       if (!isDrc)
>                 stream->writeback_info[stream->num_wb_info++] = *wb_info;
> -       }
>
>         if (dc->hwss.enable_writeback) {
>                 struct dc_stream_status *stream_status = dc_stream_get_status(stream);
> @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
>         /* remove writeback info for disabled writeback pipes from stream */
>         for (i = 0, j = 0; i < stream->num_wb_info; i++) {
>                 if (stream->writeback_info[i].wb_enabled) {
> -                       if (j < i)
> +                       if (i != j)
>                                 /* trim the array */
>                                 stream->writeback_info[j] = stream->writeback_info[i];
>                         j++;
> --
> 2.36.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPICA: Fix return
@ 2022-11-08 13:06   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-11-08 13:06 UTC (permalink / raw)
  To: wangkailong
  Cc: Pan, Xinhui, Li, Airlie, Rafael J. Wysocki, Siqueira, Moore,
	amd-gfx, linux-kernel, linux-acpi, dri-devel, Vetter, Deucher,
	Wentland, Christian König

On Tue, Nov 8, 2022 at 12:48 PM <wangkailong@jari.cn> wrote:
>
> return is not a function, parentheses are not required
>
> Signed-off-by: KaiLong Wang <wangkailong@jari.cn>

ACPICA material is to be submitted to the upstream project at GitHub
(please see MAINTAINERS for the link).

You may notice, however, that your changes do not align with the
coding style there.

Moreover, the patch contains non-ACPICA changes that are not mentioned
in the changelog.

> ---
>  drivers/acpi/acpica/evsci.c                     | 12 +++++-------
>  drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++----------
>  2 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
> index 3915ff61412b..63dd2aa2d16a 100644
> --- a/drivers/acpi/acpica/evsci.c
> +++ b/drivers/acpi/acpica/evsci.c
> @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void)
>
>         /* Are there any host-installed SCI handlers? */
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (int_status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return int_status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void)
>         }
>
>         acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
> -       return (int_status);
> +       return int_status;
>  }
>
>  /*******************************************************************************
> @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void)
>             acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
>                                              acpi_ev_sci_xrupt_handler);
>
> -       if (!acpi_gbl_sci_handler_list) {
> -               return (status);
> -       }
> +       if (!acpi_gbl_sci_handler_list)
> +               return status;
>
>         flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 38d71b5c1f2d..66661a20117b 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -29,7 +29,6 @@
>  #include "core_types.h"
>  #include "resource.h"
>  #include "ipp.h"
> -#include "timing_generator.h"
>  #include "dc_dmub_srv.h"
>
>  #define DC_LOGGER dc->ctx->logger
> @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref)
>
>  void dc_stream_release(struct dc_stream_state *stream)
>  {
> -       if (stream != NULL) {
> +       if (stream != NULL)
>                 kref_put(&stream->refcount, dc_stream_free);
> -       }
>  }
>
>  struct dc_stream_state *dc_create_stream_for_sink(
> @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes(
>         struct dc  *dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
> -       if (NULL == attributes) {
> +       if (attributes == NULL) {
>                 dm_error("DC: attributes is NULL!\n");
>                 return false;
>         }
> @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position(
>         struct dc  *dc = stream->ctx->dc;
>         bool reset_idle_optimizations = false;
>
> -       if (NULL == stream) {
> +       if (stream == NULL) {
>                 dm_error("DC: dc_stream is NULL!\n");
>                 return false;
>         }
>
> -       if (NULL == position) {
> +       if (position == NULL) {
>                 dm_error("DC: cursor position is NULL!\n");
>                 return false;
>         }
> @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc,
>                 }
>         }
>
> -       if (!isDrc) {
> +       if (!isDrc)
>                 stream->writeback_info[stream->num_wb_info++] = *wb_info;
> -       }
>
>         if (dc->hwss.enable_writeback) {
>                 struct dc_stream_status *stream_status = dc_stream_get_status(stream);
> @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
>         /* remove writeback info for disabled writeback pipes from stream */
>         for (i = 0, j = 0; i < stream->num_wb_info; i++) {
>                 if (stream->writeback_info[i].wb_enabled) {
> -                       if (j < i)
> +                       if (i != j)
>                                 /* trim the array */
>                                 stream->writeback_info[j] = stream->writeback_info[i];
>                         j++;
> --
> 2.36.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-08 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 11:43 [PATCH] ACPICA: Fix return wangkailong
2022-11-08 13:06 ` Rafael J. Wysocki
2022-11-08 13:06   ` Rafael J. Wysocki
2022-11-08 13:06   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.