CrushWrapper.cc: fix sizeof() call in calloc

Use __u32 instead of __s32 due to type of bucket->parm to fix:

1028 bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__s32));
     Result of 'calloc' is converted to a pointer of type '__u32',
     which is incompatible with sizeof operand type '__s32'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_librbd.cc: fix sizeof() in malloc call

Use 'char' instead of 'char *'.

228  names = (char *) malloc(sizeof(char *) * 1024);
     Result of 'malloc' is converted to a pointer of type 'char',
     which is incompatible with sizeof operand type 'char *'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rbd.cc: remove used parameter from set_pool_image_name()

Removed unused 'orig_pool' parameter from set_pool_image_name().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Server.cc: remove unused initialization of 'destdnl'

Remove initialization of 'destdnl' since the assigned value was
never used and the same call is used some lines later again before
first usage. Fix for:

6579 CDentry::linkage_t *destdnl = destdn->get_linkage();
     Value stored to 'destdnl' during its initialization is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/flock.cc: remove dead initialization of 'new_lock_start'

Fix for:

212 uint64_t new_lock_start = new_lock.start;
    Value stored to 'new_lock_start' during its initialization is
    never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/flock.cc: remove dead initialization of 'new_lock_end'

Fix for:

213 uint64_t new_lock_end = new_lock.start + new_lock.length - 1;
    Value stored to 'new_lock_end' during its initialization is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
osd/OSD.cc: fix possible NULL pointer deref in share_map()

Fix for:

4778 *sent_epoch_p = osdmap->get_epoch();
     12 Dereference of null pointer (loaded from variable 'sent_epoch_p')

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
libcephfs.cc: fix possible NULL pointer deref

Fix possible NULL pointer dereference of 'inode' in ceph_ll_lookup_inode().
It's not enough to check for 'inode' without assert or error handling before
assert for '*inode != NULL' since this doesn't handle the 'inode == NULL'
case for the later calls.

Fix for:
1192 r = (cmount->get_client())->lookup_parent(*inode, &parent);
     5  Dereference of null pointer (loaded from variable 'inode')

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw_user.cc:

Remove bool variable 'same_email' compare emails directly in
if check.

Fix for:
[src/rgw/rgw_user.cc:1926] -> [src/rgw/rgw_user.cc:1927]: (performance)
 Variable 'same_email' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
cls_kvs.cc: remove dead assignment

Fix for:
[src/key_value_store/cls_kvs.cc:383] -> [src/key_value_store/cls_kvs.cc:386]:
 (performance) Variable 'r' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
cls_kvs.cc: return 'r' from get_idata_from_key()

Fix for:

69  r = 0;
    Value stored to 'r' is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
FileStore.cc: remove some dead assignments

There is no need to reset 'r' to '0'.

Fix for:
3759 r = 0;
     Value stored to 'r' is never read

4093 r = 0;
     Value stored to 'r' is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/ObjectMap/KeyValueDBMemory.cc: use empty() instead of size()

Use empty() instead of 'size() == 0' to fix:

[src/test/ObjectMap/KeyValueDBMemory.cc:83]: (performance)
 Possible inefficient checking for 'db' emptiness.
[src/test/ObjectMap/KeyValueDBMemory.cc:97]: (performance)
 Possible inefficient checking for 'db' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
TestErasureCodePluginJerasure.cc: prefer ++operators for non-primitive types

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_rgw_admin_meta.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_rgw_admin_opstate.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_rgw_admin_log.cc: prefer empty() over size() for emptiness check

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_rbd.cc: use 'delete []' if 'new char[len]' was used

Fix for:
[src/test/cls_rbd/test_cls_rbd.cc:82]: (error) Mismatching allocation
 and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:95]: (error) Mismatching allocation
 and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:97]: (error) Mismatching allocation
 and deallocation: b

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_rgw_admin_log.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw_quota.cc: remove unused variable 'key'

[src/rgw/rgw_quota.cc:455]: (style) Variable 'key' is assigned a
 value that is never used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>