HV:change the return type of sbuf_get and sbuf_put

Because of the return type inconsistent,change the
sbuf return type to uint32_t to fix it,and make the
pre-condition to check the parameter whether is NULL.

V1->V2:
  1.add () to bool expression
  2.add pre-assumption to sbuf_get and sbuf_put

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Huihuang Shi
2018-10-09 15:21:35 +08:00
committed by wenlingz
parent c5f4c5109c
commit 2b53acb5f8
3 changed files with 16 additions and 16 deletions

View File

@@ -74,8 +74,16 @@ static inline void sbuf_add_flags(struct shared_buf *sbuf, uint64_t flags)
struct shared_buf *sbuf_allocate(uint32_t ele_num, uint32_t ele_size);
void sbuf_free(struct shared_buf *sbuf);
int sbuf_get(struct shared_buf *sbuf, uint8_t *data);
int sbuf_put(struct shared_buf *sbuf, uint8_t *data);
/**
*@pre sbuf != NULL
*@pre data != NULL
*/
uint32_t sbuf_get(struct shared_buf *sbuf, uint8_t *data);
/**
*@pre sbuf != NULL
*@pre data != NULL
*/
uint32_t sbuf_put(struct shared_buf *sbuf, uint8_t *data);
int sbuf_share_setup(uint16_t pcpu_id, uint32_t sbuf_id, uint64_t *hva);
#else /* HV_DEBUG */