Re: [PATCH v19 2/7] xbitmap: potential improvement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.15-rc3 next-20171214]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Wei-Wang/Virtio-balloon-Enhancement/20171215-100525
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: the linux-review/Wei-Wang/Virtio-balloon-Enhancement/20171215-100525 HEAD 607ddba072bf7f9c9cbacedaccad7c42c5c7149c builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> lib/xbitmap.c:80:6: error: conflicting types for 'xb_clear_bit'
    void xb_clear_bit(struct xb *xb, unsigned long bit)
         ^~~~~~~~~~~~
   In file included from lib/xbitmap.c:2:0:
   include/linux/xbitmap.h:37:5: note: previous declaration of 'xb_clear_bit' was here
    int xb_clear_bit(struct xb *xb, unsigned long bit);
        ^~~~~~~~~~~~

vim +/xb_clear_bit +80 lib/xbitmap.c

    71	
    72	/**
    73	 * xb_clear_bit - clear a bit in the xbitmap
    74	 * @xb: the xbitmap tree used to record the bit
    75	 * @bit: index of the bit to clear
    76	 *
    77	 * This function is used to clear a bit in the xbitmap. If all the bits of the
    78	 * bitmap are 0, the bitmap will be freed.
    79	 */
  > 80	void xb_clear_bit(struct xb *xb, unsigned long bit)
    81	{
    82		unsigned long index = bit / IDA_BITMAP_BITS;
    83		struct radix_tree_root *root = &xb->xbrt;
    84		struct radix_tree_node *node;
    85		void **slot;
    86		struct ida_bitmap *bitmap;
    87		unsigned long ebit;
    88	
    89		bit %= IDA_BITMAP_BITS;
    90		ebit = bit + 2;
    91	
    92		bitmap = __radix_tree_lookup(root, index, &node, &slot);
    93		if (radix_tree_exception(bitmap)) {
    94			unsigned long tmp = (unsigned long)bitmap;
    95	
    96			if (ebit >= BITS_PER_LONG)
    97				return;
    98			tmp &= ~(1UL << ebit);
    99			if (tmp == RADIX_TREE_EXCEPTIONAL_ENTRY)
   100				__radix_tree_delete(root, node, slot);
   101			else
   102				rcu_assign_pointer(*slot, (void *)tmp);
   103			return;
   104		}
   105	
   106		if (!bitmap)
   107			return;
   108	
   109		__clear_bit(bit, bitmap->bitmap);
   110		if (bitmap_empty(bitmap->bitmap, IDA_BITMAP_BITS)) {
   111			kfree(bitmap);
   112			__radix_tree_delete(root, node, slot);
   113		}
   114	}
   115	EXPORT_SYMBOL(xb_clear_bit);
   116	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux