[linux-cip:linux-4.19.y-cip 7/17] drivers/gpu/drm/drm_atomic.c:1264:1: warning: no previous prototype for 'drm_atomic_get_old_private_obj_state'


Biju Das <biju.das.jz@...>
 

Hi All,

I have received a warning message mail from Kernel test robot. I have investigated this issue and found there were lots of warnings with architecture by following the steps mentioned in this mail.

Then I investigated this particular issue and found that issue is caused by bad commit done by me while backporting. The below backport commit has
extra functions from patch1(0001-drm-Add-drm_atomic_get_old-new_private_obj_state.patch), but the corresponding header is missing.

cip commit: cacc2a81b9872aa8830353110b1252021f124ae8
upstream commit: 1b27fbdde1df172dba604855c45078d741f8c858

I have attached 3 patches, that looks like fixes the issue mentioned by kernel robot.

How do we proceed here?
drop cip commit: cacc2a81b9872aa8830353110b1252021f124ae8 and apply the 3 patches to fix this issue?

Please share your views.

Regards,
Biju

-----Original Message-----
From: kernel test robot <lkp@...>
Sent: 09 August 2020 15:13
To: Laurent Pinchart <laurent.pinchart@...>
Cc: kbuild-all@...; Pavel Machek <pavel@...>; Daniel Vetter
<daniel@...>; Sean Paul <seanpaul@...>; Biju Das
<biju.das.jz@...>
Subject: [linux-cip:linux-4.19.y-cip 7/17]
drivers/gpu/drm/drm_atomic.c:1264:1: warning: no previous prototype for
'drm_atomic_get_old_private_obj_state'

tree: https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git linux-
4.19.y-cip
head: 72750517bc5f1718ce3cb3fa75d4cadc05d27eee
commit: 60b4667275b60d92c760d48df95f5b80bbcfde6e [7/17] drm: Add
drm_atomic_get_(old|new)_connector_for_encoder() helpers
config: riscv-randconfig-r034-20200809 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-
tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 60b4667275b60d92c760d48df95f5b80bbcfde6e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0
make.cross ARCH=riscv

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...>

All warnings (new ones prefixed by >>):

