Skip to content

Commit 264c459

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Remove unused private from fboss/agent/InterfaceStats.cpp +25
Summary: `-Wunused-private-field` has identified an unused private field such fields consume unnecessary memory and create readability issues. This diff removes one or more such fields and their associated initialization code. This diff was generated by Claude using fbcode/scripts/rbarnes/work-plans/unused_field_fixes_plan.md and manually reviewed by r-barnes. I consider it low risk because the compiler has identified the underlying issue and the fix itself is hard to get wrong in a way that doesn't break compilation: eliminating an unused field would cause a compiler error, forgetting to remove constructor code would cause a compiler error, mauling the remaining constructors in any obvious way would be a compiler error, commenting out or forgetting to comment out constructor arguments would be a compiler error. Differential Revision: D90823526 fbshipit-source-id: 93ac90720efe66723f64101c63cf91c53aa1cec8
1 parent 98e5529 commit 264c459

File tree

13 files changed

+17
-38
lines changed

13 files changed

+17
-38
lines changed

fboss/agent/InterfaceStats.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace facebook::fboss {
1717
InterfaceStats::InterfaceStats(
1818
InterfaceID intfID,
1919
std::string intfName,
20-
SwitchStats* switchStats)
21-
: intfID_(intfID), intfName_(intfName), switchStats_(switchStats) {
20+
SwitchStats* /*switchStats*/)
21+
: intfID_(intfID), intfName_(intfName) {
2222
if (!intfName_.empty()) {
2323
tcData().addStatValue(getCounterKey(kRouterAdvertisement), 0, SUM);
2424
}

fboss/agent/InterfaceStats.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class InterfaceStats {
2727

2828
InterfaceID intfID_;
2929
std::string intfName_;
30-
SwitchStats* switchStats_;
3130
};
3231

3332
} // namespace facebook::fboss

fboss/agent/SwAgentInitializer.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,11 @@ class SwAgentSignalHandler : public SignalHandler {
5656
public:
5757
SwAgentSignalHandler(
5858
folly::EventBase* eventBase,
59-
SwSwitch* sw,
59+
SwSwitch* /*sw*/,
6060
SignalHandler::StopServices stopServices)
61-
: SignalHandler(eventBase, std::move(stopServices)), sw_(sw) {}
61+
: SignalHandler(eventBase, std::move(stopServices)) {}
6262

6363
void signalReceived(int /*signum*/) noexcept override;
64-
65-
private:
66-
SwSwitch* sw_;
6764
};
6865

6966
class SwAgentInitializer : public AgentInitializer {

fboss/agent/hw/sai/switch/SaiUdfManager.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class SaiUdfManager {
5454

5555
SaiUdfManager(
5656
SaiStore* saiStore,
57-
SaiManagerTable* managerTable,
58-
const SaiPlatform* platform)
59-
: saiStore_(saiStore), managerTable_(managerTable), platform_(platform) {}
57+
SaiManagerTable* /*managerTable*/,
58+
const SaiPlatform* /*platform*/)
59+
: saiStore_(saiStore) {}
6060

6161
static auto constexpr kMaskDontCare = 0;
6262
static auto constexpr kMaskAny = 0xFFFF;
@@ -103,8 +103,6 @@ class SaiUdfManager {
103103
UdfMatchHandles udfMatchHandles_;
104104
UdfGroupHandles udfGroupHandles_;
105105
SaiStore* saiStore_;
106-
SaiManagerTable* managerTable_;
107-
const SaiPlatform* platform_;
108106
};
109107

110108
} // namespace facebook::fboss

fboss/agent/hw/sai/switch/SaiWredManager.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class SaiWredManager {
2828
public:
2929
SaiWredManager(
3030
SaiStore* saiStore,
31-
SaiManagerTable* managerTable,
32-
const SaiPlatform* platform)
33-
: saiStore_(saiStore), managerTable_(managerTable), platform_(platform) {}
31+
SaiManagerTable* /*managerTable*/,
32+
const SaiPlatform* /*platform*/)
33+
: saiStore_(saiStore) {}
3434

3535
std::shared_ptr<SaiWred> getOrCreateProfile(const PortQueue& queue);
3636

@@ -41,8 +41,6 @@ class SaiWredManager {
4141
const PortQueue& queue) const;
4242

4343
SaiStore* saiStore_;
44-
SaiManagerTable* managerTable_;
45-
const SaiPlatform* platform_;
4644
};
4745

4846
} // namespace facebook::fboss

fboss/agent/hw/sai/switch/npu/bcm/SaiTamManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ void unbindTamObjectFromSwitchAndPort(
207207

208208
SaiTamManager::SaiTamManager(
209209
SaiStore* saiStore,
210-
SaiManagerTable* managerTable,
211-
SaiPlatform* platform)
212-
: saiStore_(saiStore), managerTable_(managerTable), platform_(platform) {}
210+
SaiManagerTable* /*managerTable*/,
211+
SaiPlatform* /*platform*/)
212+
: saiStore_(saiStore) {}
213213

214214
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0)
215215
void SaiTamManager::addDnxMirrorOnDropReport(

fboss/agent/test/AgentEnsembleIntegrationTestBase.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,5 @@ class AgentEnsembleIntegrationTestBase : public AgentEnsembleTest {
1818
public:
1919
void SetUp() override;
2020
void TearDown() override;
21-
22-
private:
23-
const AgentEnsemble* ensemble_;
2421
};
2522
} // namespace facebook::fboss

fboss/fsdb/oper/CowDeletePathTraverseHelper.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct CowDeletePathTraverseHelper
2323
using Base::path;
2424
using Base::shouldShortCircuit;
2525

26-
CowDeletePathTraverseHelper(SubscriptionPathStore* root) : root_(root) {
26+
CowDeletePathTraverseHelper(SubscriptionPathStore* root) {
2727
pathStores_.emplace_back(root);
2828
}
2929

@@ -68,7 +68,6 @@ struct CowDeletePathTraverseHelper
6868

6969
private:
7070
std::vector<SubscriptionPathStore*> pathStores_;
71-
SubscriptionPathStore* root_{nullptr};
7271
};
7372

7473
} // namespace facebook::fboss::fsdb

fboss/fsdb/tests/utils/FsdbTestServer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class FsdbTestServer {
7676
void startTestServer(uint16_t port);
7777
void stopTestServer();
7878
std::string getPublisherId(int publisherIdx) const;
79-
const int kMaxPublishers_{3};
8079
std::shared_ptr<FsdbConfig> config_;
8180
std::shared_ptr<ServiceHandler> handler_;
8281
uint16_t fsdbPort_{};

fboss/lib/bsp/BspPhyIO.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
namespace facebook::fboss {
1414

15-
BspPhyIO::BspPhyIO(int pimID, BspPhyIOControllerInfo& controllerInfo)
16-
: pimID_(pimID) {
15+
BspPhyIO::BspPhyIO(int pimID, BspPhyIOControllerInfo& controllerInfo) {
1716
auto mdioDevName = *controllerInfo.devicePath();
1817
auto controllerId = *controllerInfo.controllerId();
1918
XLOG(DBG5) << __func__ << ": mdioDevName=" << mdioDevName

0 commit comments

Comments
 (0)