I broke `s626_set_dac()` by changing the type of the `dacdata` parameter from `short` to `unsigned short`. It's actually designed to take a signed value in the range -0x1fff to +0x2000 although values above 0x1fff get clamped to 0x1fff. (We could change the `maxdata` value to 0x1ffe to avoid the clamping, but `maxdata` values are usually a power of 2 minus 1.) The bug results in all negative values passed to the function being changed to +0x1fff by the clamp. Change the parameter type to `int16_t` to fix the problem. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
|---|---|---|
| .. | ||
| drivers | ||
| kcomedilib | ||
| comedi_buf.c | ||
| comedi_compat32.c | ||
| comedi_compat32.h | ||
| comedi_fops.c | ||
| comedi_internal.h | ||
| comedi_pci.c | ||
| comedi_pcmcia.c | ||
| comedi_usb.c | ||
| comedi.h | ||
| comedidev.h | ||
| comedilib.h | ||
| drivers.c | ||
| Kconfig | ||
| Makefile | ||
| proc.c | ||
| range.c | ||
| TODO | ||