mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Baineng Shou <shoubaineng@gmail.com>
Cc: sumit.semwal@linaro.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dma-buf/test: add KUnit case for dma_fence_dedup_array() empty input
Date: Wed, 14 Oct 2026 14:37:04 +0200	[thread overview]
Message-ID: <8e1c50f7-8d1a-4b78-8524-2897c52ff384@amd.com> (raw)
In-Reply-To: <20261014024909.1769215-1-shoubaineng@gmail.com>

On 10/14/26 04:49, Baineng Shou wrote:
> Add a KUnit case verifying that dma_fence_dedup_array() returns 0,
> not 1, when called with num_fences == 0. This locks down the
> contract documented in the kernel-doc and prevents a regression
> of commit 77a9298741f8 ("dma-fence: Make dma_fence_dedup_array()
> robust against 0-count input").
> 
> Suggested-by: Christian König <christian.koenig@amd.com>
> Reviewed-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Baineng Shou <shoubaineng@gmail.com>

Thanks for the reminder, I had to wait for the -fixes backmerge to push this.

I've just pushed the patch to drm-misc-next.

Regards,
Christian.

> ---
> 
> Changes in v2:
> - Add Reviewed-by from Christian.
> - Rebase onto v7.3-rc7.
> 
>  drivers/dma-buf/st-dma-fence-unwrap.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c
> index 4d9d313b460c..c5353b36f0e4 100644
> --- a/drivers/dma-buf/st-dma-fence-unwrap.c
> +++ b/drivers/dma-buf/st-dma-fence-unwrap.c
> @@ -370,6 +370,15 @@ static void test_unwrap_merge_seqno(struct kunit *test)
>  	dma_fence_put(f1);
>  }
>  
> +static void test_dedup_empty(struct kunit *test)
> +{
> +	struct dma_fence *fence[1] = { NULL };
> +	int ret;
> +
> +	ret = dma_fence_dedup_array(fence, 0);
> +	KUNIT_EXPECT_EQ(test, ret, 0);
> +}
> +
>  static void test_unwrap_merge_order(struct kunit *test)
>  {
>  	struct dma_fence *fence, *f1, *f2, *a1, *a2, *c1, *c2;
> @@ -595,6 +604,7 @@ static struct kunit_case dma_fence_unwrap_cases[] = {
>  	KUNIT_CASE(test_unwrap_merge_order),
>  	KUNIT_CASE(test_unwrap_merge_complex),
>  	KUNIT_CASE(test_unwrap_merge_complex_seqno),
> +	KUNIT_CASE(test_dedup_empty),
>  	{}
>  };
>  


      reply	other threads:[~2026-10-14 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  6:04 [PATCH] " Baineng Shou
2026-06-30  8:29 ` Christian König
2026-10-14  2:49 ` [PATCH v2] " Baineng Shou
2026-10-14 12:37   ` Christian König [this message]

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=8e1c50f7-8d1a-4b78-8524-2897c52ff384@amd.com \
    --to=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=shoubaineng@gmail.com \
    --cc=sumit.semwal@linaro.org \
    /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

all inboxes | Powered by JetHome®