Re: [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

Join cip-dev@lists.cip-project.org to automatically receive all group messages.