summaryrefslogtreecommitdiffstats
path: root/sys/dev/ccd
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1996-01-31 11:25:46 +0000
committerasami <asami@FreeBSD.org>1996-01-31 11:25:46 +0000
commit8b9cb8fedd0f01ebc9c3c594a904b014753b87a3 (patch)
tree91075511ac77e0c141744e063be029aebef317a0 /sys/dev/ccd
parent6af948881b448b0903d006041d6cf340519a5b11 (diff)
downloadFreeBSD-src-8b9cb8fedd0f01ebc9c3c594a904b014753b87a3.zip
FreeBSD-src-8b9cb8fedd0f01ebc9c3c594a904b014753b87a3.tar.gz
Fix one warning and fix one bug found while looking at another warning (but
caused by a different reason): . #ifndef __FreeBSD__ around check for negative size, FreeBSD size_t is unsigned . Disable mirror/parity if interleave size is 0 (i.e., serial concatenation).
Diffstat (limited to 'sys/dev/ccd')
-rw-r--r--sys/dev/ccd/ccd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index c6b349c..68b7f20 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -1,4 +1,4 @@
-/* $Id: ccd.c,v 1.5 1996/01/30 22:34:53 asami Exp $ */
+/* $Id: ccd.c,v 1.6 1996/01/31 03:28:21 asami Exp $ */
/* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */
@@ -372,8 +372,10 @@ ccdinit(ccd, cpaths, p)
* Calculate the size, truncating to an interleave
* boundary if necessary.
*/
+#ifndef __FreeBSD__
if (size < 0)
size = 0;
+#endif
if (cs->sc_ileave > 1)
size -= size % cs->sc_ileave;
@@ -1087,6 +1089,12 @@ ccdioctl(dev, cmd, data, flag, p)
/* Fill in some important bits. */
ccd.ccd_unit = unit;
ccd.ccd_interleave = ccio->ccio_ileave;
+ if (ccd.ccd_interleave == 0 &&
+ ((ccio->ccio_flags & CCDF_MIRROR) ||
+ (ccio->ccio_flags & CCDF_PARITY))) {
+ printf("ccd%d: disabling mirror/parity, interleave is 0\n", unit);
+ ccio->ccio_flags &= ~(CCDF_MIRROR | CCDF_PARITY);
+ }
if ((ccio->ccio_flags & CCDF_MIRROR) &&
(ccio->ccio_flags & CCDF_PARITY)) {
printf("ccd%d: can't specify both mirror and parity, using mirror\n", unit);
OpenPOWER on IntegriCloud