drivers/gpu/drm/drm_atomic.c:1264:1: warning: no previous prototype
for 'drm_atomic_get_old_private_obj_state' [-Wmissing-prototypes]
1264 | drm_atomic_get_old_private_obj_state(struct drm_atomic_state
*state,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_atomic.c:1286:1: warning: no previous prototype
for 'drm_atomic_get_new_private_obj_state' [-Wmissing-prototypes]
1286 | drm_atomic_get_new_private_obj_state(struct drm_atomic_state
*state,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_print_state':
drivers/gpu/drm/drm_atomic.c:2184:24: warning: variable 'connector' set
but not used [-Wunused-but-set-variable]
2184 | struct drm_connector *connector;
| ^~~~~~~~~
drivers/gpu/drm/drm_atomic.c:2182:19: warning: variable 'crtc' set but not
used [-Wunused-but-set-variable]
2182 | struct drm_crtc *crtc;
| ^~~~
drivers/gpu/drm/drm_atomic.c:2180:20: warning: variable 'plane' set but
not used [-Wunused-but-set-variable]
2180 | struct drm_plane *plane;
| ^~~~~
drivers/gpu/drm/drm_atomic.c: In function 'complete_signaling':
drivers/gpu/drm/drm_atomic.c:2624:19: warning: variable 'crtc' set but not
used [-Wunused-but-set-variable]
2624 | struct drm_crtc *crtc;
| ^~~~

vim +/drm_atomic_get_old_private_obj_state +1264
drivers/gpu/drm/drm_atomic.c

1254
1255/**
1256 * drm_atomic_get_old_private_obj_state
1257 * @state: global atomic state object
1258 * @obj: private_obj to grab
1259 *
1260 * This function returns the old private object state for the given
private_obj,
1261 * or NULL if the private_obj is not part of the global atomic state.
1262 */
1263struct drm_private_state *
1264drm_atomic_get_old_private_obj_state(struct drm_atomic_state
*state,
1265 struct drm_private_obj *obj)
1266{
1267int i;
1268
1269for (i = 0; i < state->num_private_objs; i++)
1270if (obj == state->private_objs[i].ptr)
1271return state->private_objs[i].old_state;
1272
1273return NULL;
1274}
1275EXPORT_SYMBOL(drm_atomic_get_old_private_obj_state);
1276
1277/**
1278 * drm_atomic_get_new_private_obj_state
1279 * @state: global atomic state object
1280 * @obj: private_obj to grab
1281 *
1282 * This function returns the new private object state for the given
private_obj,
1283 * or NULL if the private_obj is not part of the global atomic state.
1284 */
1285struct drm_private_state *
1286drm_atomic_get_new_private_obj_state(struct drm_atomic_state
*state,
1287 struct drm_private_obj *obj)
1288{
1289int i;
1290
1291for (i = 0; i < state->num_private_objs; i++)
1292if (obj == state->private_objs[i].ptr)
1293return state->private_objs[i].new_state;
1294
1295return NULL;
1296}
1297EXPORT_SYMBOL(drm_atomic_get_new_private_obj_state);
1298

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647


Pavel Machek
 

Hi!

I have received a warning message mail from Kernel test robot. I have investigated this issue and found there were lots of warnings with architecture by following the steps mentioned in this mail.

Then I investigated this particular issue and found that issue is caused by bad commit done by me while backporting. The below backport commit has
extra functions from patch1(0001-drm-Add-drm_atomic_get_old-new_private_obj_state.patch), but the corresponding header is missing.

cip commit: cacc2a81b9872aa8830353110b1252021f124ae8
upstream commit: 1b27fbdde1df172dba604855c45078d741f8c858

I have attached 3 patches, that looks like fixes the issue mentioned by kernel robot.

How do we proceed here?
drop cip commit: cacc2a81b9872aa8830353110b1252021f124ae8 and apply the 3 patches to fix this issue?
First I want to make sure: we are talking about commit
60b4667275b60d92c760d48df95f5b80bbcfde6e? Because I don't see
cacc2a81b9872aa8830353110b1252021f124ae8 around.

Best regards,
Pavel

commit 60b4667275b60d92c760d48df95f5b80bbcfde6e
Author: Laurent Pinchart <laurent.pinchart@...>
Date: Wed Jul 22 17:34:39 2020 +0100

drm: Add drm_atomic_get_(old|new)_connector_for_encoder() helpers

commit 1b27fbdde1df172dba604855c45078d741f8c858 upstream.

Add functions to the atomic core to retrieve the old and new
connectors associated with an encoder in a drm_atomic_state. This
is useful for encoders and bridges that need to access the
connector, for instance for the drm_display_info.


--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Pavel Machek
 

Hi!

I have received a warning message mail from Kernel test robot. I have investigated this issue and found there were lots of warnings with architecture by following the steps mentioned in this mail.

Then I investigated this particular issue and found that issue is caused by bad commit done by me while backporting. The below backport commit has
extra functions from patch1(0001-drm-Add-drm_atomic_get_old-new_private_obj_state.patch), but the corresponding header is missing.

cip commit: cacc2a81b9872aa8830353110b1252021f124ae8
upstream commit: 1b27fbdde1df172dba604855c45078d741f8c858

I have attached 3 patches, that looks like fixes the issue mentioned by kernel robot.

How do we proceed here?
drop cip commit: cacc2a81b9872aa8830353110b1252021f124ae8 and apply the 3 patches to fix this issue?
No, let's not revert anything.

This is trivial fix for first issue, make it into patch:

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index c0b48e25a620..9042fdae9211 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -402,6 +402,12 @@ void drm_atomic_private_obj_fini(struct drm_private_obj *obj);
struct drm_private_state * __must_check
drm_atomic_get_private_obj_state(struct drm_atomic_state *state,
struct drm_private_obj *obj);
+struct drm_private_state *
+drm_atomic_get_old_private_obj_state(struct drm_atomic_state *state,
+ struct drm_private_obj *obj);
+struct drm_private_state *
+drm_atomic_get_new_private_obj_state(struct drm_atomic_state *state,
+ struct drm_private_obj *obj);

struct drm_connector *
drm_atomic_get_old_connector_for_encoder(struct drm_atomic_state
*state,

And this is somehow strange / non-trivial thingie. Make it into second
patch, and maybe try to explain what is going on there.

Best regards,
Pavel

@@ -656,6 +662,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->connectors[__i].ptr && \
((connector) = (__state)->connectors[__i].ptr, \
+ (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
(old_connector_state) = (__state)->connectors[__i].old_state, \
(new_connector_state) = (__state)->connectors[__i].new_state, 1))

@@ -677,6 +684,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->connectors[__i].ptr && \
((connector) = (__state)->connectors[__i].ptr, \
+ (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
(old_connector_state) = (__state)->connectors[__i].old_state, 1))

/**
@@ -697,7 +705,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->connectors[__i].ptr && \
((connector) = (__state)->connectors[__i].ptr, \
- (new_connector_state) = (__state)->connectors[__i].new_state, 1))
+ (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
+ (new_connector_state) = (__state)->connectors[__i].new_state, \
+ (void)(new_connector_state) /* Only to avoid unused-but-set-variable warning */, 1))

/**
* for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update
@@ -717,7 +727,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->crtcs[__i].ptr && \
((crtc) = (__state)->crtcs[__i].ptr, \
+ (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
(old_crtc_state) = (__state)->crtcs[__i].old_state, \
+ (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
(new_crtc_state) = (__state)->crtcs[__i].new_state, 1))

/**
@@ -756,7 +768,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->crtcs[__i].ptr && \
((crtc) = (__state)->crtcs[__i].ptr, \
- (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
+ (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
+ (new_crtc_state) = (__state)->crtcs[__i].new_state, \
+ (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1))

/**
* for_each_oldnew_plane_in_state - iterate over all planes in an atomic update
@@ -776,6 +790,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->planes[__i].ptr && \
((plane) = (__state)->planes[__i].ptr, \
+ (void)(plane) /* Only to avoid unused-but-set-variable warning */, \
(old_plane_state) = (__state)->planes[__i].old_state,\
(new_plane_state) = (__state)->planes[__i].new_state, 1))

