osaf/services/saf/amf/amfd/sg.cc |  64 +++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 29 deletions(-)


No functional changes. Just variable rename and some shorter lines in sg.cc

diff --git a/osaf/services/saf/amf/amfd/sg.cc b/osaf/services/saf/amf/amfd/sg.cc
--- a/osaf/services/saf/amf/amfd/sg.cc
+++ b/osaf/services/saf/amf/amfd/sg.cc
@@ -481,23 +481,22 @@ done1:
        return error;
 }
 
-static SaAisErrorT ccb_completed_modify_hdlr(CcbUtilOperationData_t *opdata)
+static SaAisErrorT ccb_completed_modify_hdlr(const CcbUtilOperationData_t 
*opdata)
 {
        SaAisErrorT rc = SA_AIS_OK;
-       AVD_SG *avd_sg = NULL;
-       AVD_AMF_SG_TYPE *avd_sg_type = NULL;
+       AVD_SG *sg;
        const SaImmAttrModificationT_2 *attr_mod;
        int i = 0;
 
        TRACE_ENTER2("'%s'", opdata->objectName.value);
 
-       avd_sg = avd_sg_get(&opdata->objectName);
-       osafassert(avd_sg != NULL);
+       sg = avd_sg_get(&opdata->objectName);
+       osafassert(sg != NULL);
 
        /* Validate whether we can modify it. */
 
-       if ((avd_sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED_INSTANTIATION) ||
-               (avd_sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED)) {
+       if ((sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED_INSTANTIATION) ||
+               (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED)) {
 
                i = 0;
                while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) 
{
@@ -505,7 +504,8 @@ static SaAisErrorT ccb_completed_modify_
                        void *value = NULL;
 
                        /* Attribute value removed */
-                       if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) || 
(attribute->attrValues == NULL))
+                       if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
+                                       (attribute->attrValues == NULL))
                                continue;
 
                        value = attribute->attrValues[0];
@@ -513,23 +513,25 @@ static SaAisErrorT ccb_completed_modify_
                        if (!strcmp(attribute->attrName, "saAmfSGType")) {
                                SaNameT sg_type_name = *((SaNameT *)value);
 
-                               if (avd_sg->saAmfSGAdminState == 
SA_AMF_ADMIN_LOCKED) {
-                                       report_ccb_validation_error(opdata, 
"%s: Attribute saAmfSGType cannot be modified"
-                                                       " when SG is not in 
locked instantion", __FUNCTION__);
+                               if (sg->saAmfSGAdminState == 
SA_AMF_ADMIN_LOCKED) {
+                                       report_ccb_validation_error(opdata,
+                                               "%s: Attribute saAmfSGType 
cannot be modified"
+                                               " when SG is not in locked 
instantion", __FUNCTION__);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
 
-                               avd_sg_type = avd_sgtype_get(&sg_type_name);
-                               if (NULL == avd_sg_type) {
-                                       report_ccb_validation_error(opdata, "SG 
Type '%s' not found", sg_type_name.value);
+                               if (avd_sgtype_get(&sg_type_name) == NULL) {
+                                       report_ccb_validation_error(opdata,
+                                               "SG Type '%s' not found", 
sg_type_name.value);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
 
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGSuHostNodeGroup")) {
-                               report_ccb_validation_error(opdata, "%s: 
Attribute saAmfSGSuHostNodeGroup cannot be"
-                                               " modified", __FUNCTION__);
+                               report_ccb_validation_error(opdata,
+                                       "%s: Attribute saAmfSGSuHostNodeGroup 
cannot be modified",
+                                       __FUNCTION__);
                                rc = SA_AIS_ERR_BAD_OPERATION;
                                goto done;
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGAutoAdjust")) {
@@ -540,10 +542,11 @@ static SaAisErrorT ccb_completed_modify_
                                pref_inservice_su = *((SaUint32T *)value);
 
                                if ((pref_inservice_su == 0) ||
-                                       ((avd_sg->sg_redundancy_model < 
SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL) &&
+                                       ((sg->sg_redundancy_model < 
SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL) &&
                                         (pref_inservice_su < 
AVSV_SG_2N_PREF_INSVC_SU_MIN))) {
-                                       report_ccb_validation_error(opdata, 
"%s: Minimum preferred num of su should be 2 in"
-                                                       " 2N, N+M and NWay red 
models", __FUNCTION__);
+                                       report_ccb_validation_error(opdata,
+                                               "%s: Minimum preferred num of 
su should be 2 in"
+                                               " 2N, N+M and NWay red models", 
__FUNCTION__);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
@@ -558,8 +561,8 @@ static SaAisErrorT ccb_completed_modify_
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGAutoRepair")) {
                                uint32_t sg_autorepair = *((SaUint32T 
*)attribute->attrValues[0]);
                                if (sg_autorepair > true ) {
-                                       report_ccb_validation_error(opdata, 
"Invalid saAmfSGAutoRepair SG:'%s'",
-                                                       avd_sg->name.value);
+                                       report_ccb_validation_error(opdata,
+                                               "Invalid saAmfSGAutoRepair 
SG:'%s'", sg->name.value);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
@@ -576,7 +579,8 @@ static SaAisErrorT ccb_completed_modify_
                        void *value = NULL;
 
                        /* Attribute value removed */
-                       if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) || 
(attribute->attrValues == NULL))
+                       if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
+                                       (attribute->attrValues == NULL))
                                continue;
 
                        value = attribute->attrValues[0];
@@ -590,24 +594,26 @@ static SaAisErrorT ccb_completed_modify_
                                pref_inservice_su = *((SaUint32T *)value);
 
                                if ((pref_inservice_su == 0) ||
-                                       ((avd_sg->sg_redundancy_model < 
SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL) &&
+                                       ((sg->sg_redundancy_model < 
SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL) &&
                                         (pref_inservice_su < 
AVSV_SG_2N_PREF_INSVC_SU_MIN))) {
-                                       report_ccb_validation_error(opdata, 
"%s: Minimum preferred num of su should be 2"
-                                                       " in 2N, N+M and NWay 
red models", __FUNCTION__);
+                                       report_ccb_validation_error(opdata,
+                                               "%s: Minimum preferred num of 
su should be 2"
+                                               " in 2N, N+M and NWay red 
models", __FUNCTION__);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGAutoRepair")) {
                                uint32_t sg_autorepair = *((SaUint32T 
*)attribute->attrValues[0]);
                                if (sg_autorepair > SA_TRUE) {
-                                       report_ccb_validation_error(opdata, 
"Invalid saAmfSGAutoRepair SG:'%s'",
-                                                       avd_sg->name.value);
+                                       report_ccb_validation_error(opdata,
+                                               "Invalid saAmfSGAutoRepair 
SG:'%s'", sg->name.value);
                                        rc = SA_AIS_ERR_BAD_OPERATION;
                                        goto done;
                                }
                        } else {
-                               report_ccb_validation_error(opdata, "%s: 
Attribute '%s' cannot be modified when SG is"
-                                               " unlocked", __FUNCTION__, 
attribute->attrName);
+                               report_ccb_validation_error(opdata,
+                                       "%s: Attribute '%s' cannot be modified 
when SG is unlocked",
+                                       __FUNCTION__, attribute->attrName);
                                rc = SA_AIS_ERR_BAD_OPERATION;
                                goto done;
                        }

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to