-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 some more unused bits in MTRDeviceController. #35801
Merged
mergify
merged 1 commit into
project-chip:master
from
bzbarsky-apple:remove-unused-controller-bits
Sep 27, 2024
Merged
Remove some more unused bits in MTRDeviceController. #35801
mergify
merged 1 commit into
project-chip:master
from
bzbarsky-apple:remove-unused-controller-bits
Sep 27, 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
Controller's downloadLogFromNodeWithID is only used from MTRBaseDevice, which is not expected to be used with a non-concrete controller. Unfortunately, nothing actually prevents an MTRBaseDevice beign created against a non-concrete controller, so we can't just move this API to MTRDeviceController_Concrete. With the implementation of downloadLogFromNodeWithID removed, _factory is unused and can be removed. Also, with this implementation removed the factory's downloadLogFromNodeWithID can take MTRDeviceController_Concrete, as can the diagnostic log downloader. Similarly, getSessionFromNode is only used from MTRBaseDevice and MTRCallbackBridgeBase's ActionWithNodeID. And ActionWithNodeID is only used from DispatchAction, which is only called from MTRBaseClusters and MTRBaseDevice, none of which is expected to work with a non-concrete controller. So this implementation can also be removed. At that point directlyGetSessionForNode is only used from MTRDevice_Concrete, so we can just move it to MTRDeviceController_Concrete. getSessionForCommissioneeDevice is only used from ActionWithPASEDevice, which is only used from DispatchAction, like getSessionFromNode. So this implementation can also be removed. At this point asyncDispatchToMatterQueue is only used from: * MTRBaseDevice * MTRClusterStateCacheContainer, where it's used on a controller coming from MTRBaseDevice. * MTRDevice_Concrete, where it's being used on a concrete controller. * MTRDiagnosticLogsDownloader, where it's being used on a concrete controller. * MTRServerAttribute/MTRServerCluster/MTRServerEndpoint, which are not usable with non-concrete controllers as things stand. * MTROTAProviderDelegateBridge, where its being used on a concrete controller. So the MTRDeviceController implementation of asyncDispatchToMatterQueue can also be removed.
Review changes with SemanticDiff. |
pullapprove
bot
requested review from
andy31415,
andyg-apple,
anush-apple,
arkq,
axelnxp,
bauerschwan,
carol-apple,
cecille,
chapongatien,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
Damian-Nordic and
dhrishi
September 26, 2024 19:09
pullapprove
bot
requested review from
ReneJosefsen,
robszewczyk,
saurabhst,
selissia,
sharadb-amazon,
tcarmelveilleux,
tecimovic,
tehampson,
tima-q,
tobiasgraf,
turon,
vivien-apple,
wiba-nordic,
woody-apple,
younghak-hwang,
yufengwangca and
yunhanw-google
September 26, 2024 19:09
PR #35801: Size comparison from 9a96e6d to 6b682e4 Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
kiel-apple
approved these changes
Sep 27, 2024
arkq
approved these changes
Sep 27, 2024
yyzhong-g
pushed a commit
to yyzhong-g/connectedhomeip
that referenced
this pull request
Dec 12, 2024
) Controller's downloadLogFromNodeWithID is only used from MTRBaseDevice, which is not expected to be used with a non-concrete controller. Unfortunately, nothing actually prevents an MTRBaseDevice beign created against a non-concrete controller, so we can't just move this API to MTRDeviceController_Concrete. With the implementation of downloadLogFromNodeWithID removed, _factory is unused and can be removed. Also, with this implementation removed the factory's downloadLogFromNodeWithID can take MTRDeviceController_Concrete, as can the diagnostic log downloader. Similarly, getSessionFromNode is only used from MTRBaseDevice and MTRCallbackBridgeBase's ActionWithNodeID. And ActionWithNodeID is only used from DispatchAction, which is only called from MTRBaseClusters and MTRBaseDevice, none of which is expected to work with a non-concrete controller. So this implementation can also be removed. At that point directlyGetSessionForNode is only used from MTRDevice_Concrete, so we can just move it to MTRDeviceController_Concrete. getSessionForCommissioneeDevice is only used from ActionWithPASEDevice, which is only used from DispatchAction, like getSessionFromNode. So this implementation can also be removed. At this point asyncDispatchToMatterQueue is only used from: * MTRBaseDevice * MTRClusterStateCacheContainer, where it's used on a controller coming from MTRBaseDevice. * MTRDevice_Concrete, where it's being used on a concrete controller. * MTRDiagnosticLogsDownloader, where it's being used on a concrete controller. * MTRServerAttribute/MTRServerCluster/MTRServerEndpoint, which are not usable with non-concrete controllers as things stand. * MTROTAProviderDelegateBridge, where its being used on a concrete controller. So the MTRDeviceController implementation of asyncDispatchToMatterQueue can also be removed.
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.
Controller's downloadLogFromNodeWithID is only used from MTRBaseDevice, which is not expected to be used with a non-concrete controller. Unfortunately, nothing actually prevents an MTRBaseDevice beign created against a non-concrete controller, so we can't just move this API to MTRDeviceController_Concrete.
With the implementation of downloadLogFromNodeWithID removed, _factory is unused and can be removed.
Also, with this implementation removed the factory's downloadLogFromNodeWithID can take MTRDeviceController_Concrete, as can the diagnostic log downloader.
Similarly, getSessionFromNode is only used from MTRBaseDevice and MTRCallbackBridgeBase's ActionWithNodeID. And ActionWithNodeID is only used from DispatchAction, which is only called from MTRBaseClusters and MTRBaseDevice, none of which is expected to work with a non-concrete controller. So this implementation can also be removed.
At that point directlyGetSessionForNode is only used from MTRDevice_Concrete, so we can just move it to MTRDeviceController_Concrete.
getSessionForCommissioneeDevice is only used from ActionWithPASEDevice, which is only used from DispatchAction, like getSessionFromNode. So this implementation can also be removed.
At this point asyncDispatchToMatterQueue is only used from:
So the MTRDeviceController implementation of asyncDispatchToMatterQueue can also be removed.