History log of /openbmc/libpldm/src/utils.c (Results 1 – 13 of 13)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# b0c1d20a 07-Nov-2023 Andrew Jeffery <andrew@codeconstruct.com.au>

libpldm: Fix header use

The headers need to work whether we're building libpldm in the repo or
we're building another project depending on the headers in the system
include directory.

Tidy up the p

libpldm: Fix header use

The headers need to work whether we're building libpldm in the repo or
we're building another project depending on the headers in the system
include directory.

Tidy up the paths involved and switch to defining the public headers as
system headers for the purpose of the build.

Change-Id: I49413988c94d393ea5761bc4684edcd2c2482a98
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


# 691668fe 01-Nov-2023 Patrick Williams <patrick@stwcx.xyz>

license: add spdx identifier to all files

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ifddd07cc0eb5edeb2dcb410747073d68c6631cb1


# c0b5a6eb 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Id7eff2a106b4da7af550c473ec391fa00db5e95b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


Revision tags: v0.7.0, v0.6.0, v0.5.0, v0.4.0, v0.3.0
# f89befe3 15-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

meson: Force inclusion of config.h via `-include`

Make sure there's no ambiguity about which config.h is used for includes
in the event that libpldm acquires subprojects, or is used as a
subproject

meson: Force inclusion of config.h via `-include`

Make sure there's no ambiguity about which config.h is used for includes
in the event that libpldm acquires subprojects, or is used as a
subproject itself.

Tested: `meson compile -C build` succeeds

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I08c3bdc807cc268d2401e06f0bfaee07f89ba534

show more ...


# 9d2a1c6a 04-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
wit

libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
without being burdened by them being immediately set in stone.

We implement this wish by introducing three classes of ABI:

1. deprecated
2. stable
3. testing

These are enforced by corresponding function attributes:

1. LIBPLDM_ABI_DEPRECATED
2. LIBPLDM_ABI_STABLE
3. LIBPLDM_ABI_TESTING

Symbol visibility in the library is flipped to 'hidden' by default, so
one of these annotations must be used for the symbol to be exposed.

With these classes in place there are now clear points in time at which
we update the ABI dumps captured under the abi/ directory: When an API
is migrated from the 'testing' class to the 'stable' class, or when
removed from the 'deprecated' class.

Which classes of functions are exposed by the build is controlled by the
new 'abi' meson option. The option is of array type which contains the
list of ABI classes the build should consider. It defaults to enabling
all classes to provide test coverage in CI. The classes used should be
constrained to deprecated and stable (and not test) in any dependent
projects.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I25402e20c7be9c9f264f9ccd7ac36b384823734c

show more ...


# 37dd6a3d 12-May-2023 Andrew Jeffery <andrew@aj.id.au>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository[1] and reformat
the repository.

[1] https://gerrit.openbmc.org/c/openbmc/docs/+/63441

Further, shift the fixup for C's `_Static_assert` into src/msgbuf.h to
prevent a clang-tidy-16 error:

```
/data0/jenkins/workspace/ci-repository/openbmc/libpldm/src/msgbuf.h:315:2: error: '_Static_assert' is a C11 extension [clang-diagnostic-c11-extensions,-warnings-as-errors]
_Static_assert(sizeof(*dst) == sizeof(ldst),
^
```

And fix up the function prototype in the definition of `pldm_open()`:

```
../src/requester/pldm.c:128:16: error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes,-warnings-as-errors]
void pldm_close()
^
void
```

Change-Id: I57b53f51914e39237e733d024e62ab41b3d306c1
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 3ce64fb4 12-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

utils: Fix integer promotion UB in dec2bcd{16,32} encoders

Addresses the following:

