Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1021832pxb; Wed, 6 Apr 2022 06:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyetZAg99j2MCOTXS3/qPzggzE8/NEzpIRheGTXHz9l7iJI4F0DFr4gndbvXeLe6xmRPEYu X-Received: by 2002:a17:90b:33d2:b0:1c6:f3c1:49c3 with SMTP id lk18-20020a17090b33d200b001c6f3c149c3mr9890684pjb.82.1649253439175; Wed, 06 Apr 2022 06:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253439; cv=none; d=google.com; s=arc-20160816; b=KxnfkE/KLCJNQb83EeDtV0qoPfLhFrOa5gCNV+XZGQBhKSt2LTrn/sAvq9JNQNAwi5 VLfMt9SBWTPsWGAihoqCwsLh92mg909TkjR6Yw55IDrj8K7da/WaOl2352XTMqSpuW/g P03G6lT2vtpjlsDXgFCPo+P3cfxtRIJu6kfWrrvlejvJrK3FlaFB5CPjYO4aIugrmbG0 NiarDFgMupJkb/5UROm5RFn1ovrAJ72zsMsxRW0noi1DCrRO6reLVmzKcb21JVJYbAAU ayTxPno8LmrpwVOILQW4ucpvg1jGeu3PpGUh4fU7mzE0K4rjh7fQ4hBXhaE1tpiIT58F JApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vqxJ46s1qeqVh8b5I6ydRXIhwjWlT/dFZD1qSfok+48=; b=eTPA1hIX+u8SSCe2BkFlzwgb3khYeOH6Y3Vut4uLszMw1cvjkn8RlWzhegoJ8bNV+M Se2hgcRgmyr57i5nmHMQsAn+Dc+retA4hCHm1QedaaL/GiNw98P8RyUj1QmmfzLBvdvE XR+zP9AEqfvWEaqH5t1bDQ5VMCFXC8Toy15Ru1dLnhQaaqgRwQLeSeD4/o1gTMjuqPwG bdUD1dR9j++ZXANloHdWKoO8BqTfn4+NvsFrWUzFMXY4jY7+2VeCwP75usfOfg3QuXsh l1ZqUVBR8Y2hb+bbepH6Cy97NPFCSKAl3c94PZiq6DPWg22s+uqkjScNbFVRelz8BNec Msog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=B4F244K1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 184-20020a6304c1000000b00398700b4862si15807800pge.602.2022.04.06.06.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=B4F244K1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91C6058E404; Wed, 6 Apr 2022 04:50:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239556AbiDFHJi (ORCPT + 99 others); Wed, 6 Apr 2022 03:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1578362AbiDFGqm (ORCPT ); Wed, 6 Apr 2022 02:46:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A28F233DC9A; Tue, 5 Apr 2022 22:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vqxJ46s1qeqVh8b5I6ydRXIhwjWlT/dFZD1qSfok+48=; b=B4F244K1t7i0S9VvsgftPFGVLL twk4UfeFzkxPTopcSzaeMxjEn5gzp3bjROlPuf41jSz2peCYKRvM2K5KrtS8rqY/IuEREqW7w8iWe dlNzOnFFnRN/UcR3HjvrkcBrhb+a2aKDxY15FvMwwib9aGOt/Ss/OK/c1eY8TcNJuKQ6Np2Jx538y RdMn1JCn6WhxVm3iL767HujuEQ28+HIKZDKYjOFfqYuBZQg8hTqkhhC0DTq0O3arV1NDtWSOvwkYQ OU41zD1ECjzE2uoK1byrm67/l1tCnM/dlbQPak1l6Wz7NY1Go0ZYFefdxLIR0geWUhRHcm2ysQ3/c EFnU1YPA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbxqX-003nIX-Gh; Wed, 06 Apr 2022 05:04:45 +0000 Date: Tue, 5 Apr 2022 22:04:45 -0700 From: Christoph Hellwig To: Jane Chu Cc: david@fromorbit.com, djwong@kernel.org, dan.j.williams@intel.com, hch@infradead.org, vishal.l.verma@intel.com, dave.jiang@intel.com, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, ira.weiny@intel.com, willy@infradead.org, vgoyal@redhat.com, linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v7 5/6] pmem: refactor pmem_clear_poison() Message-ID: References: <20220405194747.2386619-1-jane.chu@oracle.com> <20220405194747.2386619-6-jane.chu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405194747.2386619-6-jane.chu@oracle.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2022 at 01:47:46PM -0600, Jane Chu wrote: > + pmem_clear_bb(pmem, to_sect(pmem, offset), cleared >> SECTOR_SHIFT); > + return (cleared < len) ? BLK_STS_IOERR : BLK_STS_OK; No need for the braces. That being said perosnally I find a simple: if (cleared < len) return BLK_STS_IOERR; return BLK_STS_OK; much easier to read anyway. Otherwise looks good: Reviewed-by: Christoph Hellwig