]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: vchiq_arm: rework vchiq_ioc_copy_element_data
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tue, 20 Nov 2018 14:53:41 +0000 (15:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 09:13:36 +0000 (10:13 +0100)
commit44c1e1bcbc334c3716a802a84145650057748611
treea0bbe0c945192ea392cb5bed2c944e0ce281c6c9
parentee43f74585f3e5abaf75d373d2cb313831565acf
staging: vchiq_arm: rework vchiq_ioc_copy_element_data

The function is passed to vchiq_core.c for it to go trough all the
transfer elements (an array of pointers to data) and copy them into the
actual transfer memory (contiguous memory).

The logic in the function was "copy an element and return, except when
the element is empty, in which case look for the next non-empty element
and copy it. The function will be called as many times as necessary until
all the elements are copied".

Now, this approach already forces the function to loop around elements
and felt convoluted, so it was changed to a more straightforward "Copy
all the elements into memory as long as they fit".

The resulting function is shorter and simpler.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c