staging: comedi: comedi_buf: cleanup comedi_buf_munge()
staging: comedi: comedi_buf: cleanup comedi_buf_munge()

Refactor this function so there is a single return point and only
one BUG_ON check. The BUG_ON needs to be looked at to see if it
can be safely removed.

Clarify the test in the munge loop that checks for a block copy
that would extend pass the end of the prealloc_buf.

Reword the comment about the need for the smp_wmb().

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Signed-off-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs