-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove various un-necessary code from MTRDevice. #36132
Merged
mergify
merged 2 commits into
project-chip:master
from
bzbarsky-apple:remove-more-MTRDevice
Oct 18, 2024
Merged
Remove various un-necessary code from MTRDevice. #36132
mergify
merged 2 commits into
project-chip:master
from
bzbarsky-apple:remove-more-MTRDevice
Oct 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Review changes with SemanticDiff. |
PR #36132: Size comparison from 1ae2e6e to f8af6d8 Full report (79 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
woody-apple
approved these changes
Oct 18, 2024
bzbarsky-apple
force-pushed
the
remove-more-MTRDevice
branch
from
October 18, 2024 01:40
f8af6d8
to
c8bc987
Compare
The _deviceInternalStateChanged declaration was duplicated in MTRDevice_Concrete and only needed there. MTRDeviceClusterData implementation can move into its own file. setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed. setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed. Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData on MTRDevice are unused and can be removed. At this point, _informationalVendorID, _informationalProductID, _networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all unused on MTRDevice and can be removed. Now _informationalNumberAtAttributePath is unused on MTRDevice and can be removed. _endpointList is also unused on MTRDevice and can be removed. deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete, so the implementation on MTRDevice can be removed. unitTestGetClusterDataForPath, unitTestGetPersistedClusters, unitTestClusterHasBeenPersisted, unitTestResetSubscription, unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData, unitTestInjectEventReport, unitTestInjectAttributeReport, and unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate implementations on MTRDevice can be removed. At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be removed. Now _getCachedDataVersions is unused on MTRDevice and can be removed. deviceUsesThread is only used by MTRDeviceController_Concrete on MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely. Then _deviceUsesThread becomes unused on MTRDevice and can be removed. Then _clusterDataForPath is unused on MTRDevice and can be removed. Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be removed. Also, _knownClusters is unused on MTRDevice and can be removed. setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete (which has an MTRDevice_Concrete) and from unit tests (which have an MTRDevice_Concrete, though they don't know it), so it can be removed from MTRDevice. Then _resetStorageBehaviorState also becomes unused and can be removed. At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can be removed. This makes _persistClusterDataAsNeeded and _deviceCachePrimed unused, and they can also be removed. At this point, _persistClusterData, _deviceIsReportingExcessively, _reportToPersistenceDelayTimeAfterMutiplier, _reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and _clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be removed. Now _dataStoreExists, _clusterDataToPersistSnapshot, _storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier, _deviceReportingExcessivelyStartTime, and _persistedClusters are unused on MTRDevice and can be removed. At this point _clusterDataToPersist and _persistedClusterData are unused on MTRDevice and can be removed. _systemTimeChangeObserverToken was never actually used on MTRDevice (it's only used on MTRDevice_Concrete) and can be removed. The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be removed. kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed. assertChipStackLockedByCurrentThread is not used in MTRDevice, so the LockTracker.h include can be removed. MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke, MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload, are all unused in MTRDevice, so the imports of the corresponding headers can be removed. arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed. The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete and can be removed on both. _dataValueWithoutDataVersion is unused on MTRDevice and can be removed.
woody-apple
force-pushed
the
remove-more-MTRDevice
branch
from
October 18, 2024 02:07
c8bc987
to
4f29ed3
Compare
PR #36132: Size comparison from 915fb2c to 4f29ed3 Full report (79 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
arkq
approved these changes
Oct 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubber stamping since it has Apple approval.
kiel-apple
reviewed
Oct 18, 2024
FergusHuang
pushed a commit
to FergusHuang/connectedhomeip
that referenced
this pull request
Oct 20, 2024
* Remove various un-necessary code from MTRDevice. The _deviceInternalStateChanged declaration was duplicated in MTRDevice_Concrete and only needed there. MTRDeviceClusterData implementation can move into its own file. setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed. setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed. Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData on MTRDevice are unused and can be removed. At this point, _informationalVendorID, _informationalProductID, _networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all unused on MTRDevice and can be removed. Now _informationalNumberAtAttributePath is unused on MTRDevice and can be removed. _endpointList is also unused on MTRDevice and can be removed. deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete, so the implementation on MTRDevice can be removed. unitTestGetClusterDataForPath, unitTestGetPersistedClusters, unitTestClusterHasBeenPersisted, unitTestResetSubscription, unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData, unitTestInjectEventReport, unitTestInjectAttributeReport, and unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate implementations on MTRDevice can be removed. At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be removed. Now _getCachedDataVersions is unused on MTRDevice and can be removed. deviceUsesThread is only used by MTRDeviceController_Concrete on MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely. Then _deviceUsesThread becomes unused on MTRDevice and can be removed. Then _clusterDataForPath is unused on MTRDevice and can be removed. Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be removed. Also, _knownClusters is unused on MTRDevice and can be removed. setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete (which has an MTRDevice_Concrete) and from unit tests (which have an MTRDevice_Concrete, though they don't know it), so it can be removed from MTRDevice. Then _resetStorageBehaviorState also becomes unused and can be removed. At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can be removed. This makes _persistClusterDataAsNeeded and _deviceCachePrimed unused, and they can also be removed. At this point, _persistClusterData, _deviceIsReportingExcessively, _reportToPersistenceDelayTimeAfterMutiplier, _reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and _clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be removed. Now _dataStoreExists, _clusterDataToPersistSnapshot, _storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier, _deviceReportingExcessivelyStartTime, and _persistedClusters are unused on MTRDevice and can be removed. At this point _clusterDataToPersist and _persistedClusterData are unused on MTRDevice and can be removed. _systemTimeChangeObserverToken was never actually used on MTRDevice (it's only used on MTRDevice_Concrete) and can be removed. The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be removed. kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed. assertChipStackLockedByCurrentThread is not used in MTRDevice, so the LockTracker.h include can be removed. MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke, MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload, are all unused in MTRDevice, so the imports of the corresponding headers can be removed. arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed. The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete and can be removed on both. _dataValueWithoutDataVersion is unused on MTRDevice and can be removed. * Move MTRDeviceClusterData into a separate header/implementation file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The _deviceInternalStateChanged declaration was duplicated in MTRDevice_Concrete and only needed there.
MTRDeviceClusterData implementation can move into MTRDevice_Concrete (and should perhaps just move out into a separate file).
setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed.
setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed.
Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData on MTRDevice are unused and can be removed.
At this point, _informationalVendorID, _informationalProductID, _networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all unused on MTRDevice and can be removed.
Now _informationalNumberAtAttributePath is unused on MTRDevice and can be removed.
_endpointList is also unused on MTRDevice and can be removed.
deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete, so the implementation on MTRDevice can be removed.
unitTestGetClusterDataForPath, unitTestGetPersistedClusters, unitTestClusterHasBeenPersisted, unitTestResetSubscription, unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData, unitTestInjectEventReport, unitTestInjectAttributeReport, and unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate implementations on MTRDevice can be removed.
At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be removed.
Now _getCachedDataVersions is unused on MTRDevice and can be removed.
deviceUsesThread is only used by MTRDeviceController_Concrete on MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely. Then _deviceUsesThread becomes unused on MTRDevice and can be removed.
Then _clusterDataForPath is unused on MTRDevice and can be removed.
Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be removed.
Also, _knownClusters is unused on MTRDevice and can be removed.
setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete (which has an MTRDevice_Concrete) and from unit tests (which have an MTRDevice_Concrete, though they don't know it), so it can be removed from MTRDevice. Then _resetStorageBehaviorState also becomes unused and can be removed.
At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can be removed. This makes _persistClusterDataAsNeeded and _deviceCachePrimed unused, and they can also be removed.
At this point, _persistClusterData, _deviceIsReportingExcessively, _reportToPersistenceDelayTimeAfterMutiplier,
_reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and _clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be removed.
Now _dataStoreExists, _clusterDataToPersistSnapshot, _storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier, _deviceReportingExcessivelyStartTime, and _persistedClusters are unused on MTRDevice and can be removed.
At this point _clusterDataToPersist and _persistedClusterData are unused on MTRDevice and can be removed.
_systemTimeChangeObserverToken was never actually used on MTRDevice (it's only used on MTRDevice_Concrete) and can be removed.
The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be removed.
kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed.
assertChipStackLockedByCurrentThread is not used in MTRDevice, so the LockTracker.h include can be removed.
MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke, MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload, are all unused in MTRDevice, so the imports of the corresponding headers can be removed.
arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed.
The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete and can be removed on both.
_dataValueWithoutDataVersion is unused on MTRDevice and can be removed.