net: coap: Rem macros that uses coap_get_option_int

Clean up and remove macros that uses coap_get_option_int.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
diff --git a/subsys/net/lib/coap/coap.c b/subsys/net/lib/coap/coap.c
index 1de7314..25aa169 100644
--- a/subsys/net/lib/coap/coap.c
+++ b/subsys/net/lib/coap/coap.c
@@ -937,8 +937,6 @@
 	return val;
 }
 
-#define get_block_option(cpkt, code) coap_get_option_int(cpkt, code)
-
 static int update_descriptive_block(struct coap_block_context *ctx,
 				    int block, int size)
 {
@@ -1020,10 +1018,10 @@
 {
 	int r, block1, block2, size1, size2;
 
-	block1 = get_block_option(cpkt, COAP_OPTION_BLOCK1);
-	block2 = get_block_option(cpkt, COAP_OPTION_BLOCK2);
-	size1 = get_block_option(cpkt, COAP_OPTION_SIZE1);
-	size2 = get_block_option(cpkt, COAP_OPTION_SIZE2);
+	block1 = coap_get_option_int(cpkt, COAP_OPTION_BLOCK1);
+	block2 = coap_get_option_int(cpkt, COAP_OPTION_BLOCK2);
+	size1 = coap_get_option_int(cpkt, COAP_OPTION_SIZE1);
+	size2 = coap_get_option_int(cpkt, COAP_OPTION_SIZE2);
 
 	size1 = size1 == -ENOENT ? 0 : size1;
 	size2 = size2 == -ENOENT ? 0 : size2;
@@ -1051,9 +1049,9 @@
 	int block;
 
 	if (is_request(cpkt)) {
-		block = get_block_option(cpkt, COAP_OPTION_BLOCK1);
+		block = coap_get_option_int(cpkt, COAP_OPTION_BLOCK1);
 	} else {
-		block = get_block_option(cpkt, COAP_OPTION_BLOCK2);
+		block = coap_get_option_int(cpkt, COAP_OPTION_BLOCK2);
 	}
 
 	if (!GET_MORE(block)) {
@@ -1238,8 +1236,6 @@
 	}
 }
 
-#define get_observe_option(cpkt) coap_get_option_int(cpkt, COAP_OPTION_OBSERVE)
-
 struct coap_reply *coap_response_received(
 	const struct coap_packet *response,
 	const struct sockaddr *from,
@@ -1270,7 +1266,7 @@
 			continue;
 		}
 
-		age = get_observe_option(response);
+		age = coap_get_option_int(response, COAP_OPTION_OBSERVE);
 		if (age > 0) {
 			/* age == 2 means that the notifications wrapped,
 			 * or this is the first one
@@ -1305,7 +1301,7 @@
 
 	reply->tkl = tkl;
 
-	age = get_observe_option(request);
+	age = coap_get_option_int(request, COAP_OPTION_OBSERVE);
 
 	/* It means that the request enabled observing a resource */
 	if (age == 0) {
@@ -1347,7 +1343,7 @@
 
 bool coap_request_is_observe(const struct coap_packet *request)
 {
-	return get_observe_option(request) == 0;
+	return coap_get_option_int(request, COAP_OPTION_OBSERVE) == 0;
 }
 
 void coap_observer_init(struct coap_observer *observer,