Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2007 13:57:21 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 132097 for review
Message-ID:  <200712301357.lBUDvLXG075636@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132097

Change 132097 by hselasky@hselasky_laptop001 on 2007/12/30 13:57:15

	
	Style change.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/uchcom.c#7 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/uchcom.c#7 (text+ko) ====

@@ -373,7 +373,7 @@
 	if (error) {
 		goto detach;
 	}
-	return 0;
+	return (0);
 
 detach:
 	uchcom_detach(dev);
@@ -410,7 +410,7 @@
 	USETW(req.wIndex, index);
 	USETW(req.wLength, 0);
 
-	return usbd_do_request(sc->sc_ucom.sc_udev, &req, 0);
+	return (usbd_do_request(sc->sc_ucom.sc_udev, &req, 0));
 }
 
 static usbd_status
@@ -426,9 +426,9 @@
 	USETW(req.wIndex, index);
 	USETW(req.wLength, (uint16_t)buflen);
 
-	return usbd_do_request_flags(sc->sc_ucom.sc_udev, &req, buf,
+	return (usbd_do_request_flags(sc->sc_ucom.sc_udev, &req, buf,
 				     USBD_SHORT_XFER_OK, actlen,
-				     USBD_DEFAULT_TIMEOUT);
+				      USBD_DEFAULT_TIMEOUT));
 }
 
 static usbd_status
@@ -438,9 +438,9 @@
 	DPRINTF(("uchcom: write reg 0x%02X<-0x%02X, 0x%02X<-0x%02X\n",
 		 (unsigned)reg1, (unsigned)val1,
 		 (unsigned)reg2, (unsigned)val2));
-	return uchcom_ctrl_write(
+	return (uchcom_ctrl_write(
 		sc, UCHCOM_REQ_WRITE_REG,
-		reg1|((uint16_t)reg2<<8), val1|((uint16_t)val2<<8));
+		reg1|((uint16_t)reg2<<8), val1|((uint16_t)val2<<8)));
 }
 
 static usbd_status
@@ -455,7 +455,7 @@
 		sc, UCHCOM_REQ_READ_REG,
 		reg1|((uint16_t)reg2<<8), 0, buf, sizeof buf, &actin);
 	if (err)
-		return err;
+	  return (err);
 
 	DPRINTF(("uchcom: read reg 0x%02X->0x%02X, 0x%02X->0x%02X\n",
 		 (unsigned)reg1, (unsigned)buf[0],
@@ -464,7 +464,7 @@
 	if (rval1) *rval1 = buf[0];
 	if (rval2) *rval2 = buf[1];
 
-	return USBD_NORMAL_COMPLETION;
+	return (USBD_NORMAL_COMPLETION);
 }
 
 static usbd_status
@@ -477,29 +477,29 @@
 	err = uchcom_ctrl_read(
 		sc, UCHCOM_REQ_GET_VERSION, 0, 0, buf, sizeof buf, &actin);
 	if (err)
-		return err;
+	  return (err);
 
 	if (rver) *rver = buf[0];
 
-	return USBD_NORMAL_COMPLETION;
+	return (USBD_NORMAL_COMPLETION);
 }
 
 static usbd_status
 uchcom_get_status(struct uchcom_softc *sc, uint8_t *rval)
 {
-	return uchcom_read_reg(sc, UCHCOM_REG_STAT1, rval, UCHCOM_REG_STAT2, NULL);
+  return (uchcom_read_reg(sc, UCHCOM_REG_STAT1, rval, UCHCOM_REG_STAT2, NULL));
 }
 
 static usbd_status
 uchcom_set_dtrrts_10(struct uchcom_softc *sc, uint8_t val)
 {
-	return uchcom_write_reg(sc, UCHCOM_REG_STAT1, val, UCHCOM_REG_STAT1, val);
+  return (uchcom_write_reg(sc, UCHCOM_REG_STAT1, val, UCHCOM_REG_STAT1, val));
 }
 
 static usbd_status
 uchcom_set_dtrrts_20(struct uchcom_softc *sc, uint8_t val)
 {
-	return uchcom_ctrl_write(sc, UCHCOM_REQ_SET_DTRRTS, val, 0);
+  return (uchcom_ctrl_write(sc, UCHCOM_REQ_SET_DTRRTS, val, 0));
 }
 
 
