summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-14 11:34:22 +0000
committerbde <bde@FreeBSD.org>1998-07-14 11:34:22 +0000
commitddb797776aee737912b29fef51ce93599cff59cd (patch)
treeb819db413ff3d71573b6b143467a125d77a21ac0
parent804a7d7ceaf32e40239ad0cdacb07a62bc9faaab (diff)
downloadFreeBSD-src-ddb797776aee737912b29fef51ce93599cff59cd.zip
FreeBSD-src-ddb797776aee737912b29fef51ce93599cff59cd.tar.gz
If object pointers need to be cast to [unsigned] integers, then cast
to [u]intptr_t instead of to [u_]long. Don't cast pointers to integers just to do ordinary pointer arithmetic on them, especially when the casts use gcc's feature of casting lvalues.
-rw-r--r--sys/scsi/sd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index f9e7b68..4a35005 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.133 1998/07/11 07:45:59 bde Exp $
+ * $Id: sd.c,v 1.134 1998/07/13 08:23:05 julian Exp $
*/
#include "opt_bounce.h"
@@ -1264,7 +1264,7 @@ sdsdump(void *private, int32_t start, int32_t num)
* If we are dumping core, it may take a while.
* So reassure the user and hold off any watchdogs.
*/
- if ((u_long)addr % (1024 * 1024) == 0) {
+ if ((uintptr_t)addr % (1024 * 1024) == 0) {
#ifdef HW_WDOG
if (wdog_tickler)
(*wdog_tickler)();
@@ -1274,7 +1274,7 @@ sdsdump(void *private, int32_t start, int32_t num)
/* update block count */
num -= blkcnt;
blknum += blkcnt;
- (long) addr += blkcnt * sd->params.secsiz;
+ addr += blkcnt * sd->params.secsiz;
/* operator aborting dump? */
if (cncheckc() != -1)
OpenPOWER on IntegriCloud