Commit a854380c authored by Swann Perarnau's avatar Swann Perarnau

[style/ci] add checkpatch.pl to style checks

checkpatch is the linter from the Linux kernel. This should provide a
good amount of validation on the codestyle of the repo.

Only goes on main header and basic c file for now.
parent 880284f3
Pipeline #6766 passed with stages
in 5 minutes and 40 seconds
# not a linux tree, a list of files
--no-tree
--file
# ignore SPDX
--ignore SPDX_LICENSE_TAG
# block comments are broken because of our license header
--ignore BLOCK_COMMENT_STYLE
# better output format for CI
--terse --no-summary
......@@ -48,3 +48,8 @@ repoquality:
- nix run -f "$ARGOPKGS" repoquality --command repoquality
tags:
- integration
checkpatch:
stage: style
script:
- nix run -f "$ARGOPKGS" checkpatch --command checkpatch.pl src/aml.c include/aml.h
......@@ -58,8 +58,8 @@ int aml_finalize(void);
******************************************************************************/
/**
* An AML area is an implementation of memory operations for several type of devices
* through a consistent abstraction.
* An AML area is an implementation of memory operations for several type of
* devices through a consistent abstraction.
* This abstraction is meant to be implemented for several kind of devices,
* i.e the same function calls allocate different kinds of devices depending
* on the area implementation provided.
......@@ -87,7 +87,7 @@ struct aml_area_ops {
*
* Returns a pointer to allocated memory object.
**/
void* (*mmap)(const struct aml_area_data *area_data,
void* (*mmap)(const struct aml_area_data *area_data,
void *ptr,
size_t size);
......@@ -100,7 +100,7 @@ struct aml_area_ops {
*
* Returns AML_AREA_* error code.
**/
int (*munmap)(const struct aml_area_data *area_data,
int (*munmap)(const struct aml_area_data *area_data,
void *ptr,
size_t size);
};
......@@ -156,11 +156,11 @@ struct aml_tiling_ops {
struct aml_tiling_iterator *iterator, int flags);
int (*destroy_iterator)(struct aml_tiling_data *tiling,
struct aml_tiling_iterator *iterator);
int (*tileid)(const struct aml_tiling_data *tiling, va_list);
int (*tileid)(const struct aml_tiling_data *tiling, va_list coords);
size_t (*tilesize)(const struct aml_tiling_data *tiling, int tileid);
void* (*tilestart)(const struct aml_tiling_data *tiling,
const void *ptr, int tileid);
int (*ndims)(const struct aml_tiling_data *tiling, va_list);
int (*ndims)(const struct aml_tiling_data *tiling, va_list results);
};
struct aml_tiling {
......@@ -198,7 +198,7 @@ size_t aml_tiling_tilesize(const struct aml_tiling *tiling, int tileid);
* Returns the address of the start of the tile identified by "tileid", within
* the provided user data structure.
*/
void* aml_tiling_tilestart(const struct aml_tiling *tiling, const void *ptr,
void *aml_tiling_tilestart(const struct aml_tiling *tiling, const void *ptr,
int tileid);
/*
......@@ -512,7 +512,7 @@ int aml_scratch_cancel(struct aml_scratch *scratch,
* "scratch": an initialized scratchpad structure.
* Returns a base pointer to the scratchpad memory buffer.
*/
void* aml_scratch_baseptr(const struct aml_scratch *scratch);
void *aml_scratch_baseptr(const struct aml_scratch *scratch);
/*
* Release a scratch tile for immediate reuse.
......
......@@ -15,7 +15,7 @@
const int aml_version_major = AML_VERSION_MAJOR;
const int aml_version_minor = AML_VERSION_MINOR;
const int aml_version_patch = AML_VERSION_PATCH;
const char* aml_version_string = AML_VERSION_STRING;
const char *aml_version_string = AML_VERSION_STRING;
int aml_errno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment