From: Cai Huoqing <cai.huoqing@linux.dev>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Remove the unused param "struct drm_buddy *mm"
Date: Thu, 25 Aug 2022 10:14:41 +0800 [thread overview]
Message-ID: <20220825021441.GA8819@chq-T47> (raw)
In-Reply-To: <20220627085405.221435-1-cai.huoqing@linux.dev>
On 27 6月 22 16:54:04, Cai Huoqing wrote:
> Remove the param "struct drm_buddy *mm" which is unused in
> the function drm_block_alloc()/drm_block_free().
Just ping this patch
>
> Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
> ---
> drivers/gpu/drm/drm_buddy.c | 25 +++++++++++--------------
> 1 file changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 11bb59399471..192c8b99fb43 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -11,10 +11,8 @@
>
> static struct kmem_cache *slab_blocks;
>
> -static struct drm_buddy_block *drm_block_alloc(struct drm_buddy *mm,
> - struct drm_buddy_block *parent,
> - unsigned int order,
> - u64 offset)
> +static struct drm_buddy_block *
> +drm_block_alloc(struct drm_buddy_block *parent, unsigned int order, u64 offset)
> {
> struct drm_buddy_block *block;
>
> @@ -32,8 +30,7 @@ static struct drm_buddy_block *drm_block_alloc(struct drm_buddy *mm,
> return block;
> }
>
> -static void drm_block_free(struct drm_buddy *mm,
> - struct drm_buddy_block *block)
> +static void drm_block_free(struct drm_buddy_block *block)
> {
> kmem_cache_free(slab_blocks, block);
> }
> @@ -131,7 +128,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
> root_size = rounddown_pow_of_two(size);
> order = ilog2(root_size) - ilog2(chunk_size);
>
> - root = drm_block_alloc(mm, NULL, order, offset);
> + root = drm_block_alloc(NULL, order, offset);
> if (!root)
> goto out_free_roots;
>
> @@ -151,7 +148,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
>
> out_free_roots:
> while (i--)
> - drm_block_free(mm, mm->roots[i]);
> + drm_block_free(mm->roots[i]);
> kfree(mm->roots);
> out_free_list:
> kfree(mm->free_list);
> @@ -172,7 +169,7 @@ void drm_buddy_fini(struct drm_buddy *mm)
>
> for (i = 0; i < mm->n_roots; ++i) {
> WARN_ON(!drm_buddy_block_is_free(mm->roots[i]));
> - drm_block_free(mm, mm->roots[i]);
> + drm_block_free(mm->roots[i]);
> }
>
> WARN_ON(mm->avail != mm->size);
> @@ -191,14 +188,14 @@ static int split_block(struct drm_buddy *mm,
> BUG_ON(!drm_buddy_block_is_free(block));
> BUG_ON(!drm_buddy_block_order(block));
>
> - block->left = drm_block_alloc(mm, block, block_order, offset);
> + block->left = drm_block_alloc(block, block_order, offset);
> if (!block->left)
> return -ENOMEM;
>
> - block->right = drm_block_alloc(mm, block, block_order,
> + block->right = drm_block_alloc(block, block_order,
> offset + (mm->chunk_size << block_order));
> if (!block->right) {
> - drm_block_free(mm, block->left);
> + drm_block_free(block->left);
> return -ENOMEM;
> }
>
> @@ -257,8 +254,8 @@ static void __drm_buddy_free(struct drm_buddy *mm,
>
> list_del(&buddy->link);
>
> - drm_block_free(mm, block);
> - drm_block_free(mm, buddy);
> + drm_block_free(block);
> + drm_block_free(buddy);
>
> block = parent;
> }
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-08-25 2:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 8:54 [PATCH] drm: Remove the unused param "struct drm_buddy *mm" Cai Huoqing
2022-08-25 2:14 ` Cai Huoqing [this message]
2022-08-25 11:51 ` Maíra Canal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220825021441.GA8819@chq-T47 \
--to=cai.huoqing@linux.dev \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox