mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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 <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
			
			
This commit is contained in:
		
							parent
							
								
									b0bd0a92b8
								
							
						
					
					
						commit
						f9acfafc34
					
				
					 2 changed files with 12 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -1506,4 +1506,8 @@ static inline bool amdgpu_is_tmz(struct amdgpu_device *adev)
 | 
			
		|||
 | 
			
		||||
int amdgpu_in_reset(struct amdgpu_device *adev);
 | 
			
		||||
 | 
			
		||||
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
 | 
			
		||||
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
 | 
			
		||||
extern const struct attribute_group amdgpu_flash_attr_group;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -313,9 +313,7 @@ module_param_named(msi, amdgpu_msi, int, 0444);
 | 
			
		|||
 * jobs is 10000. The timeout for compute is 60000.
 | 
			
		||||
 */
 | 
			
		||||
MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: for bare metal 10000 for non-compute jobs and 60000 for compute jobs; "
 | 
			
		||||
		"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]; "
 | 
			
		||||
		"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]; "
 | 
			
		||||
		"for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video].");
 | 
			
		||||
module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -620,8 +618,7 @@ module_param_named(cik_support, amdgpu_cik_support, int, 0444);
 | 
			
		|||
 * E.g. 0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte. The default is 0 (disabled).
 | 
			
		||||
 */
 | 
			
		||||
MODULE_PARM_DESC(smu_memory_pool_size,
 | 
			
		||||
	"reserve gtt for smu debug usage, 0 = disable,"
 | 
			
		||||
		"0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte");
 | 
			
		||||
	"reserve gtt for smu debug usage, 0 = disable,0x1 = 256Mbyte, 0x2 = 512Mbyte, 0x4 = 1 Gbyte, 0x8 = 2GByte");
 | 
			
		||||
module_param_named(smu_memory_pool_size, amdgpu_smu_memory_pool_size, uint, 0444);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -791,9 +788,9 @@ module_param(hws_gws_support, bool, 0444);
 | 
			
		|||
MODULE_PARM_DESC(hws_gws_support, "Assume MEC2 FW supports GWS barriers (false = rely on FW version check (Default), true = force supported)");
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * DOC: queue_preemption_timeout_ms (int)
 | 
			
		||||
  * queue preemption timeout in ms (1 = Minimum, 9000 = default)
 | 
			
		||||
  */
 | 
			
		||||
 * DOC: queue_preemption_timeout_ms (int)
 | 
			
		||||
 * queue preemption timeout in ms (1 = Minimum, 9000 = default)
 | 
			
		||||
 */
 | 
			
		||||
int queue_preemption_timeout_ms = 9000;
 | 
			
		||||
module_param(queue_preemption_timeout_ms, int, 0644);
 | 
			
		||||
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)
 | 
			
		|||
			amdgpu_amdkfd_device_init(adev);
 | 
			
		||||
		amdgpu_ttm_set_buffer_funcs_status(adev, true);
 | 
			
		||||
	}
 | 
			
		||||
	return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int amdgpu_pmops_prepare(struct device *dev)
 | 
			
		||||
| 
						 | 
				
			
			@ -2614,6 +2610,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 | 
			
		|||
	/* wait for all rings to drain before suspending */
 | 
			
		||||
	for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
 | 
			
		||||
		struct amdgpu_ring *ring = adev->rings[i];
 | 
			
		||||
 | 
			
		||||
		if (ring && ring->sched.ready) {
 | 
			
		||||
			ret = amdgpu_fence_wait_empty(ring);
 | 
			
		||||
			if (ret)
 | 
			
		||||
| 
						 | 
				
			
			@ -2738,6 +2735,7 @@ long amdgpu_drm_ioctl(struct file *filp,
 | 
			
		|||
	struct drm_file *file_priv = filp->private_data;
 | 
			
		||||
	struct drm_device *dev;
 | 
			
		||||
	long ret;
 | 
			
		||||
 | 
			
		||||
	dev = file_priv->minor->dev;
 | 
			
		||||
	ret = pm_runtime_get_sync(dev->dev);
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -2802,9 +2800,8 @@ int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
 | 
			
		|||
	if (!filp)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	if (filp->f_op != &amdgpu_driver_kms_fops) {
 | 
			
		||||
	if (filp->f_op != &amdgpu_driver_kms_fops)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	file = filp->private_data;
 | 
			
		||||
	*fpriv = file->driver_priv;
 | 
			
		||||
| 
						 | 
				
			
			@ -2897,10 +2894,6 @@ static struct pci_error_handlers amdgpu_pci_err_handler = {
 | 
			
		|||
	.resume		= amdgpu_pci_resume,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
 | 
			
		||||
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
 | 
			
		||||
extern const struct attribute_group amdgpu_flash_attr_group;
 | 
			
		||||
 | 
			
		||||
static const struct attribute_group *amdgpu_sysfs_groups[] = {
 | 
			
		||||
	&amdgpu_vram_mgr_attr_group,
 | 
			
		||||
	&amdgpu_gtt_mgr_attr_group,
 | 
			
		||||
| 
						 | 
				
			
			@ -2908,7 +2901,6 @@ static const struct attribute_group *amdgpu_sysfs_groups[] = {
 | 
			
		|||
	NULL,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static struct pci_driver amdgpu_kms_pci_driver = {
 | 
			
		||||
	.name = DRIVER_NAME,
 | 
			
		||||
	.id_table = pciidlist,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue