9145a414 | 05-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix readability-inconsistent-declaration-parameter-name
For example
``` /usr/bin/clang-tidy -checks=-*, readability-inconsistent-declaration-parameter-name -export-fixes /tmp/tmpy4skh98
clang-tidy: Fix readability-inconsistent-declaration-parameter-name
For example
``` /usr/bin/clang-tidy -checks=-*, readability-inconsistent-declaration-parameter-name -export-fixes /tmp/tmpy4skh98o/tmpwv373mwe.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/bios.c ../include/libpldm/bios.h:258:5: error: function 'encode_set_bios_attribute_current_value_req' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name,-warnings-as-errors] int encode_set_bios_attribute_current_value_req( ^ ../src/bios.c:449:5: note: the definition seen here int encode_set_bios_attribute_current_value_req( ^ /mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/bios.h:258:5: note: differing parameters are named here: ('payload_length'), in definition: ('payload_lenth') int encode_set_bios_attribute_current_value_req( ^ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia49183168619867709807507028e34a12cbdb937
show more ...
|
6005f1c8 | 05-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix readability-identifier-naming diagnostic
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-identifier-naming -export-fixes /tmp/tmpsjbxtnss/tmpbj5pbywt.yaml -p=build /mnt
clang-tidy: Fix readability-identifier-naming diagnostic
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-identifier-naming -export-fixes /tmp/tmpsjbxtnss/tmpbj5pbywt.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/platform.c /mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/pdr.h:166:6: error: invalid case style for function 'pldm_pdr_update_TL_pdr' [readability-identifier-naming,-warnings-as-errors] void pldm_pdr_update_TL_pdr(const pldm_pdr *repo, uint16_t terminusHandle, ^~~~~~~~~~~~~~~~~~~~~~ pldm_pdr_update_tl_pdr /mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/pdr.h:166:60: error: invalid case style for parameter 'terminusHandle' [readability-identifier-naming,-warnings-as-errors] void pldm_pdr_update_TL_pdr(const pldm_pdr *repo, uint16_t terminusHandle, ^~~~~~~~~~~~~~ terminus_handle /mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/pdr.h:167:29: error: invalid case style for parameter 'tlEid' [readability-identifier-naming,-warnings-as-errors] uint8_t tid, uint8_t tlEid, bool valid); ^~~~~ tl_eid ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I6419dade685ee656fe773451148f15aefb20becd
show more ...
|
1e0528c2 | 05-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix readability-else-after-return diagnostics
``` /usr/bin/clang-tidy -checks=-*, readability-else-after-return -export-fixes /tmp/tmp4f2o40d3/tmp18pyt1xg.yaml -p=build /mnt/host/andrew/
clang-tidy: Fix readability-else-after-return diagnostics
``` /usr/bin/clang-tidy -checks=-*, readability-else-after-return -export-fixes /tmp/tmp4f2o40d3/tmp18pyt1xg.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/requester/pldm.c /mnt/host/andrew/src/openbmc/libpldm/build/../src/requester/pldm.c:64:4: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors] } else if (length < min_len) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I43dd1da00ed3192cccaf1001e2eb6031cee12a27
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 ...
|
4edb7080 | 05-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix bugprone-reserved-identifier
For example:
``` /usr/bin/clang-tidy -checks=-*, bugprone-reserved-identifier -export-fixes /tmp/tmpzm__u6tl/tmpcmikv8op.yaml -p=build /mnt/host/andrew/
clang-tidy: Fix bugprone-reserved-identifier
For example:
``` /usr/bin/clang-tidy -checks=-*, bugprone-reserved-identifier -export-fixes /tmp/tmpzm__u6tl/tmpcmikv8op.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/pdr.c /mnt/host/andrew/src/openbmc/libpldm/build/../src/pdr.c:605:13: error: declaration uses identifier '_entity_association_pdr_add_entry', which is reserved in the global namespace [bugprone-reserved-identifier,-warnings-as-errors] static void _entity_association_pdr_add_entry(pldm_entity_node *curr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entity_association_pdr_add_entry ```
In the case of header guard macros, prefix them with `LIBPLDM_` and drop the trailing `__`.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I74809142cc428d2c014e0f7ba43e02d9a229eee2
show more ...
|
b705fb0a | 05-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix bugprone-narrowing-conversion diagnostic
``` /usr/bin/clang-tidy -checks=-*, bugprone-narrowing-conversions -export-fixes /tmp/tmp9pcdq4bf/tmpulhoe1tp.yaml -p=build /mnt/host/andrew/
clang-tidy: Fix bugprone-narrowing-conversion diagnostic
``` /usr/bin/clang-tidy -checks=-*, bugprone-narrowing-conversions -export-fixes /tmp/tmp9pcdq4bf/tmpulhoe1tp.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/requester/pldm.c ../src/requester/pldm.c:32:7: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors] rc = write(fd, &MCTP_MSG_TYPE_PLDM, sizeof(MCTP_MSG_TYPE_PLDM)); ^ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I95e70d4692dd57d87216e75adb9ac26ab4b96bb9
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 ...
|
67f7ed98 | 04-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix bugprone-branch-clone diagnostic
``` /usr/bin/clang-tidy -checks=-*, bugprone-branch-clone -export-fixes /tmp/tmplugxq7wz/tmpfx50asij.yaml -p=build /mnt/host/andrew/src/openbmc/libpl
clang-tidy: Fix bugprone-branch-clone diagnostic
``` /usr/bin/clang-tidy -checks=-*, bugprone-branch-clone -export-fixes /tmp/tmplugxq7wz/tmpfx50asij.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/firmware_update.c ../src/firmware_update.c:245:49: error: repeated branch in conditional chain [bugprone-branch-clone,-warnings-as-errors] aux_state_status == PLDM_FD_GENERIC_ERROR) { ^ ../src/firmware_update.c:247:3: note: end of the original } else if (aux_state_status >= ^ ../src/firmware_update.c:249:66: note: clone 1 starts here aux_state_status <= PLDM_FD_VENDOR_DEFINED_STATUS_CODE_END) { ^ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I7867b099bafb92da9547288b886273c470e1b81f
show more ...
|
319304fd | 04-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-tidy: Fix clang-diagnostic-strict-prototypes diagnostics
Produces output such as:
``` /usr/bin/clang-tidy -checks=-*, bugprone-branch-clone -export-fixes /tmp/tmpjjns4w4i/tmp2vh08b10.yaml -p=
clang-tidy: Fix clang-diagnostic-strict-prototypes diagnostics
Produces output such as:
``` /usr/bin/clang-tidy -checks=-*, bugprone-branch-clone -export-fixes /tmp/tmpjjns4w4i/tmp2vh08b10.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/platform.c /mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/pdr.h:35:24: error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes] pldm_pdr *pldm_pdr_init(); ^ void ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ib9b679682cc25b8c1b294d2be856031f77d755d9
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 |
1bf8c87c | 28-Nov-2022 |
Dung Cao <dung@os.amperecomputing.com> |
Add encode/decode for EventMessageSupported
Added encode API for EventMessageSupported command(0x0C) which is defined in DSP0248 Version 1.2.2 sec:16.8.
Signed-off-by: Dung Cao <dung@os.amperecompu
Add encode/decode for EventMessageSupported
Added encode API for EventMessageSupported command(0x0C) which is defined in DSP0248 Version 1.2.2 sec:16.8.
Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Change-Id: Id19ea795d233091841b5654164b66eea59df0806
show more ...
|
9a8e4975 | 28-Nov-2022 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix includes using iwyu tool
These changes are done by running iwyu manually under clang14.
IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in ``
Fix includes using iwyu tool
These changes are done by running iwyu manually under clang14.
IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in ``` https: //github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md. ``` Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: Idaaeffd78c9ad7db2b41a057d40f889ade297c55
show more ...
|
b7c73e50 | 09-Nov-2022 |
Gilbert Chen <gilbertc@nvidia.com> |
Add decode GetPDRRepositoryInfo resp API
Add decode response API for GetPDRRepositoryInfo command(0x50). DSP0248_1.2.0 Table 67
Signed-off-by: Gilbert Chen <gilbertc@nvidia.com> Change-Id: I000be34
Add decode GetPDRRepositoryInfo resp API
Add decode response API for GetPDRRepositoryInfo command(0x50). DSP0248_1.2.0 Table 67
Signed-off-by: Gilbert Chen <gilbertc@nvidia.com> Change-Id: I000be34a217499340bee60dc412ccd72530a52db
show more ...
|
d6ae8988 | 01-Nov-2022 |
Dung Cao <dung@os.amperecomputing.com> |
Add encode/decode for EventMessageBufferSize
Added encode API for EventMessageBufferSize command(0x0D) which is defined in DSP02408 Version 1.2.1 sec:16.9.
Signed-off-by: Dung Cao <dung@os.ampereco
Add encode/decode for EventMessageBufferSize
Added encode API for EventMessageBufferSize command(0x0D) which is defined in DSP02408 Version 1.2.1 sec:16.9.
Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Change-Id: Id3f00706b3d3a1871aa6491cc0ffe2ee42597258
show more ...
|
6c9c9172 | 18-Oct-2022 |
Gilbert Chen <gilbertc@nvidia.com> |
Added encode API for SetTID cmd
Added encode API for SetTID command(0x01) which is defined in DSP0240 Version 1.1.0 sec:8.1.1.
Signed-off-by: Gilbert Chen <gilbertc@nvidia.com> Change-Id: Ia2d5c76e
Added encode API for SetTID cmd
Added encode API for SetTID command(0x01) which is defined in DSP0240 Version 1.1.0 sec:8.1.1.
Signed-off-by: Gilbert Chen <gilbertc@nvidia.com> Change-Id: Ia2d5c76e8ad545e794c72f5963556f1f0e6357fc
show more ...
|
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 ...
|