X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=include%2Fafb%2Fafb-req-common.h;h=df37739f78179bf8538b7b10fd208de1cb0f7285;hb=dff4f960481fc5916ac1c19ebbd38e8023406309;hp=8ff1b39b2b11fabff9ede40ac828a01832d3e6e8;hpb=c6380108964e71f533d8c672bb9c217020a95e8d;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-req-common.h b/include/afb/afb-req-common.h index 8ff1b39b..df37739f 100644 --- a/include/afb/afb-req-common.h +++ b/include/afb/afb-req-common.h @@ -90,7 +90,7 @@ struct afb_req */ static inline int afb_req_is_valid(struct afb_req req) { - return req.itf != NULL; + return !!req.itf; } /* @@ -253,7 +253,7 @@ static inline void afb_req_context_set(struct afb_req req, void *context, void ( static inline void *afb_req_context(struct afb_req req, void *(*create_context)(), void (*free_context)(void*)) { void *result = afb_req_context_get(req); - if (result == NULL) { + if (!result) { result = create_context(); afb_req_context_set(req, result, free_context); } @@ -268,7 +268,7 @@ static inline void *afb_req_context(struct afb_req req, void *(*create_context)( */ static inline void afb_req_context_clear(struct afb_req req) { - afb_req_context_set(req, NULL, NULL); + afb_req_context_set(req, 0, 0); } /*