diff mbox series

drm/ttm: fix warning that we shouldn't mix && and ||

Message ID 20230623070935.65102-1-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: fix warning that we shouldn't mix && and || | expand

Commit Message

Christian König June 23, 2023, 7:09 a.m. UTC
Trivial warning fix.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 4481913607e5 ("drm/ttm: fix bulk_move corruption when adding a entry")
---
 drivers/gpu/drm/ttm/ttm_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Deucher June 23, 2023, 1:49 p.m. UTC | #1
On Fri, Jun 23, 2023 at 3:09 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Trivial warning fix.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Fixes: 4481913607e5 ("drm/ttm: fix bulk_move corruption when adding a entry")

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/ttm/ttm_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
> index e51dbc7a2d53..46ff9c75bb12 100644
> --- a/drivers/gpu/drm/ttm/ttm_resource.c
> +++ b/drivers/gpu/drm/ttm/ttm_resource.c
> @@ -114,7 +114,7 @@ static void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
>         struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res);
>
>         if (unlikely(WARN_ON(!pos->first || !pos->last) ||
> -                    pos->first == res && pos->last == res)) {
> +                    (pos->first == res && pos->last == res))) {
>                 pos->first = NULL;
>                 pos->last = NULL;
>         } else if (pos->first == res) {
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
index e51dbc7a2d53..46ff9c75bb12 100644
--- a/drivers/gpu/drm/ttm/ttm_resource.c
+++ b/drivers/gpu/drm/ttm/ttm_resource.c
@@ -114,7 +114,7 @@  static void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
 	struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res);
 
 	if (unlikely(WARN_ON(!pos->first || !pos->last) ||
-		     pos->first == res && pos->last == res)) {
+		     (pos->first == res && pos->last == res))) {
 		pos->first = NULL;
 		pos->last = NULL;
 	} else if (pos->first == res) {