Skip to content

Commit f9acfaf

Browse files
srishanmalexdeucher
authored andcommitted
drm/amdgpu: Move externs to amdgpu.h file from amdgpu_drv.c
Fixes the following: WARNING: externs should be avoided in .c files +extern const struct attribute_group amdgpu_vram_mgr_attr_group; WARNING: externs should be avoided in .c files +extern const struct attribute_group amdgpu_gtt_mgr_attr_group; WARNING: externs should be avoided in .c files +extern const struct attribute_group amdgpu_flash_attr_group; And other style fixes: WARNING: Block comments should align the * on each line WARNING: void function return statements are not generally useful WARNING: braces {} are not necessary for single statement blocks Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Guchun Chen <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b0bd0a9 commit f9acfaf

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,4 +1506,8 @@ static inline bool amdgpu_is_tmz(struct amdgpu_device *adev)
15061506

15071507
int amdgpu_in_reset(struct amdgpu_device *adev);
15081508

1509+
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
1510+
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
1511+
extern const struct attribute_group amdgpu_flash_attr_group;
1512+
15091513
#endif

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,7 @@ module_param_named(msi, amdgpu_msi, int, 0444);
313313
* jobs is 10000. The timeout for compute is 60000.
314314
*/
315315
MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
316-
"for passthrough or sriov, 10000 for all jobs."
317-
" 0: keep default value. negative: infinity timeout), "
318-
"format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
316+
"for passthrough or sriov, 10000 for all jobs. 0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; "
319317
"for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
320318
module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
321319

@@ -620,8 +618,7 @@ module_param_named(cik_support, amdgpu_cik_support, int, 0444);
620618
* E.g. 0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte. The default is 0 (disabled).
621619
*/
622620
MODULE_PARM_DESC(smu_memory_pool_size,
623-
"reserve gtt for smu debug usage, 0 = disable,"
624-
"0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte");
621+
"reserve gtt for smu debug usage, 0 = disable,0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte");
625622
module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444);
626623

627624
/**
@@ -791,9 +788,9 @@ module_param(hws_gws_support, bool, 0444);
791788
MODULE_PARM_DESC(hws_gws_support, "Assume MEC2 FW supports GWS barriers (false = rely on FW version check (Default), true = force supported)");
792789

793790
/**
794-
* DOC: queue_preemption_timeout_ms (int)
795-
* queue preemption timeout in ms (1 = Minimum, 9000 = default)
796-
*/
791+
* DOC: queue_preemption_timeout_ms (int)
792+
* queue preemption timeout in ms (1 = Minimum, 9000 = default)
793+
*/
797794
int queue_preemption_timeout_ms = 9000;
798795
module_param(queue_preemption_timeout_ms, int, 0644);
799796
MODULE_PARM_DESC(queue_preemption_timeout_ms, "queue preemption timeout in ms (1 = Minimum, 9000 = default)");
@@ -2417,7 +2414,6 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
24172414
amdgpu_amdkfd_device_init(adev);
24182415
amdgpu_ttm_set_buffer_funcs_status(adev, true);
24192416
}
2420-
return;
24212417
}
24222418

24232419
static int amdgpu_pmops_prepare(struct device *dev)
@@ -2614,6 +2610,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
26142610
/* wait for all rings to drain before suspending */
26152611
for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
26162612
struct amdgpu_ring *ring = adev->rings[i];
2613+
26172614
if (ring && ring->sched.ready) {
26182615
ret = amdgpu_fence_wait_empty(ring);
26192616
if (ret)
@@ -2738,6 +2735,7 @@ long amdgpu_drm_ioctl(struct file *filp,
27382735
struct drm_file *file_priv = filp->private_data;
27392736
struct drm_device *dev;
27402737
long ret;
2738+
27412739
dev = file_priv->minor->dev;
27422740
ret = pm_runtime_get_sync(dev->dev);
27432741
if (ret < 0)
@@ -2802,9 +2800,8 @@ int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
28022800
if (!filp)
28032801
return -EINVAL;
28042802

2805-
if (filp->f_op != &amdgpu_driver_kms_fops) {
2803+
if (filp->f_op != &amdgpu_driver_kms_fops)
28062804
return -EINVAL;
2807-
}
28082805

28092806
file = filp->private_data;
28102807
*fpriv = file->driver_priv;
@@ -2897,18 +2894,13 @@ static struct pci_error_handlers amdgpu_pci_err_handler = {
28972894
.resume = amdgpu_pci_resume,
28982895
};
28992896

2900-
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
2901-
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
2902-
extern const struct attribute_group amdgpu_flash_attr_group;
2903-
29042897
static const struct attribute_group *amdgpu_sysfs_groups[] = {
29052898
&amdgpu_vram_mgr_attr_group,
29062899
&amdgpu_gtt_mgr_attr_group,
29072900
&amdgpu_flash_attr_group,
29082901
NULL,
29092902
};
29102903

2911-
29122904
static struct pci_driver amdgpu_kms_pci_driver = {
29132905
.name = DRIVER_NAME,
29142906
.id_table = pciidlist,

0 commit comments

Comments
 (0)