[Intel-gfx] [drm-intel:drm-intel-nightly 922/930] include/linux/list.h:385:29: error: initialization discards 'const' qualifier from pointer target type

kbuild test robot fengguang.wu at intel.com
Fri Dec 16 15:48:31 UTC 2016


tree:   git://anongit.freedesktop.org/drm-intel drm-intel-nightly
head:   ca1c03136b168816ac65c5945776908e464fca6b
commit: 45b186f111f1623b257d183920cd4aab16a1acd5 [922/930] drm: Constify the drm_mm API
config: x86_64-randconfig-x008-201650 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 45b186f111f1623b257d183920cd4aab16a1acd5
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from include/linux/mutex.h:14:0,
                    from include/linux/seq_file.h:7,
                    from drivers/gpu/drm/i915/i915_gem_gtt.c:26:
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'i915_gtt_color_adjust':
>> include/linux/list.h:385:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     struct list_head *head__ = (ptr); \
                                ^
   drivers/gpu/drm/i915/i915_gem_gtt.c:2732:9: note: in expansion of macro 'list_first_entry_or_null'
     node = list_first_entry_or_null(&node->node_list,
            ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

vim +/const +385 include/linux/list.h

3943f42c Andrey Utkin  2014-11-14  369   * @member:	the name of the list_head within the struct.
93be3c2e Oleg Nesterov 2013-11-12  370   *
93be3c2e Oleg Nesterov 2013-11-12  371   * Note, that list is expected to be not empty.
93be3c2e Oleg Nesterov 2013-11-12  372   */
93be3c2e Oleg Nesterov 2013-11-12  373  #define list_last_entry(ptr, type, member) \
93be3c2e Oleg Nesterov 2013-11-12  374  	list_entry((ptr)->prev, type, member)
93be3c2e Oleg Nesterov 2013-11-12  375  
93be3c2e Oleg Nesterov 2013-11-12  376  /**
6d7581e6 Jiri Pirko    2013-05-29  377   * list_first_entry_or_null - get the first element from a list
6d7581e6 Jiri Pirko    2013-05-29  378   * @ptr:	the list head to take the element from.
6d7581e6 Jiri Pirko    2013-05-29  379   * @type:	the type of the struct this is embedded in.
3943f42c Andrey Utkin  2014-11-14  380   * @member:	the name of the list_head within the struct.
6d7581e6 Jiri Pirko    2013-05-29  381   *
6d7581e6 Jiri Pirko    2013-05-29  382   * Note that if the list is empty, it returns NULL.
6d7581e6 Jiri Pirko    2013-05-29  383   */
12adfd88 Chris Wilson  2016-07-23  384  #define list_first_entry_or_null(ptr, type, member) ({ \
12adfd88 Chris Wilson  2016-07-23 @385  	struct list_head *head__ = (ptr); \
12adfd88 Chris Wilson  2016-07-23  386  	struct list_head *pos__ = READ_ONCE(head__->next); \
12adfd88 Chris Wilson  2016-07-23  387  	pos__ != head__ ? list_entry(pos__, type, member) : NULL; \
12adfd88 Chris Wilson  2016-07-23  388  })
6d7581e6 Jiri Pirko    2013-05-29  389  
6d7581e6 Jiri Pirko    2013-05-29  390  /**
008208c6 Oleg Nesterov 2013-11-12  391   * list_next_entry - get the next element in list
008208c6 Oleg Nesterov 2013-11-12  392   * @pos:	the type * to cursor
3943f42c Andrey Utkin  2014-11-14  393   * @member:	the name of the list_head within the struct.

:::::: The code at line 385 was first introduced by commit
:::::: 12adfd882c5f37548acaba4f043a158b3c54468b list: Expand list_first_entry_or_null()

:::::: TO: Chris Wilson <chris at chris-wilson.co.uk>
:::::: CC: Paul E. McKenney <paulmck at linux.vnet.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 29439 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20161216/1aa015d6/attachment-0001.gz>


More information about the Intel-gfx mailing list