Skip to contentSkip to conversation

r1559 - in branches/drbd-0.7: drbd user

Drbd-dev Lars Ellenberg 2 participants 2 messages Sep 24, 2004 1 message not in the archive DRBD driver

lore
Share & tools
lore

Lars Ellenberg

author maintainer
#1 lore raw
In reply to a message not in the archive

[ bitte reply-to in drbd-cvs auf drbd-dev setzen ]

/ 2004-09-24 13:13:54 +0200
\ [email protected]:

Quoted 18 lines

Author: phil
Date: 2004-09-24 13:13:51 +0200 (Fri, 24 Sep 2004) New Revision: 1559

Modified:

   branches/drbd-0.7/drbd/drbd_int.h
   branches/drbd-0.7/user/drbdsetup.c

Log:
Made the "Warnung: comparison is always false due to limited range of data type" warning go away on 32Bit platforms whe CONFIG_LBD ist not set.

Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================

drbd-0.7/drbd/drbd_int.h line 976

Quoted 10 lines
drbd-0.7/drbd/drbd_int.h +5 -1
@@ -968,8 +968,12 @@
 #define BM_EXT_PER_SECT	    ( 512 / BM_BYTES_PER_EXTENT )        //   4
  */
 
-#define DRBD_MAX_SECTORS \
+#if ( !defined(CONFIG_LBD) ) && ( BITS_PER_LONG == 32 )
+# define DRBD_MAX_SECTORS (0xffffffffLU)
+#else 
+# define DRBD_MAX_SECTORS \
           ( (MD_RESERVED_SIZE*2LL - MD_BM_OFFSET) * (1LL<<(BM_EXT_SIZE_B-9)) )
+#endif

oh well...
why not simple (sector_t) ?
just because it is then 0xffdc0000 instead of 0xffffffff ? so what ...

Lars Ellenberg

maintainer
#2 lore raw
Quoted 2 lines · Lars Ellenberg

[ bitte reply-to in drbd-cvs auf drbd-dev setzen ]

ack. done.

Quoted 4 lines
Quoted 4 lines
(quoted diff) +3 -1
-#define DRBD_MAX_SECTORS \
+#if ( !defined(CONFIG_LBD) ) && ( BITS_PER_LONG == 32 )
+# define DRBD_MAX_SECTORS (0xffffffffLU)
+#else
Quoted 8 lines
Quoted 3 lines
+# define DRBD_MAX_SECTORS \
           ( (MD_RESERVED_SIZE*2LL - MD_BM_OFFSET) *

(1LL<<(BM_EXT_SIZE_B-9)) ) +#endif

oh well...
why not simple (sector_t) ?
just because it is then 0xffdc0000 instead of 0xffffffff ? so what ...

I did not know that it would be 0xffdc0000, I did not do the math... , OTOH it is made it explicit.

-philipp

Signature · 3 lines
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :