From: Ian Abbott Date: Fri, 5 Jun 2015 17:30:34 +0000 (+0100) Subject: staging: comedi: das08: clarify sign-magnitude conversion X-Git-Tag: omap-for-v4.2/fixes-rc1^2~92^2~192 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34cce4628b8509dc894735cdc5de8b10db21873a;p=pandora-kernel.git staging: comedi: das08: clarify sign-magnitude conversion For DAS08/JR/16 and DAS08/JR/AO-16 boards, the 16-bit analog input readings are assumed to be in a sign-magnitude format and need converting to the COMEDI unsigned sample format. The expressions to do the conversion look a little messy. Use a local variable `magnitude` to make it easier to follow. Also, there seems to be some discrepancy between the manual for these boards and the COMEDI code. The manual implies that 0 is full-scale negative and 65535 is full-scale positive. However, the COMEDI code has used the sign-magnitude conversion for these boards since these two boards were initially supported by a patch from an external contributor to the COMEDI project back in 2001. Assume the code is correct for now, but add a comment to mention the discrepancy. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed