diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
commit | 771efb08f5bfaf22da0498ae91647fdecb3cc6bb (patch) | |
tree | e4320a83dea3de4df605896db823e0af0f883364 /sys/dev/sound/pci/es137x.c | |
parent | 360dc5b21c582598a9aaf5b3cd6f3832b847ef41 (diff) | |
download | FreeBSD-src-771efb08f5bfaf22da0498ae91647fdecb3cc6bb.zip FreeBSD-src-771efb08f5bfaf22da0498ae91647fdecb3cc6bb.tar.gz |
Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.
Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.
In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported. In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.
Diffstat (limited to 'sys/dev/sound/pci/es137x.c')
-rw-r--r-- | sys/dev/sound/pci/es137x.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index ec6cc75..e7f1655 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1375,7 +1375,7 @@ sysctl_es137x_spdif_enable(SYSCTL_HANDLER_ARGS) r = es_rd(es, ES1370_REG_STATUS, 4); ES_UNLOCK(es); new_en = (r & ENABLE_SPDIF) ? 1 : 0; - err = sysctl_handle_int(oidp, &new_en, sizeof(new_en), req); + err = sysctl_handle_int(oidp, &new_en, 0, req); if (err || req->newptr == NULL) return (err); @@ -1412,7 +1412,7 @@ sysctl_es137x_latency_timer(SYSCTL_HANDLER_ARGS) ES_LOCK(es); val = pci_read_config(dev, PCIR_LATTIMER, 1); ES_UNLOCK(es); - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err || req->newptr == NULL) return (err); @@ -1441,7 +1441,7 @@ sysctl_es137x_fixed_rate(SYSCTL_HANDLER_ARGS) if (val < es_caps.minspeed) val = 0; ES_UNLOCK(es); - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err || req->newptr == NULL) return (err); @@ -1496,7 +1496,7 @@ sysctl_es137x_single_pcm_mixer(SYSCTL_HANDLER_ARGS) set = ES_SINGLE_PCM_MIX(es->escfg); val = set; ES_UNLOCK(es); - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err || req->newptr == NULL) return (err); @@ -1571,7 +1571,7 @@ sysctl_es_polling(SYSCTL_HANDLER_ARGS) ES_LOCK(es); val = es->polling; ES_UNLOCK(es); - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err || req->newptr == NULL) return (err); |