@@ -836,7 +851,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->planes[__i].ptr && \
((plane) = (__state)->planes[__i].ptr, \
- (new_plane_state) = (__state)->planes[__i].new_state, 1))
+ (void)(plane) /* Only to avoid unused-but-set-variable warning */, \
+ (new_plane_state) = (__state)->planes[__i].new_state, \
+ (void)(new_plane_state) /* Only to avoid unused-but-set-variable warning */, 1))

/**
* for_each_oldnew_private_obj_in_state - iterate over all private objects in an atomic update



--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Biju Das <biju.das.jz@...>
 

Hi Pavel,

Thanks for the feedback.

drivers/gpu/drm/drm_atomic.c:1264:1: warning: no previous prototype for
'drm_atomic_get_old_private_obj_state'

Hi!

I have received a warning message mail from Kernel test robot. I have
investigated this issue and found there were lots of warnings with
architecture by following the steps mentioned in this mail.

Then I investigated this particular issue and found that issue is
caused by bad commit done by me while backporting. The below backport
commit has extra functions from patch1(0001-drm-Add-
drm_atomic_get_old-new_private_obj_state.patch), but the corresponding
header is missing.

cip commit: cacc2a81b9872aa8830353110b1252021f124ae8
upstream commit: 1b27fbdde1df172dba604855c45078d741f8c858

I have attached 3 patches, that looks like fixes the issue mentioned by
kernel robot.

How do we proceed here?
drop cip commit: cacc2a81b9872aa8830353110b1252021f124ae8 and apply
the 3 patches to fix this issue?
First I want to make sure: we are talking about commit
60b4667275b60d92c760d48df95f5b80bbcfde6e? Because I don't see
cacc2a81b9872aa8830353110b1252021f124ae8 around.
Yes, I am talking about 60b4667275b60d92c760d48df95f5b80bbcfde6e.

Cheers,
Biju



Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647


Biju Das <biju.das.jz@...>
 

Hi Pavel,

Thanks for the feedback.

drivers/gpu/drm/drm_atomic.c:1264:1: warning: no previous prototype for
'drm_atomic_get_old_private_obj_state'

Hi!

I have received a warning message mail from Kernel test robot. I have
investigated this issue and found there were lots of warnings with
architecture by following the steps mentioned in this mail.

Then I investigated this particular issue and found that issue is
caused by bad commit done by me while backporting. The below backport
commit has extra functions from patch1(0001-drm-Add-
drm_atomic_get_old-new_private_obj_state.patch), but the corresponding
header is missing.

cip commit: cacc2a81b9872aa8830353110b1252021f124ae8
upstream commit: 1b27fbdde1df172dba604855c45078d741f8c858

I have attached 3 patches, that looks like fixes the issue mentioned by
kernel robot.

How do we proceed here?
drop cip commit: cacc2a81b9872aa8830353110b1252021f124ae8 and apply
the 3 patches to fix this issue?
No, let's not revert anything.

This is trivial fix for first issue, make it into patch:
Ok, will make it into a patch

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index
c0b48e25a620..9042fdae9211 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -402,6 +402,12 @@ void drm_atomic_private_obj_fini(struct
drm_private_obj *obj); struct drm_private_state * __must_check
drm_atomic_get_private_obj_state(struct drm_atomic_state *state,
struct drm_private_obj *obj);
+struct drm_private_state *
+drm_atomic_get_old_private_obj_state(struct drm_atomic_state *state,
+ struct drm_private_obj *obj);
+struct drm_private_state *
+drm_atomic_get_new_private_obj_state(struct drm_atomic_state *state,
+ struct drm_private_obj *obj);

struct drm_connector *
drm_atomic_get_old_connector_for_encoder(struct drm_atomic_state
*state,

And this is somehow strange / non-trivial thingie. Make it into second patch,
and maybe try to explain what is going on there.
Ok will do.

Cheers,
Biju


@@ -656,6 +662,7 @@ void drm_state_dump(struct drm_device *dev, struct
drm_printer *p);
(__i)++)
\
for_each_if ((__state)->connectors[__i].ptr &&
\
((connector) = (__state)->connectors[__i].ptr,
\
+ (void)(connector) /* Only to avoid unused-but-
set-variable
+warning */, \
(old_connector_state) = (__state)-
connectors[__i].old_state,\
(new_connector_state) = (__state)-
connectors[__i].new_state, 1))
@@ -677,6 +684,7 @@ void drm_state_dump(struct drm_device *dev, struct
drm_printer *p);
(__i)++)
\
for_each_if ((__state)->connectors[__i].ptr &&
\
((connector) = (__state)->connectors[__i].ptr,
\
+ (void)(connector) /* Only to avoid unused-but-
set-variable
+warning */, \
(old_connector_state) = (__state)-
connectors[__i].old_state, 1))
/**
@@ -697,7 +705,9 @@ void drm_state_dump(struct drm_device *dev, struct
drm_printer *p);
(__i)++)
\
for_each_if ((__state)->connectors[__i].ptr &&
\
((connector) = (__state)->connectors[__i].ptr,
\
- (new_connector_state) = (__state)-
connectors[__i].new_state, 1))
+ (void)(connector) /* Only to avoid unused-but-
set-variable warning */, \
+ (new_connector_state) = (__state)-
connectors[__i].new_state, \
+ (void)(new_connector_state) /* Only to avoid
+unused-but-set-variable warning */, 1))

