Skip to content

Commit

Permalink
Revert "issue: HPCINFRA-1798 Update code base to clang-format-16"
Browse files Browse the repository at this point in the history
This reverts commit c3fdfcf.

Signed-off-by: Gal Noam <gnoam@nvidia.com>
  • Loading branch information
galnoam committed Jun 10, 2024
1 parent 494bbd2 commit d56acf8
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 71 deletions.
6 changes: 0 additions & 6 deletions contrib/jenkins_tests/style.conf
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ SpacesInSquareBrackets: false
# Parse and format C++ constructs compatible with this standard.
Standard: Cpp11

InsertBraces: true
SpaceInEmptyBlock: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1

TabWidth: 4
UseTab: Never
...
25 changes: 5 additions & 20 deletions src/core/ib/base/verbs_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ int priv_ibv_modify_qp_to_err(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_ERR;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE_EX(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE), EIO)
{
return -1;
}
IF_VERBS_FAILURE_EX(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE), EIO) { return -1; }
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

Expand All @@ -169,10 +166,7 @@ int priv_ibv_modify_qp_to_reset(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_RESET;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE))
{
return -1;
}
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE)) { return -1; }
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END
return 0;
Expand Down Expand Up @@ -219,20 +213,14 @@ int priv_ibv_modify_qp_from_init_to_rts(struct ibv_qp *qp)
memset(&qp_attr, 0, sizeof(qp_attr));
qp_attr.qp_state = IBV_QPS_RTR;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask))
{
return -2;
}
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask)) { return -2; }
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

qp_attr.qp_state = IBV_QPS_RTS;

BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask))
{
return -3;
}
IF_VERBS_FAILURE(xlio_ibv_modify_qp(qp, &qp_attr, qp_attr_mask)) { return -3; }
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END

Expand All @@ -245,10 +233,7 @@ int priv_ibv_query_qp_state(struct ibv_qp *qp)
struct ibv_qp_attr qp_attr;
struct ibv_qp_init_attr qp_init_attr;
BULLSEYE_EXCLUDE_BLOCK_START
IF_VERBS_FAILURE(ibv_query_qp(qp, &qp_attr, IBV_QP_STATE, &qp_init_attr))
{
return -1;
}
IF_VERBS_FAILURE(ibv_query_qp(qp, &qp_attr, IBV_QP_STATE, &qp_init_attr)) { return -1; }
ENDIF_VERBS_FAILURE;
BULLSEYE_EXCLUDE_BLOCK_END
VALGRIND_MAKE_MEM_DEFINED(&qp_attr, sizeof(qp_attr));
Expand Down
12 changes: 4 additions & 8 deletions src/core/infra/DemoObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ void Demo_Observer::update_subject_1(demo_subject_1_key_t key, demo_subject_1_va
if (s1) {
s1->update_val(value); // expected output: notification msg
s1->notify_observers();
} else {
} else
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::get_subject_1(demo_subject_1_key_t key)
Expand All @@ -98,9 +97,8 @@ void Demo_Observer::get_subject_1(demo_subject_1_key_t key)
if (s1) {
s1->get_val(val_s1);
printf("subject1: key = %c, val = %d\n", key, val_s1);
} else {
} else
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::update_subject_2(demo_subject_2_key_t key, demo_subject_2_value_t value)
Expand All @@ -110,9 +108,8 @@ void Demo_Observer::update_subject_2(demo_subject_2_key_t key, demo_subject_2_va
if (s2) {
s2->update_val(value); // expected output: notification msg
s2->notify_observers();
} else {
} else
printf("subject corresponding to key wasn't found\n");
}
}

void Demo_Observer::get_subject_2(demo_subject_2_key_t key)
Expand All @@ -123,9 +120,8 @@ void Demo_Observer::get_subject_2(demo_subject_2_key_t key)
if (s2) {
s2->get_val(val_s2);
printf("subject2: key = %d, val = %d\n", key, val_s2);
} else {
} else
printf("subject corresponding to key wasn't found\n");
}
}

