Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535181

Re: [PATCH 5/8 linux-next] libnvdimm: remove else after return in nsio_rw_bytes()

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/8 linux-next] libnvdimm: remove else after return in nsio_rw_bytes()
Date 2016-12-02 21:00 +0100
Message-ID <sK29X-85B-13@gated-at.bofh.it> (permalink)
References <sK1GW-7VR-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Dec 2, 2016 at 11:21 AM, Fabian Frederick <fabf@skynet.be> wrote:
> else after return is not needed.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  drivers/nvdimm/claim.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
> index d5dc80c..c0c113e 100644
> --- a/drivers/nvdimm/claim.c
> +++ b/drivers/nvdimm/claim.c
> @@ -238,11 +238,10 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
>                 if (unlikely(is_bad_pmem(&nsio->bb, offset / 512, sz_align)))
>                         return -EIO;
>                 return memcpy_from_pmem(buf, nsio->addr + offset, size);
> -       } else {
> -               memcpy_to_pmem(nsio->addr + offset, buf, size);
> -               nvdimm_flush(to_nd_region(ndns->dev.parent));
>         }
>
> +       memcpy_to_pmem(nsio->addr + offset, buf, size);
> +       nvdimm_flush(to_nd_region(ndns->dev.parent));
>         return 0;
>  }

Looks good, but this collides with

commit 82bf1037f2cab2d6960a08ae08513f2c3c0b335a
Author: Dave Jiang <dave.jiang@intel.com>
Date:   Fri Nov 11 12:37:36 2016 -0700

    libnvdimm: check and clear poison before writing to pmem

    We need to clear any poison when we are writing to pmem. The granularity
    will be sector size. If it's less then we can't do anything about it
    barring corruption.

    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
    [djbw: fixup 0-length write request to succeed]
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Can you respin this on top of libnvdimm-pending?

https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/log/?h=libnvdimm-pending

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 5/8 linux-next] libnvdimm: remove else after return in nsio_rw_bytes() Fabian Frederick <fabf@skynet.be> - 2016-12-02 20:30 +0100
  Re: [PATCH 5/8 linux-next] libnvdimm: remove else after return in nsio_rw_bytes() Dan Williams <dan.j.williams@intel.com> - 2016-12-02 21:00 +0100

csiph-web