Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2007 03:43:26 GMT
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 122829 for review
Message-ID:  <200707040343.l643hQ2i073492@repoman.freebsd.org>

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

Change 122829 by rpaulo@rpaulo_epsilon on 2007/07/04 03:42:45

	Style fixes.	

Affected files ...

.. //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmc.c#16 edit
.. //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmcvar.h#7 edit

Differences ...

==== //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmc.c#16 (text+ko) ====

@@ -23,7 +23,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmc.c#15 $
+ * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmc.c#16 $
  *
  */
 
@@ -62,41 +62,45 @@
  * Device interface.
  */
 
-static void	asmc_identify(driver_t *, device_t);
-static int	asmc_probe(device_t);
-static int	asmc_attach(device_t);
-static int	asmc_detach(device_t);
+static void 	asmc_identify(driver_t *driver, device_t parent);
+static int 	asmc_probe(device_t dev);
+static int 	asmc_attach(device_t dev);
+static int 	asmc_detach(device_t dev);
 
 /*
  * SMC functions.
  */
-static int	asmc_init(device_t);
-static int	asmc_wait(device_t, uint8_t);
-static int	asmc_key_write(device_t, const char *, uint8_t *, uint8_t);
-static int	asmc_key_read(device_t, const char *, uint8_t *, uint8_t);
-static int	asmc_fan_count(device_t);
-static int	asmc_fan_getvalue(device_t, const char *, int);
-static int	asmc_temp_getvalue(device_t, const char *);
-static int	asmc_sms_read(device_t, const char *, int16_t *);
-static void	asmc_sms_calibrate(device_t);
-static int	asmc_sms_intr(void *);
-static void	asmc_sms_fastintr(void *);
-static void	asmc_sms_printintr(device_t, uint8_t);
-static void	asmc_sms_task(void *, int);
+static int 	asmc_init(device_t dev);
+static int 	asmc_wait(device_t dev, uint8_t val);
+static int 	asmc_key_write(device_t dev, const char *key, uint8_t *buf,
+    uint8_t len);
+static int 	asmc_key_read(device_t dev, const char *key, uint8_t *buf,
+    uint8_t);
+static int 	asmc_fan_count(device_t dev);
+static int 	asmc_fan_getvalue(device_t dev, const char *key, int fan);
+static int 	asmc_temp_getvalue(device_t dev, const char *key);
+static int 	asmc_sms_read(device_t, const char *key, int16_t *val);
+static void 	asmc_sms_calibrate(device_t dev);
+static int 	asmc_sms_intr(void *arg);
+static void 	asmc_sms_fastintr(void *arg);
+static void 	asmc_sms_printintr(device_t dev, uint8_t);
+static void 	asmc_sms_task(void *arg, int pending);
+
 /*
  * Model functions.
  */