bool Demo_Observer::start_test(Demo_Coll_Mgr1 *coll_for_subjects_1,
Expand Down
2 changes: 1 addition & 1 deletion src/core/infra/sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ neigh_send_data::neigh_send_data(neigh_send_data &&snd_data)
neigh_send_data::~neigh_send_data()
{
if (m_iov.iov_base) {
delete[] ((uint8_t *)m_iov.iov_base);
delete[]((uint8_t *)m_iov.iov_base);
}

if (m_header) {
Expand Down
3 changes: 1 addition & 2 deletions src/core/netlink/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ int main(int argc, char *argv[])
g_vlogger_level = 3;
if (argv && argc > 1) {
int tracelevel = atoi(argv[1]);
if (tracelevel > 0 && tracelevel <= 5) {
if (tracelevel > 0 && tracelevel <= 5)
g_vlogger_level = tracelevel;
}
}
netlink_test();
return 0;
Expand Down
6 changes: 2 additions & 4 deletions src/core/util/chunk_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ template <typename T> class chunk_list_t {
data = (T *)calloc(CHUNK_LIST_CONTAINER_SIZE, sizeof(T));
if (!data || !(cont = new container(data))) {
// Memory allocation error
if (data) {
if (data)
free(data);
}
clist_logerr("Failed to allocate memory");
goto out;
}
Expand Down Expand Up @@ -155,9 +154,8 @@ template <typename T> class chunk_list_t {
inline T front() const
{
// Check if the list is empty.
if (unlikely(empty())) {
if (unlikely(empty()))
return NULL;
}
return m_used_containers.front()->m_p_buffer[m_front];
}

Expand Down
10 changes: 2 additions & 8 deletions src/core/util/sys_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,12 @@ const char *to_str(MODE option, const OPT (&options)[N])
{ \
return option_x::from_int(option, def_value, options); \
} \
const char *to_str(mode_t option) \
{ \
return option_x::to_str(option, options); \
}
const char *to_str(mode_t option) { return option_x::to_str(option, options); }

#define AUTO_ON_OFF_IMPL \
{AUTO, "Auto", {"auto", NULL, NULL}}, {ON, "Enabled", {"on", "enabled", NULL}}, \
{ \
OFF, "Disabled", \
{ \
"off", "disabled", NULL \
} \
OFF, "Disabled", { "off", "disabled", NULL } \
}

template <typename MODE> struct option_t {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/asm-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ static inline void prefetch_range(void *addr, size_t len)
{
char *cp = (char *)addr;
char *end = (char *)addr + len;
for (; cp < end; cp += L1_CACHE_BYTES) {
for (; cp < end; cp += L1_CACHE_BYTES)
prefetch(cp);
}
}

#endif
3 changes: 2 additions & 1 deletion tests/gtest/core/xlio_sockopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

#if defined(EXTRA_API_ENABLED) && (EXTRA_API_ENABLED == 1)

class xlio_sockopt : public xlio_base {};
class xlio_sockopt : public xlio_base {
};

/**
* @test xlio_sockopt.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/mix/mix_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct element {
int value;
};

class mix_list : public mix_base {};
class mix_list : public mix_base {
};

TEST_F(mix_list, ti_1)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/sock/sock_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "sock_base.h"

class sock_socket : public sock_base {};
class sock_socket : public sock_base {
};

/**
* @test sock_socket.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_accept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include "src/core/util/sock_addr.h"
#include "tcp_base.h"

class tcp_accept : public tcp_base {};
class tcp_accept : public tcp_base {
};

/**
* @test tcp_accept.mapped_ipv4_accept
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_connect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#include <algorithm>
#include "tcp_base.h"

class tcp_connect : public tcp_base {};
class tcp_connect : public tcp_base {
};

/**
* @test tcp_connect.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_connect_nb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "tcp_base.h"

class tcp_connect_nb : public tcp_base {};
class tcp_connect_nb : public tcp_base {
};

/**
* @test tcp_connect_nb.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#include "common/cmn.h"
#include "tcp_base.h"

class tcp_event : public tcp_base {};
class tcp_event : public tcp_base {
};

TEST_F(tcp_event, DISABLED_ti_1)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_rfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "tcp_base.h"

class tcp_rfs : public tcp_base {};
class tcp_rfs : public tcp_base {
};

/**
* @test tcp_rfs.single_rule_send
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#include "common/base.h"
#include "tcp_base.h"

class tcp_send : public tcp_base {};
class tcp_send : public tcp_base {
};

/**
* @test tcp_send.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_sendto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "tcp_base.h"

class tcp_sendto : public tcp_base {};
class tcp_sendto : public tcp_base {
};

/**
* @test tcp_sendto.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#include "common/base.h"
#include "tcp_base.h"

class tcp_socket : public tcp_base {};
class tcp_socket : public tcp_base {
};

/**
* @test tcp_socket.ti_1_ipv4
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/tcp/tcp_sockopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@

#define HELLO_STR "hello"

class tcp_sockopt : public tcp_base {};
class tcp_sockopt : public tcp_base {
};

/**
* @test tcp_sockopt.ti_1_getsockopt_tcp_info
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_connect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include "udp_base.h"
#include "src/core/util/sock_addr.h"

class udp_connect : public udp_base {};
class udp_connect : public udp_base {
};

/**
* @test udp_connect.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include "src/core/util/sock_addr.h"
#include "udp_base.h"

class udp_recv : public udp_base {};
class udp_recv : public udp_base {
};

/**
* @test udp_recv.mapped_ipv4_recv
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_rfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "udp_base.h"

class udp_rfs : public udp_base {};
class udp_rfs : public udp_base {
};

/**
* @test udp_rfs.single_rule_send
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
#include "udp_base.h"
#include "src/core/util/sock_addr.h"

class udp_send : public udp_base {};
class udp_send : public udp_base {
};

/**
* @test udp_send.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_sendto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#include "common/cmn.h"
#include "udp_base.h"

class udp_sendto : public udp_base {};
class udp_sendto : public udp_base {
};

/**
* @test udp_sendto.ti_1
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/udp/udp_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#include "udp_base.h"

class udp_socket : public udp_base {};
class udp_socket : public udp_base {
};

/**
* @test udp_socket.ti_1_ipv4
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/xliod/xliod_bitmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

#include "tools/daemon/bitmap.h"

class xliod_bitmap : public ::testing::Test {};
class xliod_bitmap : public ::testing::Test {
};

TEST_F(xliod_bitmap, ti_1)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/gtest/xliod/xliod_hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct element {
int value;
};

class xliod_hash : public ::testing::Test {};
class xliod_hash : public ::testing::Test {
};

TEST_F(xliod_hash, ti_1)
{
Expand Down

0 comments on commit d56acf8

Please sign in to comment.