tree: Run clang-format to conform to the kernel coding style

The coding style has been a bit erratic. Enforce the linux kernel coding
style by reusing their .clang-format file, running clang-format on the
source, and ignoring the few shortcomings that clang-format has at the
moment (especially on aligning the define values).

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
Maxime Ripard
2018-07-16 22:02:38 +02:00
parent f831082a09
commit 5aeb07f8bf
28 changed files with 1066 additions and 386 deletions
+10 -6
View File
@@ -22,9 +22,9 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/select.h>
@@ -40,7 +40,8 @@ int media_request_alloc(int media_fd)
rc = ioctl(media_fd, MEDIA_IOC_REQUEST_ALLOC, &request_alloc);
if (rc < 0) {
sunxi_cedrus_log("Unable to allocate media request: %s\n", strerror(errno));
sunxi_cedrus_log("Unable to allocate media request: %s\n",
strerror(errno));
return -1;
}
@@ -53,7 +54,8 @@ int media_request_reinit(int request_fd)
rc = ioctl(request_fd, MEDIA_REQUEST_IOC_REINIT, NULL);
if (rc < 0) {
sunxi_cedrus_log("Unable to reinit media request: %s\n", strerror(errno));
sunxi_cedrus_log("Unable to reinit media request: %s\n",
strerror(errno));
return -1;
}
@@ -66,7 +68,8 @@ int media_request_queue(int request_fd)
rc = ioctl(request_fd, MEDIA_REQUEST_IOC_QUEUE, NULL);
if (rc < 0) {
sunxi_cedrus_log("Unable to queue media request: %s\n", strerror(errno));
sunxi_cedrus_log("Unable to queue media request: %s\n",
strerror(errno));
return -1;
}
@@ -76,7 +79,7 @@ int media_request_queue(int request_fd)
int media_request_wait_completion(int request_fd)
{
struct timeval tv = { 0, 300000 };
fd_set except_fds;
fd_set except_fds;
int rc;
FD_ZERO(&except_fds);
@@ -87,7 +90,8 @@ int media_request_wait_completion(int request_fd)
sunxi_cedrus_log("Timeout when waiting for media request\n");
return -1;
} else if (rc < 0) {
sunxi_cedrus_log("Unable to select media request: %s\n", strerror(errno));
sunxi_cedrus_log("Unable to select media request: %s\n",
strerror(errno));
return -1;
}