-static int	asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_fantargetspeed(SYSCTL_HANDLER_ARGS);
-static int	asmc_temp_sysctl(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_sms_x(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_sms_y(SYSCTL_HANDLER_ARGS);
-static int	asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_fantargetspeed(SYSCTL_HANDLER_ARGS);
+static int 	asmc_temp_sysctl(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_sms_x(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_sms_y(SYSCTL_HANDLER_ARGS);
+static int 	asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS);
 
-static struct asmc_model *asmc_match(device_t);
+static struct asmc_model *
+		asmc_match(device_t dev);
 
 #define ASMC_SMS_FUNCS	asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \
 			asmc_mb_sysctl_sms_z
@@ -253,21 +257,20 @@
 	 */
 	sysctl_ctx_init(&sc->sc_sysctl_ctx);
 	sc->sc_root_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
-					   SYSCTL_STATIC_CHILDREN(_hw),
-					   OID_AUTO,
-					   device_get_name(dev),
-					   CTLFLAG_RD, 0,
-					   device_get_desc(dev));
+			       SYSCTL_STATIC_CHILDREN(_hw),
+			       OID_AUTO,
+			       device_get_name(dev),
+			       CTLFLAG_RD, 0,
+			       device_get_desc(dev));
 
 	/*
 	 * hw.asmc.fan.* tree.
 	 */
 	sc->sc_fan_tree[0] = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
-					     SYSCTL_CHILDREN(sc->sc_root_tree),
-					     OID_AUTO,
-					     "fan",
-					     CTLFLAG_RD, 0,
-					     "Fan Root Tree");
+			         SYSCTL_CHILDREN(sc->sc_root_tree),
+				 OID_AUTO, "fan",
+				 CTLFLAG_RD, 0,
+				 "Fan Root Tree");
 
 	for (i = 1; i <= sc->sc_nfan; i++) {
 		j = i - 1;
@@ -275,45 +278,44 @@
 		name[1] = 0;
 		sc->sc_fan_tree[i] = 
 			SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
-					SYSCTL_CHILDREN(sc->sc_fan_tree[0]),
-					OID_AUTO,
-					name,
-					CTLFLAG_RD, 0,
-					"Fan Subtree");
+			    SYSCTL_CHILDREN(sc->sc_fan_tree[0]),
+			    OID_AUTO, name,
+			    CTLFLAG_RD, 0,
+			    "Fan Subtree");
 
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
-				OID_AUTO, "speed", CTLTYPE_INT | CTLFLAG_RD,
-				dev, j, model->smc_fan_speed, "I",
-				"Fan speed in RPM");
+		    SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
+		    OID_AUTO, "speed", CTLTYPE_INT | CTLFLAG_RD,
+		    dev, j, model->smc_fan_speed, "I",
+		    "Fan speed in RPM");
 
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
-				OID_AUTO, "safespeed",
-				CTLTYPE_INT | CTLFLAG_RD,
-				dev, j, model->smc_fan_safespeed, "I",
-				"Fan safe speed in RPM");
+		    SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
+		    OID_AUTO, "safespeed",
+		    CTLTYPE_INT | CTLFLAG_RD,
+		    dev, j, model->smc_fan_safespeed, "I",
+		    "Fan safe speed in RPM");
 
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
-				OID_AUTO, "minspeed",
-				CTLTYPE_INT | CTLFLAG_RD,
-				dev, j, model->smc_fan_minspeed, "I",
-				"Fan minimum speed in RPM");
+		    SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
+		    OID_AUTO, "minspeed",
+		    CTLTYPE_INT | CTLFLAG_RD,
+		    dev, j, model->smc_fan_minspeed, "I",
+		    "Fan minimum speed in RPM");
 
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
-				OID_AUTO, "maxspeed",
-				CTLTYPE_INT | CTLFLAG_RD,
-				dev, j, model->smc_fan_maxspeed, "I",
-				"Fan maximum speed in RPM");
+		    SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
+		    OID_AUTO, "maxspeed",
+		    CTLTYPE_INT | CTLFLAG_RD,
+		    dev, j, model->smc_fan_maxspeed, "I",
+		    "Fan maximum speed in RPM");
 
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
-				OID_AUTO, "targetspeed",
-				CTLTYPE_INT | CTLFLAG_RD,
-				dev, j, model->smc_fan_targetspeed, "I",
-				"Fan target speed in RPM");
+		    SYSCTL_CHILDREN(sc->sc_fan_tree[i]),
+		    OID_AUTO, "targetspeed",
+		    CTLTYPE_INT | CTLFLAG_RD,
+		    dev, j, model->smc_fan_targetspeed, "I",
+		    "Fan target speed in RPM");
 	}
 
 	/*
@@ -321,19 +323,18 @@
 	 */
 
 	sc->sc_temp_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
