Subject: Re: linux-next: build warning after merge of the amdgpu tree

From: Stephen Rothwell <[email-masked]>
Date: Tue, 12 Dec 2023 14:01:34 +1100

Hi all,

On Tue, 12 Dec 2023 11:04:15 +1100 Stephen Rothwell <[email-masked]> wrote:
>
> After merging the amdgpu tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
> 
> drivers/gpu/drm/drm_atomic_uapi.c:366:1: warning: 'drm_atomic_replace_property_blob_from_id' defined but not used [-Wunused-function]
>   366 | drm_atomic_replace_property_blob_from_id(struct drm_device *dev,
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Introduced by commit
> 
>   1d2b049e4582 ("drm/drm_property: make replace_property_blob_from_id a DRM helper")

This became a build failure in the i386 defconfig build, so I applied
the following patch for today.

From: Stephen Rothwell <[email-masked]>
Date: Tue, 12 Dec 2023 13:53:55 +1100
Subject: [PATCH] drm: remove unused function drm_atomic_replace_property_blob_from_id()

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 42 -------------------------------
 1 file changed, 42 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 70ddbb93e466..29d4940188d4 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -362,48 +362,6 @@ static s32 __user *get_out_fence_for_connector(struct drm_atomic_state *state,
 	return fence_ptr;
 }
 
-static int
-drm_atomic_replace_property_blob_from_id(struct drm_device *dev,
-					 struct drm_property_blob **blob,
-					 uint64_t blob_id,
-					 ssize_t expected_size,
-					 ssize_t expected_elem_size,
-					 bool *replaced)
-{
-	struct drm_property_blob *new_blob = NULL;
-
-	if (blob_id != 0) {
-		new_blob = drm_property_lookup_blob(dev, blob_id);
-		if (new_blob == NULL) {
-			drm_dbg_atomic(dev,
-				       "cannot find blob ID %llu\n", blob_id);
-			return -EINVAL;
-		}
-
-		if (expected_size > 0 &&
-		    new_blob->length != expected_size) {
-			drm_dbg_atomic(dev,
-				       "[BLOB:%d] length %zu different from expected %zu\n",
-				       new_blob->base.id, new_blob->length, expected_size);
-			drm_property_blob_put(new_blob);
-			return -EINVAL;
-		}
-		if (expected_elem_size > 0 &&
-		    new_blob->length % expected_elem_size != 0) {
-			drm_dbg_atomic(dev,
-				       "[BLOB:%d] length %zu not divisible by element size %zu\n",
-				       new_blob->base.id, new_blob->length, expected_elem_size);
-			drm_property_blob_put(new_blob);
-			return -EINVAL;
-		}
-	}
-
-	*replaced |= drm_property_replace_blob(blob, new_blob);
-	drm_property_blob_put(new_blob);
-
-	return 0;
-}
-
 static int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
 		struct drm_crtc_state *state, struct drm_property *property,
 		uint64_t val)
-- 
2.40.1

-- 
Cheers,
Stephen Rothwell