Address all obvious coding style issues caught by checkpatch.pl tool.
sha2.c and sha2.h were kept as there are.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Add SPDX-License-Identifier line to each source file that
contains license text. More details about SPDX license identifiers
can be found at [1].
The scancode-toolkit [2] was used to match license text to the correct
SPDX-License-Identifier:
$ scancode --license --copyright --html scancode_result.html ./
[1] https://spdx.org/licenses/
[2] https://github.com/nexB/scancode-toolkit
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
In order to implement a proper versioning scheme, let's generate a
version.h file that defines VERSION variable built from git
workspace. The version format will be
v<MAJOR>.<MINOR>-<COMMIT##>-<SHA1>
Where:
* MAJOR and MINOR are from the most recent tag
* COMMIT## is the number of commits since last tag, to ensure
incremental numbering
* SHA1 is an abbreviated representation of the actual commit SHA.
This requires building from a git workspace, with we are effectively
calling 'git describe' during the build.
We then define print_version() utility function to be used by all
programs.
Ensure that util.c depends on version.h and that we only update
version.h timestamps when the version actually changes to avoid
unnecessary rebuilds.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
The XML parsing helpers turns libxml strings into standard C-types and
leaks the libxml memory. Fix this by freeing the libxml strings once
they are accessed.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
dc61f8f79e broke ufs provisioning by requiring base 10 for unsigned
attributes (provisioning xml have some values in hexadecimal). strtoul()
would return 0 for these values and provisioning would fail strangely.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Moved the two functions to util.c to remove duplicate code.
The previous error handling in some of the implemenations was
incomplete as it caused qdl to crash.
While the variable errors was incremented we still tried to
return the regular result. Now returning 0/NULL in case of error.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This adds a license header to all files and updates the README with
information on building the project.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>