aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2011-06-14 19:59:04 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:57:48 -0500
commit3b7cd457d0c8458f6a4df2854f75fd80c0338f93 (patch)
tree4a6add15574c733ae5112029a8f716acb2cbb9bf
parent6dff2902208364d058746ee794da4d960f6eec6f (diff)
DRBD: Fix comparison always false warning due to long/long long compare
Fix warnings of the following nature in the drbd header: In file included from drivers/block/drbd/drbd_bitmap.c:32: drivers/block/drbd/drbd_int.h: In function 'drbd_get_syncer_progress': drivers/block/drbd/drbd_int.h:2234: warning: comparison is always false due to limited range of data where mdev->rs_total (an unsigned long) is being compared to 1ULL << 32, which is always false on a 32-bit machine. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_int.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index ece2e4a991fb..de42c7cf7caf 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -2071,7 +2071,7 @@ static inline void drbd_get_syncer_progress(struct drbd_conf *mdev,
2071 * Note: currently we don't support such large bitmaps on 32bit 2071 * Note: currently we don't support such large bitmaps on 32bit
2072 * arch anyways, but no harm done to be prepared for it here. 2072 * arch anyways, but no harm done to be prepared for it here.
2073 */ 2073 */
2074 unsigned int shift = mdev->rs_total >= (1ULL << 32) ? 16 : 10; 2074 unsigned int shift = mdev->rs_total > UINT_MAX ? 16 : 10;
2075 unsigned long left = *bits_left >> shift; 2075 unsigned long left = *bits_left >> shift;
2076 unsigned long total = 1UL + (mdev->rs_total >> shift); 2076 unsigned long total = 1UL + (mdev->rs_total >> shift);
2077 unsigned long tmp = 1000UL - left * 1000UL/total; 2077 unsigned long tmp = 1000UL - left * 1000UL/total;