Skip to content

Commit

Permalink
[PATCH] scatterlist: Add const to sg_set_buf/sg_init_one pointer argu…
Browse files Browse the repository at this point in the history
…ment

This patch adds a const modifier to the buf argument of sg_set_buf and
sg_init_one.  This lets people call it with pointers that are const.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Sep 21, 2006
1 parent efcf802 commit 03fd9ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#include <linux/mm.h>
#include <linux/string.h>

static inline void sg_set_buf(struct scatterlist *sg, void *buf,
static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
unsigned int buflen)
{
sg->page = virt_to_page(buf);
sg->offset = offset_in_page(buf);
sg->length = buflen;
}

static inline void sg_init_one(struct scatterlist *sg, void *buf,
static inline void sg_init_one(struct scatterlist *sg, const void *buf,
unsigned int buflen)
{
memset(sg, 0, sizeof(*sg));
Expand Down

0 comments on commit 03fd9ce

Please sign in to comment.