drm/amdgpu: Fix the code style warnings in amdgpu_ras
Fix the code style warnings in amdgpu_ras:
1. ERROR: space required before the open parenthesis '('.
2. WARNING: line length of xxx exceeds 100 columns.
3. ERROR: "foo* bar" should be "foo *bar".
4. WARNING: unnecessary whitespace before a quoted newline.
5. WARNING: space prohibited before semicolon.
6. WARNING: suspect code indent for conditional statements.
7. WARNING: braces {} are not necessary for single statement blocks.
Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -953,7 +953,7 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
|
|||||||
} else {
|
} else {
|
||||||
block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, 0);
|
block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, 0);
|
||||||
if (!block_obj || !block_obj->hw_ops) {
|
if (!block_obj || !block_obj->hw_ops) {
|
||||||
dev_info(adev->dev, "%s doesn't config ras function \n",
|
dev_info(adev->dev, "%s doesn't config ras function.\n",
|
||||||
get_ras_block_str(&info->head));
|
get_ras_block_str(&info->head));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -1029,7 +1029,8 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!block_obj || !block_obj->hw_ops) {
|
if (!block_obj || !block_obj->hw_ops) {
|
||||||
dev_info(adev->dev, "%s doesn't config ras function \n", ras_block_str(block));
|
dev_info(adev->dev, "%s doesn't config ras function.\n",
|
||||||
|
ras_block_str(block));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1066,7 +1067,8 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!block_obj || !block_obj->hw_ops) {
|
if (!block_obj || !block_obj->hw_ops) {
|
||||||
dev_info(adev->dev, "%s doesn't config ras function \n", get_ras_block_str(&info->head));
|
dev_info(adev->dev, "%s doesn't config ras function.\n",
|
||||||
|
get_ras_block_str(&info->head));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1702,7 +1704,9 @@ static void amdgpu_ras_log_on_err_counter(struct amdgpu_device *adev)
|
|||||||
static void amdgpu_ras_error_status_query(struct amdgpu_device *adev,
|
static void amdgpu_ras_error_status_query(struct amdgpu_device *adev,
|
||||||
struct ras_query_if *info)
|
struct ras_query_if *info)
|
||||||
{
|
{
|
||||||
struct amdgpu_ras_block_object* block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, info->head.sub_block_index);
|
struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev,
|
||||||
|
info->head.block,
|
||||||
|
info->head.sub_block_index);
|
||||||
/*
|
/*
|
||||||
* Only two block need to query read/write
|
* Only two block need to query read/write
|
||||||
* RspStatus at current state
|
* RspStatus at current state
|
||||||
@@ -1711,9 +1715,13 @@ static void amdgpu_ras_error_status_query(struct amdgpu_device *adev,
|
|||||||
(info->head.block != AMDGPU_RAS_BLOCK__MMHUB))
|
(info->head.block != AMDGPU_RAS_BLOCK__MMHUB))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
block_obj = amdgpu_ras_get_ras_block(adev, info->head.block, info->head.sub_block_index);
|
block_obj = amdgpu_ras_get_ras_block(adev,
|
||||||
|
info->head.block,
|
||||||
|
info->head.sub_block_index);
|
||||||
|
|
||||||
if (!block_obj || !block_obj->hw_ops) {
|
if (!block_obj || !block_obj->hw_ops) {
|
||||||
dev_info(adev->dev, "%s doesn't config ras function \n", get_ras_block_str(&info->head));
|
dev_info(adev->dev, "%s doesn't config ras function.\n",
|
||||||
|
get_ras_block_str(&info->head));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2766,10 +2774,9 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
|
|||||||
|
|
||||||
/* If the ras object is in ras_list, don't add it again */
|
/* If the ras object is in ras_list, don't add it again */
|
||||||
list_for_each_entry_safe(obj, tmp, &adev->ras_list, node) {
|
list_for_each_entry_safe(obj, tmp, &adev->ras_list, node) {
|
||||||
if (obj == ras_block_obj) {
|
if (obj == ras_block_obj)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
INIT_LIST_HEAD(&ras_block_obj->node);
|
INIT_LIST_HEAD(&ras_block_obj->node);
|
||||||
list_add_tail(&ras_block_obj->node, &adev->ras_list);
|
list_add_tail(&ras_block_obj->node, &adev->ras_list);
|
||||||
|
|||||||
@@ -496,7 +496,8 @@ struct amdgpu_ras_block_object {
|
|||||||
/* ras block link */
|
/* ras block link */
|
||||||
struct list_head node;
|
struct list_head node;
|
||||||
|
|
||||||
int (*ras_block_match)(struct amdgpu_ras_block_object *block_obj, enum amdgpu_ras_block block, uint32_t sub_block_index);
|
int (*ras_block_match)(struct amdgpu_ras_block_object *block_obj,
|
||||||
|
enum amdgpu_ras_block block, uint32_t sub_block_index);
|
||||||
int (*ras_late_init)(struct amdgpu_device *adev, void *ras_info);
|
int (*ras_late_init)(struct amdgpu_device *adev, void *ras_info);
|
||||||
void (*ras_fini)(struct amdgpu_device *adev);
|
void (*ras_fini)(struct amdgpu_device *adev);
|
||||||
const struct amdgpu_ras_block_hw_ops *hw_ops;
|
const struct amdgpu_ras_block_hw_ops *hw_ops;
|
||||||
@@ -680,5 +681,6 @@ struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev);
|
|||||||
|
|
||||||
int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras *ras_con);
|
int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras *ras_con);
|
||||||
|
|
||||||
int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, struct amdgpu_ras_block_object* ras_block_obj);
|
int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
|
||||||
|
struct amdgpu_ras_block_object *ras_block_obj);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user