Summary:amf: Fix all Cppcheck 1.77 issues [#2341] 
Review request for Trac Ticket(s): #2341
Peer Reviewer(s): Amf Dev
Pull request to: <<LIST THE PERSON WITH PUSH ACCESS HERE>>
Affected branch(es): <<LIST ALL AFFECTED BRANCH(ES)>>
Development branch: default

--------------------------------
Impacted area       Impact y/n
--------------------------------
 Docs                    n
 Build system            n
 RPM/packaging           n
 Configuration files     n
 Startup scripts         n
 SAF services            y
 OpenSAF services        n
 Core libraries          n
 Samples                 n
 Tests                   n
 Other                   n


Comments (indicate scope for each "y" above):
---------------------------------------------

changeset e1dd9b3074137effee1fac1dd9f4073373253123
Author: A V Mahesh <mahesh.va...@oracle.com>
Date:   Wed, 08 Mar 2017 16:35:10 +0530

        amfa: Fix all Cppcheck 1.77 issues [#2341]

        [staging/src/amf/agent/ava_hdl.cc:59] ->
        [staging/src/amf/agent/ava_hdl.cc:67]: (style) Variable 'rc' is 
reassigned a
        value before the old one has been used.
        [staging/src/amf/agent/ava_hdl.cc:420]: (style) The scope of the 
variable
        'rec' can be reduced. [staging/src/amf/agent/ava_hdl.cc:592]: (style) 
The
        scope of the variable 'i' can be reduced.
        [staging/src/amf/agent/ava_mds.cc:86] ->
        [staging/src/amf/agent/ava_mds.cc:90]: (style) Variable 'rc' is 
reassigned a
        value before the old one has been used.
        [staging/src/amf/agent/ava_mds.cc:149] ->
        [staging/src/amf/agent/ava_mds.cc:158]: (style) Variable 'rc' is 
reassigned
        a value before the old one has been used.
        [staging/src/amf/agent/ava_mds.cc:1020] ->
        [staging/src/amf/agent/ava_mds.cc:1028]: (style) Variable 'rc' is 
reassigned
        a value before the old one has been used.
        [staging/src/amf/agent/ava_mds.cc:1103] ->
        [staging/src/amf/agent/ava_mds.cc:1107]: (style) Variable 'msg' is
        reassigned a value before the old one has been used.
        [staging/src/amf/agent/ava_op.cc:221] ->
        [staging/src/amf/agent/ava_op.cc:222]: (style) Variable
        'osaf_cbk.saAmfContainedComponentInstantiateCallback' is reassigned a 
value
        before the old one has been used. [staging/src/amf/agent/ava_op.cc:240] 
->
        [staging/src/amf/agent/ava_op.cc:241]: (style) Variable
        'osaf_cbk.saAmfContainedComponentInstantiateCallback' is reassigned a 
value
        before the old one has been used. [staging/src/amf/agent/ava_op.cc:241] 
->
        [staging/src/amf/agent/ava_op.cc:242]: (style) Variable
        'osaf_cbk.saAmfContainedComponentInstantiateCallback' is reassigned a 
value
        before the old one has been used. [staging/src/amf/agent/ava_op.cc:120]:
        (style) The scope of the variable 'cb' can be reduced.
        [staging/src/amf/agent/ava_hdl.cc:888]: (style) The function
        'ava_hdl_pend_resp_get' is never used.
        [staging/src/amf/agent/ava_hdl.cc:820]: (style) The function
        'ava_hdl_pend_resp_pop' is never used.
        [staging/src/amf/agent/ava_mds.cc:1132]: (style) The function
        'ava_install_amf_down_cb' is never used.
        [staging/src/amf/agent/ava_init.cc:50]: (style) The function
        'logtrace_init_constructor' is never used.
        [staging/src/amf/agent/amf_agent.cc:1330]: (style) The function
        'saAmfCSIQuiescingComplete' is never used.
        [staging/src/amf/agent/amf_agent.cc:2719]: (style) The function
        'saAmfComponentErrorClear_4' is never used.
        [staging/src/amf/agent/amf_agent.cc:2631]: (style) The function
        'saAmfComponentErrorReport_4' is never used.
        [staging/src/amf/agent/amf_agent.cc:1256]: (style) The function
        'saAmfComponentNameGet' is never used.
        [staging/src/amf/agent/amf_agent.cc:426]: (style) The function
        'saAmfComponentRegister' is never used.
        [staging/src/amf/agent/amf_agent.cc:588]: (style) The function
        'saAmfComponentUnregister' is never used.
        [staging/src/amf/agent/amf_agent.cc:2698]: (style) The function
        'saAmfCorrelationIdsGet' is never used.
        [staging/src/amf/agent/amf_agent.cc:242]: (style) The function
        'saAmfDispatch' is never used. [staging/src/amf/agent/amf_agent.cc:326]:
        (style) The function 'saAmfFinalize' is never used.
        [staging/src/amf/agent/amf_agent.cc:2326]: (style) The function
        'saAmfHAReadinessStateSet' is never used.
        [staging/src/amf/agent/amf_agent.cc:1441]: (style) The function
        'saAmfHAStateGet' is never used. 
[staging/src/amf/agent/amf_agent.cc:922]:
        (style) The function 'saAmfHealthcheckConfirm' is never used.
        [staging/src/amf/agent/amf_agent.cc:719]: (style) The function
        'saAmfHealthcheckStart' is never used.
        [staging/src/amf/agent/amf_agent.cc:838]: (style) The function
        'saAmfHealthcheckStop' is never used.
        [staging/src/amf/agent/amf_agent.cc:56]: (style) The function
        'saAmfInitialize' is never used. 
[staging/src/amf/agent/amf_agent.cc:2120]:
        (style) The function 'saAmfInitialize_4' is never used.
        [staging/src/amf/agent/amf_agent.cc:2835]: (style) The function
        'saAmfInitialize_o4' is never used.
        [staging/src/amf/agent/amf_agent.cc:2261]: (style) The function
        'saAmfPmStart_3' is never used. 
[staging/src/amf/agent/amf_agent.cc:1141]:
        (style) The function 'saAmfPmStop' is never used.
        [staging/src/amf/agent/amf_agent.cc:2556]: (style) The function
        'saAmfProtectionGroupNotificationFree_4' is never used.
        [staging/src/amf/agent/amf_agent.cc:1532]: (style) The function
        'saAmfProtectionGroupTrack' is never used.
        [staging/src/amf/agent/amf_agent.cc:1709]: (style) The function
        'saAmfProtectionGroupTrackStop' is never used.
        [staging/src/amf/agent/amf_agent.cc:2354]: (style) The function
        'saAmfProtectionGroupTrack_4' is never used.
        [staging/src/amf/agent/amf_agent.cc:2777]: (style) The function
        'saAmfResponse_4' is never used. 
[staging/src/amf/agent/amf_agent.cc:174]:
        (style) The function 'saAmfSelectionObjectGet' is never used. 
(information)
        Cppcheck cannot find all the include files (use --check-config for 
details)
        [staging/src/amf/amfwd/amf_wdog.c:106]: (warning) %u in format string 
(no.
        1) requires 'unsigned int' but the argument type is 'int'.
        [staging/src/amf/amfwd/amf_wdog.c:108]: (style) Obsolete function 
'asctime'
        called. It is recommended to use 'strftime' instead. (information) 
Cppcheck
        cannot find all the include files (use --check-config for details)
        [staging/src/amf/common/d2nmsg.c:272] ->
        [staging/src/amf/common/d2nmsg.c:273]: (style) Variable
        'd_info.mem_list.notification' is reassigned a value before the old one 
has
        been used. [staging/src/amf/common/d2nmsg.c:230]: (style) The scope of 
the
        variable 'i' can be reduced. [staging/src/amf/common/d2nmsg.c:498]: 
(style)
        The scope of the variable 'i' can be reduced.
        [staging/src/amf/common/n2avamsg.c:495]: (warning) Assignment of 
function
        parameter has no effect outside the function. Did you forget 
dereferencing
        it? [staging/src/amf/common/n2avamsg.c:799]: (style) The function
        'avsv_amf_csi_attr_convert' is never used.
        [staging/src/amf/common/util.c:284]: (style) The function
        'avsv_amfcompcategory_to_avsvcomptype' is never used.
        [staging/src/amf/common/util.c:181]: (style) The function
        'avsv_create_association_class_dn' is never used.
        [staging/src/amf/common/util.c:138]: (style) The function
        'avsv_dblist_sahckey_cmp' is never used.
        [staging/src/amf/common/util.c:110]: (style) The function
        'avsv_dblist_saname_cmp' is never used. 
[staging/src/amf/common/util.c:353]:
        (style) The function 'avsv_dblist_sastring_cmp' is never used.
        [staging/src/amf/common/util.c:60]: (style) The function
        'avsv_dblist_uns32_cmp' is never used. 
[staging/src/amf/common/util.c:85]:
        (style) The function 'avsv_dblist_uns64_cmp' is never used.
        [staging/src/amf/common/d2nmsg.c:636]: (style) The function
        'avsv_dnd_msg_copy' is never used. 
[staging/src/amf/common/d2nmsg.c:531]:
        (style) The function 'avsv_dnd_msg_free' is never used.
        [staging/src/amf/common/n2avamsg.c:77]: (style) The function
        'avsv_nd2nd_avnd_msg_free' is never used.
        [staging/src/amf/common/n2avamsg.c:154]: (style) The function
        'avsv_ndnd_avnd_msg_copy' is never used.
        [staging/src/amf/common/util.c:162]: (style) The function
        'avsv_sa_name_is_null' is never used. 
[staging/src/amf/common/util.c:238]:
        (style) The function 'avsv_sanamet_init_from_association_dn' is never 
used.
        (information) Cppcheck cannot find all the include files (use 
--check-config
        for details)


Complete diffstat:
------------------
 src/amf/agent/ava_hdl.cc  |  13 +++++--------
 src/amf/agent/ava_mds.cc  |  12 ++++--------
 src/amf/agent/ava_op.cc   |  11 ++++-------
 src/amf/amfwd/amf_wdog.c  |   2 +-
 src/amf/common/d2nmsg.c   |   7 ++-----
 src/amf/common/n2avamsg.c |   1 -
 src/amf/tools/amf_pm.c    |   4 +---
 7 files changed, 17 insertions(+), 33 deletions(-)


Testing Commands:
-----------------
AMF Functionality should work as it is.

Testing, Expected Results:
--------------------------
 <<PASTE COMMAND OUTPUTS / TEST RESULTS>>


Conditions of Submission:
-------------------------
 <<HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC>>


Arch      Built     Started    Linux distro
-------------------------------------------
mips        n          n
mips64      n          n
x86         n          n
x86_64      y          y
powerpc     n          n
powerpc64   n          n


Reviewer Checklist:
-------------------
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
    that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
    (i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
    Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
    like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
    cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
    too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
    Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
    commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
    of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
    comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
    the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
    for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
    do not contain the patch that updates the Doxygen manual.


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to