diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-11-14 23:26:49 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-11-14 23:26:49 +0000 |
commit | 46b3f12b72cd55c0346ce820ae976c75ac30d358 (patch) | |
tree | b6c6c9e480f135d7a3f4cbc766be544a600e2e19 /sys/kern/kern_sensors.c | |
parent | f65890d1bf8fb36f98d28712b9f19114c989f894 (diff) |
prefer sizeof(*ptr) to sizeof(struct) for malloc and free
Diffstat (limited to 'sys/kern/kern_sensors.c')
-rw-r--r-- | sys/kern/kern_sensors.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 016d10761a6..ad7cf0e6934 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.32 2014/11/08 13:36:51 jasper Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.33 2014/11/14 23:26:48 tedu Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -196,7 +196,7 @@ sensor_task_register(void *arg, void (*func)(void *), unsigned int period) (sensors_taskq = taskq_create("sensors", 1, IPL_HIGH)) == NULL) sensors_taskq = systq; - st = malloc(sizeof(struct sensor_task), M_DEVBUF, M_NOWAIT); + st = malloc(sizeof(*st), M_DEVBUF, M_NOWAIT); if (st == NULL) return (NULL); @@ -247,7 +247,7 @@ sensor_task_work(void *xst, void *arg) rw_exit_write(&st->lock); if (period == 0) - free(st, M_DEVBUF, sizeof(struct sensor_task)); + free(st, M_DEVBUF, sizeof(*st)); else timeout_add_sec(&st->timeout, period); } |