@@ -516,10 +516,10 @@
 	if (err) {
 		device_printf(sc->sc_ucom.sc_dev, "cannot get version: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
-	return 0;
+	return (0);
 }
 
 static void
@@ -543,11 +543,11 @@
 		device_printf(sc->sc_ucom.sc_dev, 
 			      "cannot update status: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 	uchcom_convert_status(sc, cur);
 
-	return 0;
+	return (0);
 }
 
 
@@ -568,10 +568,10 @@
 	if (err) {
 		device_printf(sc->sc_ucom.sc_dev, "cannot set DTR/RTS: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -582,7 +582,7 @@
 
 	err = uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_BREAK2, &brk2);
 	if (err)
-		return EIO;
+	  return (EIO);
 	if (onoff) {
 		/* on - clear bits */
 		brk1 &= ~UCHCOM_BRK1_MASK;
@@ -594,9 +594,9 @@
 	}
 	err = uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_BREAK2, brk2);
 	if (err)
-		return EIO;
+	  return (EIO);
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -614,7 +614,7 @@
 			goto found;
 		}
 	}
-	return -1;
+	return (-1);
 
 found:
 	dp->dv_prescaler = rp->dvr_divider.dv_prescaler;
@@ -624,7 +624,7 @@
 		div = rp->dvr_base_clock / rate;
 		rem = rp->dvr_base_clock % rate;
 		if (div==0 || div>=0xFF)
-			return -1;
+		  return (-1);
 		if ((rem<<1) >= rate)
 			div += 1;
 		dp->dv_div = (uint8_t)-div;
@@ -635,7 +635,7 @@
 
 	dp->dv_mod = mod / 0x100;
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -645,7 +645,7 @@
 	struct uchcom_divider dv;
 
 	if (uchcom_calc_divider_settings(&dv, rate))
-		return EINVAL;
+	  return (EINVAL);
 
 	if ((err = uchcom_write_reg(sc,
 			     UCHCOM_REG_BPS_PRE, dv.dv_prescaler,
@@ -655,10 +655,10 @@
 			     UCHCOM_REG_BPS_PAD, 0))) {
 		device_printf(sc->sc_ucom.sc_dev, " cannot set DTE rate: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -671,7 +671,7 @@
 	if (err) {
 		device_printf(sc->sc_ucom.sc_dev, " cannot get LCR: %s\n",
 		        usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
 	lcr1 &= ~UCHCOM_LCR1_MASK;
@@ -690,7 +690,7 @@
 	case CS5:
 	case CS6:
 	case CS7:
-		return EINVAL;
+	  return (EINVAL);
 	case CS8:
 		break;
 	}
@@ -707,10 +707,10 @@
 	if (err) {
 		device_printf(sc->sc_ucom.sc_dev, "cannot set LCR: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -723,10 +723,10 @@
 	if (err) {
 		device_printf(sc->sc_ucom.sc_dev, "cannot clear: %s\n",
 			      usbd_errstr(err));
-		return EIO;
+		return (EIO);
 	}
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -766,12 +766,12 @@
 	if (err)
 		goto failed;
 
-	return 0;
+	return (0);
 
 failed:
 	device_printf(sc->sc_ucom.sc_dev, "cannot reset: %s\n",
 		      usbd_errstr(err));
-	return EIO;
+	return (EIO);
 }
 
 static int
@@ -781,38 +781,38 @@
 
 	ret = uchcom_update_version(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_clear_chip(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_set_dte_rate(sc, TTYDEF_SPEED);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_set_line_control(sc, CS8);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = update_status(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_reset_chip(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_set_dte_rate(sc, TTYDEF_SPEED); /* XXX */
 	if (ret)
-		return ret;
+	  return (ret);
 
 	sc->sc_dtr = sc->sc_rts = 1;
 	ret = uchcom_set_dtrrts(sc, sc->sc_dtr, sc->sc_rts);
 	if (ret)
-		return ret;
+	  return (ret);
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -833,10 +833,10 @@
 			device_printf(ucom->sc_dev, 
 				      "cannot open interrupt pipe: %s\n",
 				      usbd_errstr(err));
-			return EIO;
+			return (EIO);
 		}
 	}
-	return 0;
+	return (0);
 }
 
 static void
@@ -909,17 +909,17 @@
 	int ret;
 
 	if (sc->sc_ucom.sc_dying)
-		return 0;
+	  return (0);
 
 	ret = uchcom_set_line_control(sc, t->c_cflag);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_set_dte_rate(sc, t->c_ospeed);
 	if (ret)
-		return ret;
+	  return (ret);
 
-	return 0;
+	return (0);
 }
 
 int
@@ -929,17 +929,17 @@
 	struct uchcom_softc *sc = arg;
 
 	if (sc->sc_ucom.sc_dying)
-		return EIO;
+	  return (EIO);
 
 	ret = uchcom_setup_intr_pipe(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
 	ret = uchcom_setup_comm(sc);
 	if (ret)
-		return ret;
+	  return (ret);
 
-	return 0;
+	return (0);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712301357.lBUDvLXG075636>