/**
* for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic
update @@ -717,7 +727,9 @@ void drm_state_dump(struct drm_device
*dev, struct drm_printer *p);
(__i)++)\
for_each_if ((__state)->crtcs[__i].ptr &&\
((crtc) = (__state)->crtcs[__i].ptr,\
+ (void)(crtc) /* Only to avoid unused-but-set-
variable warning
+*/, \
(old_crtc_state) = (__state)->crtcs[__i].old_state,
\
+ (void)(old_crtc_state) /* Only to avoid unused-
but-set-variable
+warning */, \
(new_crtc_state) = (__state)-
crtcs[__i].new_state, 1))
/**
@@ -756,7 +768,9 @@ void drm_state_dump(struct drm_device *dev, struct
drm_printer *p);
(__i)++)\
for_each_if ((__state)->crtcs[__i].ptr &&\
((crtc) = (__state)->crtcs[__i].ptr,\
- (new_crtc_state) = (__state)-
crtcs[__i].new_state, 1))
+ (void)(crtc) /* Only to avoid unused-but-set-
variable warning */, \
+ (new_crtc_state) = (__state)-
crtcs[__i].new_state, \
+ (void)(new_crtc_state) /* Only to avoid unused-
but-set-variable
+warning */, 1))

/**
* for_each_oldnew_plane_in_state - iterate over all planes in an atomic
update @@ -776,6 +790,7 @@ void drm_state_dump(struct drm_device
*dev, struct drm_printer *p);
(__i)++)\
for_each_if ((__state)->planes[__i].ptr &&\
((plane) = (__state)->planes[__i].ptr,\
+ (void)(plane) /* Only to avoid unused-but-set-
variable warning
+*/, \
(old_plane_state) = (__state)-
planes[__i].old_state,\
(new_plane_state) = (__state)-
planes[__i].new_state, 1))
@@ -836,7 +851,9 @@ void drm_state_dump(struct drm_device *dev, struct
drm_printer *p);
(__i)++)\
for_each_if ((__state)->planes[__i].ptr &&\
((plane) = (__state)->planes[__i].ptr,\
- (new_plane_state) = (__state)-
planes[__i].new_state, 1))
+ (void)(plane) /* Only to avoid unused-but-set-
variable warning */, \
+ (new_plane_state) = (__state)-
planes[__i].new_state, \
+ (void)(new_plane_state) /* Only to avoid
+unused-but-set-variable warning */, 1))

/**
* for_each_oldnew_private_obj_in_state - iterate over all private objects in
an atomic update



--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647