```
$ UBSAN_OPTIONS=halt_on_error=1 meson test -C build libpldm_utils_test
ninja: no work to do.
ninja: Entering

utils: Fix integer promotion UB in dec2bcd{16,32} encoders

Addresses the following:

```
$ UBSAN_OPTIONS=halt_on_error=1 meson test -C build libpldm_utils_test
ninja: no work to do.
ninja: Entering directory `/mnt/host/andrew/src/openbmc/libpldm/build'
ninja: no work to do.
1/1 libpldm_utils_test FAIL 0.01s exit status 1
>>> MALLOC_PERTURB_=165 LD_LIBRARY_PATH=/mnt/host/andrew/src/openbmc/libpldm/build/ /mnt/host/andrew/src/openbmc/libpldm/build/tests/libpldm_utils_test

Ok: 0
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0

Full log written to /mnt/host/andrew/src/openbmc/libpldm/build/meson-logs/testlog.txt
$ MALLOC_PERTURB_=194 \
> LD_LIBRARY_PATH=/mnt/host/andrew/src/openbmc/libpldm/build/ \
> /mnt/host/andrew/src/openbmc/libpldm/build/tests/libpldm_utils_test >/dev/null
../src/utils.c:186:57: runtime error: left shift of 39321 by 16 places cannot be represented in type 'int'
$
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I55ae3967706c1e0bee2869063a63746410c819f6

show more ...


# d2c64cbd 05-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

clang-tidy: Fix readability-braces-around-statements diagnostics

For example:

```
/usr/bin/clang-tidy -checks=-*, readability-braces-around-statements -export-fixes /tmp/tmpp5g5_gym/tmpoyj8t6gj.yam

clang-tidy: Fix readability-braces-around-statements diagnostics

For example:

```
/usr/bin/clang-tidy -checks=-*, readability-braces-around-statements -export-fixes /tmp/tmpp5g5_gym/tmpoyj8t6gj.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/utils.c
/mnt/host/andrew/src/openbmc/libpldm/build/../src/utils.c:88:16: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]
while (size--)
^
{
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Id06d4049d5c9db1378b5a66ef1bac5372715a0fd

show more ...


# 0a05b128 04-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

clang-tidy: Fix bugprone-macro-parentheses diagnostics

Example output:

```
/usr/bin/clang-tidy -checks=-*, bugprone-macro-parentheses -export-fixes /tmp/tmpemqa5szx/tmph_piz_ci.yaml -p=build /mnt/h

clang-tidy: Fix bugprone-macro-parentheses diagnostics

Example output:

```
/usr/bin/clang-tidy -checks=-*, bugprone-macro-parentheses -export-fixes /tmp/tmpemqa5szx/tmph_piz_ci.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/base.c
/mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/base.h:137:21: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
^
()
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Id12338430a328436d57d6560db1d3a1c53001b83

show more ...


# a8b8a810 05-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

utils: Reimplement ver2str() for sanity

The dense mix of print_version_field(), snprintf() with its tricky
return semantics, and the tricky POINTER_MOVE() macro are replaced by an
implementation whe

utils: Reimplement ver2str() for sanity

The dense mix of print_version_field(), snprintf() with its tricky
return semantics, and the tricky POINTER_MOVE() macro are replaced by an
implementation where each statement directly inserts one character into
the buffer while preventing buffer overflow.

While we're reworking ver2str(), change the return type to avoid
clang-tidy's bugprone-narrowing-conversion diagnostic. This is an
API/ABI break, but it's one with low impact: The test suite declares the
variable holding the return type as `auto`, while the one ver2str() call
in the entire openbmc github org, in pldmd, immediately discards the
return value (it is never assigned).

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I11708a32019a36ea0d31229f6c91c8a75f7f22d0

show more ...


# e21df505 04-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

utils: dec2bcd8: Make calculation reflect bcd2dec8 in implementation

This is purely a visual improvement to help correlate the implementation
with bcd2dec8().

Signed-off-by: Andrew Jeffery <andrew@

utils: dec2bcd8: Make calculation reflect bcd2dec8 in implementation

This is purely a visual improvement to help correlate the implementation
with bcd2dec8().

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7c4fb3e3191e4b198181b4d99da75d89bb4cd139

show more ...


# 3c016185 04-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

utils: Remove redundant variable definition from bcd codecs

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I750c0f5802462320dfb4ba5d5be3bebdcda9e6fe


Revision tags: v0.2.0
# 9c766792 10-Aug-2022 Andrew Jeffery <andrew@aj.id.au>

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organi

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organisation
of the source code to make it work as a subproject.

There are no .c/.h files changes in this commit, only meson
changes and re-organising the code structure.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I20a71c0c972b1fd81fb359d604433618799102c6

show more ...