fix SCSI compile-time divide-by-zero with HZ < 100
PATCH 1/1 fix SCSI compile-time divide-by-zero with HZ < 100
This is the quickie patch, but someone might care to make the USER_HZ-coupled value scale for HZ=64 etc.
This fixes a compiler-reported divide-by-zero when HZ < 100.
Signed-off-by David Brownell <[email protected]>
block/scsi_ioctl.c +1 -1
@@ -63,7 +63,7 @@ static int scsi_get_bus(request_queue_tstatic int sg_get_timeout (request_queue_t *q) { -return q->sg_timeout / (HZ /USER_HZ ); +return q->sg_timeout /max (1 ,(HZ /USER_HZ )); }static int sg_set_timeout (request_queue_t *q,int __user *p)