Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi PR/55986: Ryo Onodera: DK_BUSY must have mask...



details:   https://anonhg.NetBSD.org/src/rev/e06548b0b9a3
branches:  trunk
changeset: 980595:e06548b0b9a3
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 10 16:30:01 2021 +0000

description:
PR/55986: Ryo Onodera: DK_BUSY must have mask as second argument. Make cd.c
consistent by also using __BIT()

diffstat:

 sys/dev/scsipi/cd.c |  6 +++---
 sys/dev/scsipi/sd.c |  7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 1a87efc84a36 -r e06548b0b9a3 sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Wed Feb 10 12:31:34 2021 +0000
+++ b/sys/dev/scsipi/cd.c       Wed Feb 10 16:30:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.349 2020/10/26 11:39:48 mlelstv Exp $ */
+/*     $NetBSD: cd.c,v 1.350 2021/02/10 16:30:01 christos Exp $        */
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.349 2020/10/26 11:39:48 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.350 2021/02/10 16:30:01 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1378,7 +1378,7 @@
                    XS_CTL_IGNORE_NOT_READY | XS_CTL_IGNORE_MEDIA_CHANGE));
        case DIOCEJECT:
                if (*(int *)addr == 0) {
-                       int pmask = 1 << part;
+                       int pmask = __BIT(part);
                        /*
                         * Don't force eject: check that we are the only
                         * partition open. If so, unlock it.
diff -r 1a87efc84a36 -r e06548b0b9a3 sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Wed Feb 10 12:31:34 2021 +0000
+++ b/sys/dev/scsipi/sd.c       Wed Feb 10 16:30:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.330 2020/09/25 13:08:00 jakllsch Exp $        */
+/*     $NetBSD: sd.c,v 1.331 2021/02/10 16:30:01 christos Exp $        */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.330 2020/09/25 13:08:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.331 2021/02/10 16:30:01 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -954,11 +954,12 @@
                if ((periph->periph_flags & PERIPH_REMOVABLE) == 0)
                        return (ENOTTY);
                if (*(int *)addr == 0) {
+                       int pmask = __BIT(part);
                        /*
                         * Don't force eject: check that we are the only
                         * partition open. If so, unlock it.
                         */
-                       if (DK_BUSY(dksc, part) == 0) {
+                       if (DK_BUSY(dksc, pmask) == 0) {
                                error = scsipi_prevent(periph, SPAMR_ALLOW,
                                    XS_CTL_IGNORE_NOT_READY);
                                if (error)



Home | Main Index | Thread Index | Old Index