From 9309034bedad1e81141138ba62db7db66704ca2e Mon Sep 17 00:00:00 2001 From: Elazar Gershuni Date: Thu, 7 Nov 2024 01:16:09 +0200 Subject: [PATCH] address code review Signed-off-by: Elazar Gershuni --- src/asm_files.cpp | 4 ++-- src/crab/add_bottom.hpp | 2 +- src/spec_type_descriptors.hpp | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/asm_files.cpp b/src/asm_files.cpp index b74a3fd38..ed4169079 100644 --- a/src/asm_files.cpp +++ b/src/asm_files.cpp @@ -35,8 +35,8 @@ static vector vector_of(const ELFIO::section& sec) { return vector_of(sec.get_data(), sec.get_size()); } -int create_map_crab(const EbpfMapType& map_type, uint32_t key_size, uint32_t value_size, uint32_t max_entries, - ebpf_verifier_options_t) { +int create_map_crab(const EbpfMapType& map_type, const uint32_t key_size, const uint32_t value_size, + const uint32_t max_entries, ebpf_verifier_options_t) { const EquivalenceKey equiv{map_type.value_type, key_size, value_size, map_type.is_array ? max_entries : 0}; if (!global_program_info->cache.contains(equiv)) { // +1 so 0 is the null FD diff --git a/src/crab/add_bottom.hpp b/src/crab/add_bottom.hpp index deea96f5f..2ae15c42b 100644 --- a/src/crab/add_bottom.hpp +++ b/src/crab/add_bottom.hpp @@ -17,7 +17,7 @@ class AddBottom final { AddBottom() {} public: - explicit AddBottom(auto&& _dom) : dom{std::forward(_dom)} {} + explicit AddBottom(auto&& _dom) : dom{std::forward(_dom)} {} AddBottom(const AddBottom& other) = default; AddBottom(AddBottom& other) = default; AddBottom(AddBottom&& other) = default; diff --git a/src/spec_type_descriptors.hpp b/src/spec_type_descriptors.hpp index 2b16e2eba..3da18504e 100644 --- a/src/spec_type_descriptors.hpp +++ b/src/spec_type_descriptors.hpp @@ -40,6 +40,8 @@ struct EbpfProgramType { void print_map_descriptors(const std::vector& descriptors, std::ostream& o); +// Represents the key characteristics that determine equivalence between eBPF maps. +// Used to cache and compare map configurations across the program. struct EquivalenceKey { EbpfMapValueType value_type; uint32_t key_size;