From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754053AbcE0EbQ (ORCPT ); Fri, 27 May 2016 00:31:16 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:45697 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbcE0EbO (ORCPT ); Fri, 27 May 2016 00:31:14 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.203 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Fri, 27 May 2016 13:31:37 +0900 From: Minchan Kim To: Sergey Senozhatsky CC: Andrew Morton , Joonsoo Kim , , Sergey Senozhatsky Subject: Re: [PATCH 4/7] zram: align zcomp interface to crypto comp API Message-ID: <20160527043137.GD2322@bbox> References: <20160525143006.1207-1-sergey.senozhatsky@gmail.com> <20160525143006.1207-5-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 In-Reply-To: <20160525143006.1207-5-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/27 13:31:11, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/27 13:31:11, Serialize complete at 2016/05/27 13:31:11 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 25, 2016 at 11:30:03PM +0900, Sergey Senozhatsky wrote: > A cosmetic change: use the same datatypes as crypto API does. > > Signed-off-by: Sergey Senozhatsky > Cc: Minchan Kim > Cc: Joonsoo Kim > --- > drivers/block/zram/zcomp.c | 5 ++--- > drivers/block/zram/zcomp.h | 5 ++--- > drivers/block/zram/zram_drv.c | 2 +- > 3 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c > index 6e16fa2..79b30d7 100644 > --- a/drivers/block/zram/zcomp.c > +++ b/drivers/block/zram/zcomp.c > @@ -103,7 +103,7 @@ void zcomp_stream_put(struct zcomp *comp) > } > > int zcomp_compress(struct zcomp_strm *zstrm, > - const unsigned char *src, unsigned int *dst_len) > + const u8 *src, unsigned int *dst_len) Nitpick: The zcomp doesn't need to depend on implementation(i.e., crypto) so zcomp_compress should pass void * for src and dst. I'm not strong aginst changing u8 but your description makes me think about that. > { > /* > * Our dst memory (zstrm->buffer) is always `2 * PAGE_SIZE' sized > @@ -127,8 +127,7 @@ int zcomp_compress(struct zcomp_strm *zstrm, > } > > int zcomp_decompress(struct zcomp_strm *zstrm, > - const unsigned char *src, > - size_t src_len, unsigned char *dst) > + const u8 *src, unsigned int src_len, u8 *dst) > { > unsigned int dst_len = PAGE_SIZE; > > diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h > index 3fb9dc4..dcc0951 100644 > --- a/drivers/block/zram/zcomp.h > +++ b/drivers/block/zram/zcomp.h > @@ -54,11 +54,10 @@ struct zcomp_strm *zcomp_stream_get(struct zcomp *comp); > void zcomp_stream_put(struct zcomp *comp); > > int zcomp_compress(struct zcomp_strm *zstrm, > - const unsigned char *src, unsigned int *dst_len); > + const u8 *src, unsigned int *dst_len); > > int zcomp_decompress(struct zcomp_strm *zstrm, > - const unsigned char *src, > - size_t src_len, unsigned char *dst); > + const u8 *src, unsigned int src_len, u8 *dst); > > bool zcomp_set_max_streams(struct zcomp *comp, int num_strm); > #endif /* _ZCOMP_H_ */ > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 99c8be7..65d1403 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -563,7 +563,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) > unsigned char *cmem; > struct zram_meta *meta = zram->meta; > unsigned long handle; > - size_t size; > + unsigned int size; > > bit_spin_lock(ZRAM_ACCESS, &meta->table[index].value); > handle = meta->table[index].handle; > -- > 2.8.3.394.g3916adf >