Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata CID 1364758: Integer handling issues, avoid sig...



details:   https://anonhg.NetBSD.org/src/rev/0cf62dbcfb35
branches:  trunk
changeset: 816990:0cf62dbcfb35
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Aug 05 06:54:22 2016 +0000

description:
CID 1364758:  Integer handling issues, avoid sign extension to 64 bits.

diffstat:

 sys/dev/ata/wd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r f55496688121 -r 0cf62dbcfb35 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Fri Aug 05 05:32:02 2016 +0000
+++ b/sys/dev/ata/wd.c  Fri Aug 05 06:54:22 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.425 2016/07/22 12:55:34 jakllsch Exp $ */
+/*     $NetBSD: wd.c,v 1.426 2016/08/05 06:54:22 christos Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.425 2016/07/22 12:55:34 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.426 2016/08/05 06:54:22 christos Exp $");
 
 #include "opt_ata.h"
 
@@ -394,8 +394,8 @@
        if ((wd->sc_params.atap_secsz & ATA_SECSZ_VALID_MASK) == ATA_SECSZ_VALID
            && ((wd->sc_params.atap_secsz & ATA_SECSZ_LLS) != 0)) {
                wd->sc_blksize = 2ULL *
-                   (wd->sc_params.atap_lls_secsz[1] << 16 |
-                    wd->sc_params.atap_lls_secsz[0] <<  0);
+                   ((uint32_t)((wd->sc_params.atap_lls_secsz[1] << 16) |
+                   wd->sc_params.atap_lls_secsz[0]));
        } else {
                wd->sc_blksize = 512;
        }



Home | Main Index | Thread Index | Old Index