From fc527448b3360ebcade267aeebe42856adbe2459 Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Tue, 19 May 2015 15:42:08 +0900 Subject: [PATCH] remove unnecessary code in protocolmessage 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/1034 Tested-by: jenkins-iotivity Reviewed-by: Naga Ashok Jampani Reviewed-by: Erich Keane --- resource/csdk/connectivity/src/caprotocolmessage.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/resource/csdk/connectivity/src/caprotocolmessage.c b/resource/csdk/connectivity/src/caprotocolmessage.c index 34c1bd8..23bd47c 100644 --- a/resource/csdk/connectivity/src/caprotocolmessage.c +++ b/resource/csdk/connectivity/src/caprotocolmessage.c @@ -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); } -- 2.7.4