remove unnecessary code in protocolmessage
authorjihwan.seo <jihwan.seo@samsung.com>
Tue, 19 May 2015 06:42:08 +0000 (15:42 +0900)
committerErich Keane <erich.keane@intel.com>
Tue, 19 May 2015 17:25:03 +0000 (17:25 +0000)
pdu already is checked previously.
it means pdu is not null
so execution cannot reach removed code.

Change-Id: I2cf8a862937f197fb639f41fbf9e355841bad2e3
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1034
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/src/caprotocolmessage.c

index 34c1bd8..23bd47c 100644 (file)
@@ -902,10 +902,6 @@ CAMessageType_t CAGetMessageTypeFromPduBinaryData(const void *pdu, uint32_t size
     }
 
     coap_hdr_t *hdr = (coap_hdr_t *) pdu;
-    if (NULL == hdr)
-    {
-        return CA_MSG_NONCONFIRM;
-    }
 
     return (CAMessageType_t) hdr->type;
 }
@@ -926,10 +922,6 @@ uint16_t CAGetMessageIdFromPduBinaryData(const void *pdu, uint32_t size)
     }
 
     coap_hdr_t *hdr = (coap_hdr_t *) pdu;
-    if (NULL == hdr)
-    {
-        return 0;
-    }
 
     return hdr->id;
 }
@@ -950,11 +942,6 @@ CAResponseResult_t CAGetCodeFromPduBinaryData(const void *pdu, uint32_t size)
     }
 
     coap_hdr_t *hdr = (coap_hdr_t *) pdu;
-    if (NULL == hdr)
-    {
-        OIC_LOG(ERROR, TAG, "hdr is null");
-        return CA_NOT_FOUND;
-    }
 
     return (CAResponseResult_t) CA_RESPONSE_CODE(hdr->code);
 }