Skip to content

Commit b594ac1

Browse files
committed
clang-tidy: Enable readability-braces-around-statements check
This checks that bodies of if statements and loops (for, do while, and while) are inside braces. Change-Id: Ia5924cc4e9dca98cc29bbaa50923e3269db22089 Signed-off-by: Pavithra Barithaya <[email protected]>
1 parent 695888d commit b594ac1

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ performance-type-promotion-in-math-fn,
243243
performance-unnecessary-copy-initialization,
244244
performance-unnecessary-value-param,
245245
readability-avoid-const-params-in-decls,
246+
readability-braces-around-statements,
246247
readability-const-return-type,
247248
readability-delete-null-pointer,
248249
readability-deleted-default,

bmc_state_manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ void BMC::executeTransition(const Transition tranReq)
141141
// Check to make sure it can be found
142142
auto iter = SYSTEMD_TABLE.find(tranReq);
143143
if (iter == SYSTEMD_TABLE.end())
144+
{
144145
return;
146+
}
145147

146148
const auto& sysdUnit = iter->second;
147149

scheduled_host_transition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ int ScheduledHostTransition::onTimeChange(sd_event_source* /* es */, int fd,
248248
// We are not interested in the data here.
249249
// So read until there is no new data here in the FD
250250
while (read(fd, time.data(), time.max_size()) > 0)
251-
;
251+
{}
252252

253253
debug("BMC system time is changed");
254254
schedHostTran->handleTimeUpdates();

0 commit comments

Comments
 (0)