Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1546949
| From | Marek Vasut <marek.vasut@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX |
| Date | 2016-12-23 20:10 +0100 |
| Message-ID | <sRDo5-2vk-17@gated-at.bofh.it> (permalink) |
| References | <sQt7s-6hV-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 12/20/2016 02:54 PM, Geliang Tang wrote:
> Since macros MTDSWAP_ECNT_MIN() and MTDSWAP_ECNT_MAX() have been
> defined in mtdswap.c, use them instead of open-coding.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Sorry for getting to this so late. The patch is fine, but if you grep
for 'rb_first' in the mtdswap driver , you'll see you can also use the
MTDSWAP_ECNT_MIN macro in mtdswap_map_free_block() and in
mtdswap_pick_gc_blk() . Can you fix those too ?
Otherwise:
Acked-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> drivers/mtd/mtdswap.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
> index c40e2c9..f12879a 100644
> --- a/drivers/mtd/mtdswap.c
> +++ b/drivers/mtd/mtdswap.c
> @@ -1235,10 +1235,8 @@ static int mtdswap_show(struct seq_file *s, void *data)
>
> if (root->rb_node) {
> count[i] = d->trees[i].count;
> - min[i] = rb_entry(rb_first(root), struct swap_eb,
> - rb)->erase_count;
> - max[i] = rb_entry(rb_last(root), struct swap_eb,
> - rb)->erase_count;
> + min[i] = MTDSWAP_ECNT_MIN(root);
> + max[i] = MTDSWAP_ECNT_MAX(root);
> } else
> count[i] = 0;
> }
>
--
Best regards,
Marek Vasut
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX Geliang Tang <geliangtang@gmail.com> - 2016-12-20 15:00 +0100
Re: [PATCH] mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX Marek Vasut <marek.vasut@gmail.com> - 2016-12-23 20:10 +0100
Re: [PATCH] mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX Geliang Tang <geliangtang@gmail.com> - 2016-12-24 16:20 +0100
Re: [PATCH] mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX Marek Vasut <marek.vasut@gmail.com> - 2016-12-25 14:50 +0100
csiph-web