Commit 2d0b69fc authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/amd/display: Clean up style problems in amdgpu_dm_irq.c

Fix the following warnings reported by checkpatch:

WARNING: Block comments use a trailing */ on a separate line
WARNING: Comparisons should place the constant on the right side of the test
WARNING: space prohibited between function name and open parenthesis '('
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0c2d77be
...@@ -120,7 +120,8 @@ static void dm_irq_work_func(struct work_struct *work) ...@@ -120,7 +120,8 @@ static void dm_irq_work_func(struct work_struct *work)
/* Call a DAL subcomponent which registered for interrupt notification /* Call a DAL subcomponent which registered for interrupt notification
* at INTERRUPT_LOW_IRQ_CONTEXT. * at INTERRUPT_LOW_IRQ_CONTEXT.
* (The most common use is HPD interrupt) */ * (The most common use is HPD interrupt)
*/
} }
/* /*
...@@ -172,7 +173,8 @@ static struct list_head *remove_irq_handler(struct amdgpu_device *adev, ...@@ -172,7 +173,8 @@ static struct list_head *remove_irq_handler(struct amdgpu_device *adev,
if (handler_removed == false) { if (handler_removed == false) {
/* Not necessarily an error - caller may not /* Not necessarily an error - caller may not
* know the context. */ * know the context.
*/
return NULL; return NULL;
} }
...@@ -261,7 +263,7 @@ validate_irq_registration_params(struct dc_interrupt_params *int_params, ...@@ -261,7 +263,7 @@ validate_irq_registration_params(struct dc_interrupt_params *int_params,
static bool validate_irq_unregistration_params(enum dc_irq_source irq_source, static bool validate_irq_unregistration_params(enum dc_irq_source irq_source,
irq_handler_idx handler_idx) irq_handler_idx handler_idx)
{ {
if (DAL_INVALID_IRQ_HANDLER_IDX == handler_idx) { if (handler_idx == DAL_INVALID_IRQ_HANDLER_IDX) {
DRM_ERROR("DM_IRQ: invalid handler_idx==NULL!\n"); DRM_ERROR("DM_IRQ: invalid handler_idx==NULL!\n");
return false; return false;
} }
...@@ -343,7 +345,8 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev, ...@@ -343,7 +345,8 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,
/* This pointer will be stored by code which requested interrupt /* This pointer will be stored by code which requested interrupt
* registration. * registration.
* The same pointer will be needed in order to unregister the * The same pointer will be needed in order to unregister the
* interrupt. */ * interrupt.
*/
DRM_DEBUG_KMS( DRM_DEBUG_KMS(
"DM_IRQ: added irq handler: %p for: dal_src=%d, irq context=%d\n", "DM_IRQ: added irq handler: %p for: dal_src=%d, irq context=%d\n",
...@@ -390,7 +393,8 @@ void amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev, ...@@ -390,7 +393,8 @@ void amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev,
if (handler_list == NULL) { if (handler_list == NULL) {
/* If we got here, it means we searched all irq contexts /* If we got here, it means we searched all irq contexts
* for this irq source, but the handler was not found. */ * for this irq source, but the handler was not found.
*/
DRM_ERROR( DRM_ERROR(
"DM_IRQ: failed to find irq handler:%p for irq_source:%d!\n", "DM_IRQ: failed to find irq handler:%p for irq_source:%d!\n",
ih, irq_source); ih, irq_source);
...@@ -450,7 +454,8 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev) ...@@ -450,7 +454,8 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev)
DM_IRQ_TABLE_LOCK(adev, irq_table_flags); DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
/* The handler was removed from the table, /* The handler was removed from the table,
* it means it is safe to flush all the 'work' * it means it is safe to flush all the 'work'
* (because no code can schedule a new one). */ * (because no code can schedule a new one).
*/
lh = &adev->dm.irq_handler_list_low_tab[src]; lh = &adev->dm.irq_handler_list_low_tab[src];
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
...@@ -494,7 +499,7 @@ int amdgpu_dm_irq_suspend(struct amdgpu_device *adev) ...@@ -494,7 +499,7 @@ int amdgpu_dm_irq_suspend(struct amdgpu_device *adev)
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
if (!list_empty(hnd_list_l)) { if (!list_empty(hnd_list_l)) {
list_for_each_safe (entry, tmp, hnd_list_l) { list_for_each_safe(entry, tmp, hnd_list_l) {
handler = list_entry( handler = list_entry(
entry, entry,
struct amdgpu_dm_irq_handler_data, struct amdgpu_dm_irq_handler_data,
...@@ -571,7 +576,7 @@ static void amdgpu_dm_irq_schedule_work(struct amdgpu_device *adev, ...@@ -571,7 +576,7 @@ static void amdgpu_dm_irq_schedule_work(struct amdgpu_device *adev,
if (list_empty(handler_list)) if (list_empty(handler_list))
return; return;
list_for_each_entry (handler_data, handler_list, list) { list_for_each_entry(handler_data, handler_list, list) {
if (queue_work(system_highpri_wq, &handler_data->work)) { if (queue_work(system_highpri_wq, &handler_data->work)) {
work_queued = true; work_queued = true;
break; break;
...@@ -627,7 +632,8 @@ static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev, ...@@ -627,7 +632,8 @@ static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev,
&adev->dm.irq_handler_list_high_tab[irq_source], &adev->dm.irq_handler_list_high_tab[irq_source],
list) { list) {
/* Call a subcomponent which registered for immediate /* Call a subcomponent which registered for immediate
* interrupt notification */ * interrupt notification
*/
handler_data->handler(handler_data->handler_arg); handler_data->handler(handler_data->handler_arg);
} }
...@@ -664,7 +670,7 @@ static int amdgpu_dm_irq_handler(struct amdgpu_device *adev, ...@@ -664,7 +670,7 @@ static int amdgpu_dm_irq_handler(struct amdgpu_device *adev,
return 0; return 0;
} }
static enum dc_irq_source amdgpu_dm_hpd_to_dal_irq_source(unsigned type) static enum dc_irq_source amdgpu_dm_hpd_to_dal_irq_source(unsigned int type)
{ {
switch (type) { switch (type) {
case AMDGPU_HPD_1: case AMDGPU_HPD_1:
...@@ -686,7 +692,7 @@ static enum dc_irq_source amdgpu_dm_hpd_to_dal_irq_source(unsigned type) ...@@ -686,7 +692,7 @@ static enum dc_irq_source amdgpu_dm_hpd_to_dal_irq_source(unsigned type)
static int amdgpu_dm_set_hpd_irq_state(struct amdgpu_device *adev, static int amdgpu_dm_set_hpd_irq_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source, struct amdgpu_irq_src *source,
unsigned type, unsigned int type,
enum amdgpu_interrupt_state state) enum amdgpu_interrupt_state state)
{ {
enum dc_irq_source src = amdgpu_dm_hpd_to_dal_irq_source(type); enum dc_irq_source src = amdgpu_dm_hpd_to_dal_irq_source(type);
...@@ -698,7 +704,7 @@ static int amdgpu_dm_set_hpd_irq_state(struct amdgpu_device *adev, ...@@ -698,7 +704,7 @@ static int amdgpu_dm_set_hpd_irq_state(struct amdgpu_device *adev,
static inline int dm_irq_state(struct amdgpu_device *adev, static inline int dm_irq_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source, struct amdgpu_irq_src *source,
unsigned crtc_id, unsigned int crtc_id,
enum amdgpu_interrupt_state state, enum amdgpu_interrupt_state state,
const enum irq_type dal_irq_type, const enum irq_type dal_irq_type,
const char *func) const char *func)
...@@ -729,7 +735,7 @@ static inline int dm_irq_state(struct amdgpu_device *adev, ...@@ -729,7 +735,7 @@ static inline int dm_irq_state(struct amdgpu_device *adev,
static int amdgpu_dm_set_pflip_irq_state(struct amdgpu_device *adev, static int amdgpu_dm_set_pflip_irq_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source, struct amdgpu_irq_src *source,
unsigned crtc_id, unsigned int crtc_id,
enum amdgpu_interrupt_state state) enum amdgpu_interrupt_state state)
{ {
return dm_irq_state( return dm_irq_state(
...@@ -743,7 +749,7 @@ static int amdgpu_dm_set_pflip_irq_state(struct amdgpu_device *adev, ...@@ -743,7 +749,7 @@ static int amdgpu_dm_set_pflip_irq_state(struct amdgpu_device *adev,
static int amdgpu_dm_set_crtc_irq_state(struct amdgpu_device *adev, static int amdgpu_dm_set_crtc_irq_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source, struct amdgpu_irq_src *source,
unsigned crtc_id, unsigned int crtc_id,
enum amdgpu_interrupt_state state) enum amdgpu_interrupt_state state)
{ {
return dm_irq_state( return dm_irq_state(
...@@ -893,13 +899,13 @@ void amdgpu_dm_hpd_init(struct amdgpu_device *adev) ...@@ -893,13 +899,13 @@ void amdgpu_dm_hpd_init(struct amdgpu_device *adev)
const struct dc_link *dc_link = amdgpu_dm_connector->dc_link; const struct dc_link *dc_link = amdgpu_dm_connector->dc_link;
if (DC_IRQ_SOURCE_INVALID != dc_link->irq_source_hpd) { if (dc_link->irq_source_hpd != DC_IRQ_SOURCE_INVALID) {
dc_interrupt_set(adev->dm.dc, dc_interrupt_set(adev->dm.dc,
dc_link->irq_source_hpd, dc_link->irq_source_hpd,
true); true);
} }
if (DC_IRQ_SOURCE_INVALID != dc_link->irq_source_hpd_rx) { if (dc_link->irq_source_hpd_rx != DC_IRQ_SOURCE_INVALID) {
dc_interrupt_set(adev->dm.dc, dc_interrupt_set(adev->dm.dc,
dc_link->irq_source_hpd_rx, dc_link->irq_source_hpd_rx,
true); true);
...@@ -928,13 +934,13 @@ void amdgpu_dm_hpd_fini(struct amdgpu_device *adev) ...@@ -928,13 +934,13 @@ void amdgpu_dm_hpd_fini(struct amdgpu_device *adev)
to_amdgpu_dm_connector(connector); to_amdgpu_dm_connector(connector);
const struct dc_link *dc_link = amdgpu_dm_connector->dc_link; const struct dc_link *dc_link = amdgpu_dm_connector->dc_link;
if (DC_IRQ_SOURCE_INVALID != dc_link->irq_source_hpd) { if (dc_link->irq_source_hpd != DC_IRQ_SOURCE_INVALID) {
dc_interrupt_set(adev->dm.dc, dc_interrupt_set(adev->dm.dc,
dc_link->irq_source_hpd, dc_link->irq_source_hpd,
false); false);
} }
if (DC_IRQ_SOURCE_INVALID != dc_link->irq_source_hpd_rx) { if (dc_link->irq_source_hpd_rx != DC_IRQ_SOURCE_INVALID) {
dc_interrupt_set(adev->dm.dc, dc_interrupt_set(adev->dm.dc,
dc_link->irq_source_hpd_rx, dc_link->irq_source_hpd_rx,
false); false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment