From 17a5f93b069aab6a55efca6f55f08bc49c31618d Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:31:59 +0900 Subject: [PATCH] driver/alt1250: Modify return value Use macro for retrurn value. --- drivers/modem/alt1250/altcom_lwm2m_hdlr.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/modem/alt1250/altcom_lwm2m_hdlr.c b/drivers/modem/alt1250/altcom_lwm2m_hdlr.c index 5cb6f30116b43..eb7a8b1ddcb56 100644 --- a/drivers/modem/alt1250/altcom_lwm2m_hdlr.c +++ b/drivers/modem/alt1250/altcom_lwm2m_hdlr.c @@ -32,6 +32,12 @@ #include "altcom_lwm2m_hdlr.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define NO_MEMBER (-1) + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ @@ -361,7 +367,7 @@ static int parse_inst_number(FAR uint8_t **buf, FAR size_t *bufsz) if (!isdigit(**buf)) { - return -1; + return NO_MEMBER; } while (*bufsz) @@ -391,7 +397,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz, FAR int *srvid = (FAR int *)&cb_args[1]; FAR int *inst = (FAR int *)cb_args[2]; - /* The valiable of "inst" is a type of struct lwm2mstub_instance_s in fact. + /* The content of "inst" is a type of struct lwm2mstub_instance_s in fact. * But actually it is the same as int[4]. * To make simpler logic, inst is defined as int[4] (int pointer). */ @@ -413,7 +419,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz, *event = parse_inst_number(&pktbuf, &pktsz); if (*event < 0) { - return -1; + return ERROR; } if (pktsz > 0 && pktbuf[0] == ',') @@ -434,7 +440,7 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz, } } - return 1; + return OK; } /****************************************************************************