mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Make the change similar to that suggested by Nick Hibma to avoid divide by
zero traps. I actually can't believe that this compiler is *sooooo* stupid that it did a divide when there was 1024L*1024L instead of a right shift by 20. When we get quad type modifiers in kernel printf we can change to this too (to avoid overflow on > terabyte disk sizes).
This commit is contained in:
parent
882b71223e
commit
a7454a8878
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48532
@ -25,7 +25,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: scsi_da.c,v 1.26 1999/05/30 16:51:02 phk Exp $
|
* $Id: scsi_da.c,v 1.27 1999/05/31 11:24:02 phk Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opt_hw_wdog.h"
|
#include "opt_hw_wdog.h"
|
||||||
@ -1310,8 +1310,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
|
|||||||
dasetgeom(periph, rdcap);
|
dasetgeom(periph, rdcap);
|
||||||
dp = &softc->params;
|
dp = &softc->params;
|
||||||
snprintf(announce_buf, sizeof(announce_buf),
|
snprintf(announce_buf, sizeof(announce_buf),
|
||||||
"%ldMB (%d %d byte sectors: %dH %dS/T %dC)",
|
"%luMB (%u %u byte sectors: %dH %dS/T %dC)",
|
||||||
dp->sectors / ((1024L * 1024L) / dp->secsize),
|
(((unsigned long) dp->secsize) *
|
||||||
|
((unsigned long) dp->sectors)) >> 20ul,
|
||||||
dp->sectors, dp->secsize, dp->heads,
|
dp->sectors, dp->secsize, dp->heads,
|
||||||
dp->secs_per_track, dp->cylinders);
|
dp->secs_per_track, dp->cylinders);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user