[ceph-client:testing 4/20] fs/ceph/mds_client.c:908:40-41: WARNING: Use ARRAY_SIZE

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

 



tree:   https://github.com/ceph/ceph-client.git testing
head:   4c30779aca6645aced59646c02c02aa4f4656ac8
commit: 02a45921333a12fa571f62e532cf8be20e8e4fc5 [4/20] [DO NOT MERGE] ceph: support cephfs' own feature bits


coccinelle warnings: (new ones prefixed by >>)

>> fs/ceph/mds_client.c:908:40-41: WARNING: Use ARRAY_SIZE

vim +908 fs/ceph/mds_client.c

   904	
   905	static void encode_supported_features(void **p, void *end)
   906	{
   907		static const unsigned char bits[] = CEPHFS_FEATURES_CLIENT_SUPPORTED;
 > 908		static const size_t count = sizeof(bits) / sizeof(bits[0]);
   909	
   910		if (count > 0) {
   911			size_t i;
   912			size_t size = ((size_t)bits[count - 1] + 64) / 64 * 8;
   913	
   914			BUG_ON(*p + 4 + size > end);
   915			ceph_encode_32(p, size);
   916			memset(*p, 0, size);
   917			for (i = 0; i < count; i++)
   918				((unsigned char*)(*p))[i / 8] |= 1 << (bits[i] % 8);
   919			*p += size;
   920		} else {
   921			BUG_ON(*p + 4 > end);
   922			ceph_encode_32(p, 0);
   923		}
   924	}
   925	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux