* [PATCH] drm/ttm: remove redundant initialization of variable ret
@ 2020-09-17 11:42 Jing Xiangfeng
2020-09-17 11:56 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2020-09-17 11:42 UTC (permalink / raw)
To: christian.koenig, ray.huang, airlied, daniel
Cc: dri-devel, linux-kernel, jingxiangfeng
The variable ret is being initialized with '-ENOMEM' that is
meaningless. So remove it.
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 3437711ddb43..4db87b9b57a8 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -388,7 +388,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
struct page *from_page;
struct page *to_page;
int i;
- int ret = -ENOMEM;
+ int ret;
BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
BUG_ON(ttm->caching_state != tt_cached);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/ttm: remove redundant initialization of variable ret
2020-09-17 11:42 [PATCH] drm/ttm: remove redundant initialization of variable ret Jing Xiangfeng
@ 2020-09-17 11:56 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2020-09-17 11:56 UTC (permalink / raw)
To: Jing Xiangfeng, ray.huang, airlied, daniel; +Cc: dri-devel, linux-kernel
Am 17.09.20 um 13:42 schrieb Jing Xiangfeng:
> The variable ret is being initialized with '-ENOMEM' that is
> meaningless. So remove it.
>
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Stumbled over the same thing just a few days ago, so this is already
fixed in my branch.
> ---
> drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 3437711ddb43..4db87b9b57a8 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -388,7 +388,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
> struct page *from_page;
> struct page *to_page;
> int i;
> - int ret = -ENOMEM;
> + int ret;
>
> BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
> BUG_ON(ttm->caching_state != tt_cached);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-17 11:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-17 11:42 [PATCH] drm/ttm: remove redundant initialization of variable ret Jing Xiangfeng
2020-09-17 11:56 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox