Constify struct zs_handle * in functions that don't modify the handle. Signed-off-by: Sergey Senozhatsky --- include/linux/zsmalloc.h | 4 ++-- mm/zsmalloc.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h index 674358f39191..793fc887015c 100644 --- a/include/linux/zsmalloc.h +++ b/include/linux/zsmalloc.h @@ -65,9 +65,9 @@ unsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size); void zs_pool_stats(struct zs_pool *pool, struct zs_pool_stats *stats); -void zs_obj_read_sg_begin(struct zs_pool *pool, struct zs_handle *handle, +void zs_obj_read_sg_begin(struct zs_pool *pool, const struct zs_handle *handle, struct scatterlist *sg, size_t mem_len); -void zs_obj_read_sg_end(struct zs_pool *pool, struct zs_handle *handle); +void zs_obj_read_sg_end(struct zs_pool *pool, const struct zs_handle *handle); extern const struct movable_operations zsmalloc_mops; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index ff1cde4c5dc2..e0f89a3b77f1 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -805,7 +805,7 @@ static unsigned long location_to_obj(struct zpdesc *zpdesc, unsigned int obj_idx return obj; } -static unsigned long handle_to_obj(struct zs_handle *handle) +static unsigned long handle_to_obj(const struct zs_handle *handle) { return READ_ONCE(ACCESS_PRIVATE(handle, obj)); } @@ -1110,7 +1110,7 @@ unsigned long zs_get_total_pages(struct zs_pool *pool) } EXPORT_SYMBOL_GPL(zs_get_total_pages); -void zs_obj_read_sg_begin(struct zs_pool *pool, struct zs_handle *handle, +void zs_obj_read_sg_begin(struct zs_pool *pool, const struct zs_handle *handle, struct scatterlist *sg, size_t mem_len) { struct zspage *zspage; @@ -1157,7 +1157,7 @@ void zs_obj_read_sg_begin(struct zs_pool *pool, struct zs_handle *handle, } EXPORT_SYMBOL_GPL(zs_obj_read_sg_begin); -void zs_obj_read_sg_end(struct zs_pool *pool, struct zs_handle *handle) +void zs_obj_read_sg_end(struct zs_pool *pool, const struct zs_handle *handle) { struct zspage *zspage; struct zpdesc *zpdesc; @@ -1395,7 +1395,7 @@ static unsigned int obj_to_class_idx(unsigned long obj) */ #if ZS_OBJ_CLASS_BITS > 0 static inline void obj_class_get_and_lock(struct zs_pool *pool, - struct zs_handle *handle, + const struct zs_handle *handle, unsigned long *objp, struct zspage **zspagep, struct size_class **classp) @@ -1415,7 +1415,7 @@ static inline void obj_class_get_and_lock(struct zs_pool *pool, } #else static inline void obj_class_get_and_lock(struct zs_pool *pool, - struct zs_handle *handle, + const struct zs_handle *handle, unsigned long *objp, struct zspage **zspagep, struct size_class **classp) -- 2.56.0.398.g882cbad275-goog