-					   SYSCTL_CHILDREN(sc->sc_root_tree),
-					   OID_AUTO,
-					   "temp",
-					   CTLFLAG_RD, 0,
-					   "Temperature sensors");
+			       SYSCTL_CHILDREN(sc->sc_root_tree),
+			       OID_AUTO, "temp",
+			       CTLFLAG_RD, 0,
+			       "Temperature sensors");
 
 	for (i = 0; model->smc_temps[i]; i++) {
 		SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-				SYSCTL_CHILDREN(sc->sc_temp_tree),
-				OID_AUTO, model->smc_tempnames[i],
-				CTLTYPE_INT | CTLFLAG_RD,
-				dev, i, asmc_temp_sysctl, "I",
-				model->smc_tempdescs[i]);
+		    SYSCTL_CHILDREN(sc->sc_temp_tree),
+		    OID_AUTO, model->smc_tempnames[i],
+		    CTLTYPE_INT | CTLFLAG_RD,
+		    dev, i, asmc_temp_sysctl, "I",
+		    model->smc_tempdescs[i]);
 	}
 
 	if (model->smc_sms_x == NULL)
@@ -343,28 +344,27 @@
 	 * hw.asmc.sms tree.
 	 */
 	sc->sc_sms_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
-					  SYSCTL_CHILDREN(sc->sc_root_tree),
-					  OID_AUTO,
-					  "sms",
-					  CTLFLAG_RD, 0,
-					  "Sudden Motion Sensor");
+			      SYSCTL_CHILDREN(sc->sc_root_tree),
+			      OID_AUTO, "sms",
+			      CTLFLAG_RD, 0,
+			      "Sudden Motion Sensor");
 	SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-			SYSCTL_CHILDREN(sc->sc_sms_tree),
-			OID_AUTO, "x", CTLTYPE_INT | CTLFLAG_RD,
-			dev, 0, model->smc_sms_x, "I",
-			"Sudden Motion Sensor X value");
+	    SYSCTL_CHILDREN(sc->sc_sms_tree),
+	    OID_AUTO, "x", CTLTYPE_INT | CTLFLAG_RD,
+	    dev, 0, model->smc_sms_x, "I",
+	    "Sudden Motion Sensor X value");
 
 	SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-			SYSCTL_CHILDREN(sc->sc_sms_tree),
-			OID_AUTO, "y", CTLTYPE_INT | CTLFLAG_RD,
-			dev, 0, model->smc_sms_y, "I",
-			"Sudden Motion Sensor Y value");
+	    SYSCTL_CHILDREN(sc->sc_sms_tree),
+	    OID_AUTO, "y", CTLTYPE_INT | CTLFLAG_RD,
+	    dev, 0, model->smc_sms_y, "I",
+	    "Sudden Motion Sensor Y value");
 
 	SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
-			SYSCTL_CHILDREN(sc->sc_sms_tree),
-			OID_AUTO, "z", CTLTYPE_INT | CTLFLAG_RD,
-			dev, 0, model->smc_sms_z, "I",
-			"Sudden Motion Sensor Z value");
+	    SYSCTL_CHILDREN(sc->sc_sms_tree),
+	    OID_AUTO, "z", CTLTYPE_INT | CTLFLAG_RD,
+	    dev, 0, model->smc_sms_z, "I",
+	    "Sudden Motion Sensor Z value");
 
 	/*
 	 * Need a taskqueue to send devctl_notify() events
@@ -376,10 +376,10 @@
 	 */
 	TASK_INIT(&sc->sms_task, 0, asmc_sms_task, sc);
 	sc->sms_tq = taskqueue_create_fast("asmc_taskq", M_WAITOK,
-					   taskqueue_thread_enqueue,
-					   &sc->sms_tq);
+		         taskqueue_thread_enqueue,
+			 &sc->sms_tq);
 	taskqueue_start_threads(&sc->sms_tq, 1, PI_REALTIME, "%s sms taskq",
-				device_get_nameunit(dev));
+	    device_get_nameunit(dev));
 
 
 	/*
@@ -387,7 +387,7 @@
 	 */
 	sc->sc_rid = 0;
 	sc->sc_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_rid,
