@@ -370,19 +370,17 @@ EmberAfStatus emAfClusterPreAttributeChangedCallback(const app::ConcreteAttribut
370
370
{
371
371
return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
372
372
}
373
- else
373
+
374
+ EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
375
+ // Casting and calling a function pointer on the same line results in ignoring the return
376
+ // of the call on gcc-arm-none-eabi-9-2019-q4-major
377
+ EmberAfClusterPreAttributeChangedCallback f = (EmberAfClusterPreAttributeChangedCallback)(
378
+ emberAfFindClusterFunction (cluster, CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION));
379
+ if (f != NULL )
374
380
{
375
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
376
- // Casting and calling a function pointer on the same line results in ignoring the return
377
- // of the call on gcc-arm-none-eabi-9-2019-q4-major
378
- EmberAfClusterPreAttributeChangedCallback f = (EmberAfClusterPreAttributeChangedCallback)(
379
- emberAfFindClusterFunction (cluster, CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION));
380
- if (f != NULL )
381
- {
382
- status = f (attributePath, attributeType, size, value);
383
- }
384
- return status;
381
+ status = f (attributePath, attributeType, size, value);
385
382
}
383
+ return status;
386
384
}
387
385
388
386
static void initializeEndpoint (EmberAfDefinedEndpoint * definedEndpoint)
@@ -623,17 +621,15 @@ EmberAfStatus emAfReadOrWriteAttribute(EmberAfAttributeSearchRecord * attRecord,
623
621
: emberAfExternalAttributeReadCallback (attRecord->endpoint , attRecord->clusterId ,
624
622
am, buffer, emberAfAttributeSize (am)));
625
623
}
624
+
625
+ // Internal storage is only supported for fixed endpoints
626
+ if (!isDynamicEndpoint)
627
+ {
628
+ return typeSensitiveMemCopy (attRecord->clusterId , dst, src, am, write , readLength);
629
+ }
626
630
else
627
631
{
628
- // Internal storage is only supported for fixed endpoints
629
- if (!isDynamicEndpoint)
630
- {
631
- return typeSensitiveMemCopy (attRecord->clusterId , dst, src, am, write , readLength);
632
- }
633
- else
634
- {
635
- return EMBER_ZCL_STATUS_FAILURE;
636
- }
632
+ return EMBER_ZCL_STATUS_FAILURE;
637
633
}
638
634
}
639
635
}
@@ -750,10 +746,8 @@ bool emberAfContainsServerFromIndex(uint16_t index, ClusterId clusterId)
750
746
{
751
747
return false ;
752
748
}
753
- else
754
- {
755
- return emberAfFindClusterInType (emAfEndpoints[index ].endpointType , clusterId, CLUSTER_MASK_SERVER);
756
- }
749
+
750
+ return emberAfFindClusterInType (emAfEndpoints[index ].endpointType , clusterId, CLUSTER_MASK_SERVER);
757
751
}
758
752
759
753
namespace chip {
@@ -797,10 +791,8 @@ const EmberAfCluster * emberAfFindCluster(EndpointId endpoint, ClusterId cluster
797
791
{
798
792
return NULL ;
799
793
}
800
- else
801
- {
802
- return emberAfFindClusterInType (emAfEndpoints[ep].endpointType , clusterId, mask);
803
- }
794
+
795
+ return emberAfFindClusterInType (emAfEndpoints[ep].endpointType , clusterId, mask);
804
796
}
805
797
806
798
// Returns cluster within the endpoint; Does not ignore disabled endpoints
0 commit comments