Commit 413521a4 authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/amd/amdgpu: Fix warnings in amdgpu_irq.c

checkpatch reports:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: braces {} are not necessary for any arm of this statement
+               if (nvec <= 0) {
[...]
+               } else {
[...]
WARNING: Block comments use a trailing */ on a separate line

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 353491c4
...@@ -124,7 +124,7 @@ const int node_id_to_phys_map[NODEID_MAX] = { ...@@ -124,7 +124,7 @@ const int node_id_to_phys_map[NODEID_MAX] = {
void amdgpu_irq_disable_all(struct amdgpu_device *adev) void amdgpu_irq_disable_all(struct amdgpu_device *adev)
{ {
unsigned long irqflags; unsigned long irqflags;
unsigned i, j, k; unsigned int i, j, k;
int r; int r;
spin_lock_irqsave(&adev->irq.lock, irqflags); spin_lock_irqsave(&adev->irq.lock, irqflags);
...@@ -283,11 +283,11 @@ int amdgpu_irq_init(struct amdgpu_device *adev) ...@@ -283,11 +283,11 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
int nvec = pci_msix_vec_count(adev->pdev); int nvec = pci_msix_vec_count(adev->pdev);
unsigned int flags; unsigned int flags;
if (nvec <= 0) { if (nvec <= 0)
flags = PCI_IRQ_MSI; flags = PCI_IRQ_MSI;
} else { else
flags = PCI_IRQ_MSI | PCI_IRQ_MSIX; flags = PCI_IRQ_MSI | PCI_IRQ_MSIX;
}
/* we only need one vector */ /* we only need one vector */
nvec = pci_alloc_irq_vectors(adev->pdev, 1, 1, flags); nvec = pci_alloc_irq_vectors(adev->pdev, 1, 1, flags);
if (nvec > 0) { if (nvec > 0) {
...@@ -346,7 +346,7 @@ void amdgpu_irq_fini_hw(struct amdgpu_device *adev) ...@@ -346,7 +346,7 @@ void amdgpu_irq_fini_hw(struct amdgpu_device *adev)
*/ */
void amdgpu_irq_fini_sw(struct amdgpu_device *adev) void amdgpu_irq_fini_sw(struct amdgpu_device *adev)
{ {
unsigned i, j; unsigned int i, j;
for (i = 0; i < AMDGPU_IRQ_CLIENTID_MAX; ++i) { for (i = 0; i < AMDGPU_IRQ_CLIENTID_MAX; ++i) {
if (!adev->irq.client[i].sources) if (!adev->irq.client[i].sources)
...@@ -380,7 +380,7 @@ void amdgpu_irq_fini_sw(struct amdgpu_device *adev) ...@@ -380,7 +380,7 @@ void amdgpu_irq_fini_sw(struct amdgpu_device *adev)
* 0 on success or error code otherwise * 0 on success or error code otherwise
*/ */
int amdgpu_irq_add_id(struct amdgpu_device *adev, int amdgpu_irq_add_id(struct amdgpu_device *adev,
unsigned client_id, unsigned src_id, unsigned int client_id, unsigned int src_id,
struct amdgpu_irq_src *source) struct amdgpu_irq_src *source)
{ {
if (client_id >= AMDGPU_IRQ_CLIENTID_MAX) if (client_id >= AMDGPU_IRQ_CLIENTID_MAX)
...@@ -432,7 +432,7 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev, ...@@ -432,7 +432,7 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
{ {
u32 ring_index = ih->rptr >> 2; u32 ring_index = ih->rptr >> 2;
struct amdgpu_iv_entry entry; struct amdgpu_iv_entry entry;
unsigned client_id, src_id; unsigned int client_id, src_id;
struct amdgpu_irq_src *src; struct amdgpu_irq_src *src;
bool handled = false; bool handled = false;
int r; int r;
...@@ -507,7 +507,7 @@ void amdgpu_irq_delegate(struct amdgpu_device *adev, ...@@ -507,7 +507,7 @@ void amdgpu_irq_delegate(struct amdgpu_device *adev,
* Updates interrupt state for the specific source (all ASICs). * Updates interrupt state for the specific source (all ASICs).
*/ */
int amdgpu_irq_update(struct amdgpu_device *adev, int amdgpu_irq_update(struct amdgpu_device *adev,
struct amdgpu_irq_src *src, unsigned type) struct amdgpu_irq_src *src, unsigned int type)
{ {
unsigned long irqflags; unsigned long irqflags;
enum amdgpu_interrupt_state state; enum amdgpu_interrupt_state state;
...@@ -516,7 +516,8 @@ int amdgpu_irq_update(struct amdgpu_device *adev, ...@@ -516,7 +516,8 @@ int amdgpu_irq_update(struct amdgpu_device *adev,
spin_lock_irqsave(&adev->irq.lock, irqflags); spin_lock_irqsave(&adev->irq.lock, irqflags);
/* We need to determine after taking the lock, otherwise /* We need to determine after taking the lock, otherwise
we might disable just enabled interrupts again */ * we might disable just enabled interrupts again
*/
if (amdgpu_irq_enabled(adev, src, type)) if (amdgpu_irq_enabled(adev, src, type))
state = AMDGPU_IRQ_STATE_ENABLE; state = AMDGPU_IRQ_STATE_ENABLE;
else else
...@@ -570,7 +571,7 @@ void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev) ...@@ -570,7 +571,7 @@ void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev)
* 0 on success or error code otherwise * 0 on success or error code otherwise
*/ */
int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src, int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
unsigned type) unsigned int type)
{ {
if (!adev->irq.installed) if (!adev->irq.installed)
return -ENOENT; return -ENOENT;
...@@ -600,7 +601,7 @@ int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src, ...@@ -600,7 +601,7 @@ int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
* 0 on success or error code otherwise * 0 on success or error code otherwise
*/ */
int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src, int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
unsigned type) unsigned int type)
{ {
if (!adev->irq.installed) if (!adev->irq.installed)
return -ENOENT; return -ENOENT;
...@@ -634,7 +635,7 @@ int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src, ...@@ -634,7 +635,7 @@ int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
* invalid parameters * invalid parameters
*/ */
bool amdgpu_irq_enabled(struct amdgpu_device *adev, struct amdgpu_irq_src *src, bool amdgpu_irq_enabled(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
unsigned type) unsigned int type)
{ {
if (!adev->irq.installed) if (!adev->irq.installed)
return false; return false;
...@@ -747,7 +748,7 @@ void amdgpu_irq_remove_domain(struct amdgpu_device *adev) ...@@ -747,7 +748,7 @@ void amdgpu_irq_remove_domain(struct amdgpu_device *adev)
* Returns: * Returns:
* Linux IRQ * Linux IRQ
*/ */
unsigned amdgpu_irq_create_mapping(struct amdgpu_device *adev, unsigned src_id) unsigned int amdgpu_irq_create_mapping(struct amdgpu_device *adev, unsigned int src_id)
{ {
adev->irq.virq[src_id] = irq_create_mapping(adev->irq.domain, src_id); adev->irq.virq[src_id] = irq_create_mapping(adev->irq.domain, src_id);
......
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