-					ASMC_IRQ, ASMC_IRQ, 1, RF_ACTIVE);
+		         ASMC_IRQ, ASMC_IRQ, 1, RF_ACTIVE);
 	if (sc->sc_res == NULL) {
 		device_printf(dev, "unable to allocate IRQ resource\n");
 		taskqueue_free(sc->sms_tq);
@@ -395,14 +395,14 @@
 	}
 
 	ret = bus_setup_intr(dev, sc->sc_res, 
-			     INTR_TYPE_MISC | INTR_MPSAFE,
-			     asmc_sms_intr, NULL, dev, &sc->sc_cookie);
+	          INTR_TYPE_MISC | INTR_MPSAFE,
+		  asmc_sms_intr, NULL, dev, &sc->sc_cookie);
 
 	if (ret) {
 		ret = bus_setup_intr(dev, sc->sc_res,
-				     INTR_TYPE_MISC | INTR_MPSAFE,
-				     NULL,  asmc_sms_fastintr, dev,
-				     &sc->sc_cookie);
+		          INTR_TYPE_MISC | INTR_MPSAFE,
+			  NULL,  asmc_sms_fastintr, dev,
+			  &sc->sc_cookie);
 		if (ret == 0)
 			device_printf(dev, "unable to setup fast interrupt. "
 				      "Using normal mode.\n");
@@ -410,8 +410,7 @@
 
 	if (ret) {
 		device_printf(dev, "unable to setup SMS IRQ\n");
-		bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid,
-				     sc->sc_res);
+		bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid, sc->sc_res);
 	}
 
 out:

==== //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmcvar.h#7 (text+ko) ====

@@ -23,42 +23,36 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmcvar.h#6 $
+ * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/asmc/asmcvar.h#7 $
  *
  */
 
 #define ASMC_MAXFANS	2
 
 struct asmc_softc {
-	device_t	sc_dev;
-	struct mtx     	sc_mtx;
-
-	int		sc_nfan;
-
-	int16_t		sms_rest_x;
-	int16_t		sms_rest_y;
-	int16_t		sms_rest_z;
-
+	device_t 		sc_dev;
+	struct mtx 		sc_mtx;
+	int 			sc_nfan;
+	int16_t			sms_rest_x;
+	int16_t			sms_rest_y;
+	int16_t			sms_rest_z;
 	struct sysctl_ctx_list	sc_sysctl_ctx;
-	struct sysctl_oid      *sc_root_tree;
-	struct sysctl_oid      *sc_fan_tree[ASMC_MAXFANS+1];
-	struct sysctl_oid      *sc_temp_tree;
-	struct sysctl_oid      *sc_sms_tree;
-
-	struct asmc_model	*sc_model;
-
-	int			sc_rid;
-	struct resource		*sc_res;
-	void			*sc_cookie;
-
-	int			sms_intrtype;
-	struct taskqueue	*sms_tq;
-	struct task		sms_task;
+	struct sysctl_oid 	*sc_root_tree;
+	struct sysctl_oid 	*sc_fan_tree[ASMC_MAXFANS+1];
+	struct sysctl_oid 	*sc_temp_tree;
+	struct sysctl_oid 	*sc_sms_tree;
+	struct asmc_model 	*sc_model;
+	int 			sc_rid;
+	struct resource 	*sc_res;
+	void 			*sc_cookie;
+	int 			sms_intrtype;
+	struct taskqueue 	*sms_tq;
+	struct task 		sms_task;
 };
 
 struct asmc_model {
-	const char	 *smc_model;	/* smbios.system.product env var. */
-	const char	 *smc_desc;	/* driver description */
+	const char 	 *smc_model;	/* smbios.system.product env var. */
+	const char 	 *smc_desc;	/* driver description */
 
 	/* Helper functions */
 	int (*smc_sms_x)(SYSCTL_HANDLER_ARGS);
@@ -70,9 +64,9 @@
 	int (*smc_fan_maxspeed)(SYSCTL_HANDLER_ARGS);
 	int (*smc_fan_targetspeed)(SYSCTL_HANDLER_ARGS);
 
-	const char	*smc_temps[8];
-	const char	*smc_tempnames[8];
-	const char	*smc_tempdescs[8];
+	const char 	*smc_temps[8];
+	const char 	*smc_tempnames[8];
+	const char 	*smc_tempdescs[8];
 };
 
 /*



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