net: nbuf: Fix constness of data param in net_nbuf_append

As the function does not change the original data, make
the corresponding parameter const.

Change-Id: I1125a2f9205dc73de2f0aac0c30110591baace1e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-02-09 09:45:29 +02:00
commit c0f6a5ecd8
2 changed files with 4 additions and 3 deletions

View file

@ -620,7 +620,7 @@ struct net_buf *net_nbuf_pull(struct net_buf *buf, size_t amount);
* False otherwise (In-case of false buf might contain input
* data in the process of placing into fragments).
*/
bool net_nbuf_append(struct net_buf *buf, uint16_t len, uint8_t *data,
bool net_nbuf_append(struct net_buf *buf, uint16_t len, const uint8_t *data,
int32_t timeout);
/**

View file

@ -883,7 +883,8 @@ struct net_buf *net_nbuf_pull(struct net_buf *buf, size_t amount)
* the data in current fragment then create new fragment and add it to
* the buffer. It assumes that the buffer has at least one fragment.
*/
static inline bool net_nbuf_append_bytes(struct net_buf *buf, uint8_t *value,
static inline bool net_nbuf_append_bytes(struct net_buf *buf,
const uint8_t *value,
uint16_t len, int32_t timeout)
{
struct net_buf *frag = net_buf_frag_last(buf);
@ -912,7 +913,7 @@ static inline bool net_nbuf_append_bytes(struct net_buf *buf, uint8_t *value,
return false;
}
bool net_nbuf_append(struct net_buf *buf, uint16_t len, uint8_t *data,
bool net_nbuf_append(struct net_buf *buf, uint16_t len, const uint8_t *data,
int32_t timeout)
{
struct net_buf *frag;