Re: [PATCH v7 6/6] pmem: implement pmem_recovery_write()

Christoph Hellwig
2022-04-06T07:03:36Z

On Tue, Apr 05, 2022 at 01:47:47PM -0600, Jane Chu wrote:
> + off = (unsigned long)addr & ~PAGE_MASK;

offset_inpage()

> + if (off || !(PAGE_ALIGNED(bytes))) {

No need for the inner braces.

> + mutex_lock(&pmem->recovery_lock);
> + pmem_off = PFN_PHYS(pgoff) + pmem->data_offset;
> + cleared = __pmem_clear_poison(pmem, pmem_off, len);
> + if (cleared > 0 && cleared < len) {
> + dev_warn(dev, "poison cleared only %ld out of %lu\n",
> + cleared, len);
> + mutex_unlock(&pmem->recovery_lock);
> + return 0;
> + } else if (cleared < 0) {

No need for an else after a return.