Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp368085imm; Thu, 5 Jul 2018 01:31:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfghwbJKhZr1mJt8tsEzis01Ndhpwl0N7lLBq8Pzca9bAWvxw/Pk1tqD3D1hyz6+KzQ50H6 X-Received: by 2002:a65:47cc:: with SMTP id f12-v6mr4686889pgs.173.1530779519019; Thu, 05 Jul 2018 01:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530779518; cv=none; d=google.com; s=arc-20160816; b=GZv/uVX5grS7eQzaSQyOqIBvtMiC7Nqt7WQVP96SFqublgDhIabNMlBulU7kVCvoNu 0oPd7dnCdYkMX7g+kR3j5OCqrV4T0SNNHftay5Ar9ErmluDOhlgeXIYOW66a2cFJ+o7j QsQwW6/6dC8iKdz2FxB15InUO9Ugy+vrscFiOunnl4bwwAxFscmlS0/2Gt/yUdPzpMbz f+zzaKPjU1jz1Eo2sNSn2mBUqYEd8CG7JHtaawXS5y3peB7Hp4yS00AEwlPq2OgIE8G4 0McxBCCBIGNWwn+dVYXWhJzTxuJJAWbXndIfRXilPFj5QJy+PRIXOnKDS/GIM45CD4DA 106Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=YB7zu+6TG4TF25Dn7XwXr4XaIICdHHyyVh99lGznemM=; b=g1nunbFPXGEK1OO+M6YBQd8ZaHh1I61tFK908Ea9mhLmvO+jFaz0st6lEzMrkOCCW1 HESb/CBxxoO8djpt0rAvM7ckthgTRHnb2r47zDmefBVKf+2QF9PQubKoZN4bvMyCnZZE gB1L6dBrIpJiWe9ODWTi/7oMS0kPeclOIG+Wiszn7QmEvjheGT8zcPG+CiNktee8QwKL yT1CEyRCxT575Gly3vbwjz1p/+qeIgBo8LaF/ytOQaF9TSXG4mw+0PpOM8qiLolj8Bl6 /XeUtofuXXpuC9Io6yTQTz7u9n9jDbv5/uJDbzltb9SOyAhM2v3DkGKQWI7JzUv+vQ0w DMxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15-v6si2118847pls.439.2018.07.05.01.31.45; Thu, 05 Jul 2018 01:31:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753512AbeGEI3g (ORCPT + 99 others); Thu, 5 Jul 2018 04:29:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:60928 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753287AbeGEI3e (ORCPT ); Thu, 5 Jul 2018 04:29:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8064AADE2; Thu, 5 Jul 2018 08:29:33 +0000 (UTC) Date: Thu, 5 Jul 2018 10:29:31 +0200 From: Johannes Thumshirn To: Dan Williams Cc: akpm@linux-foundation.org, Ross Zwisler , Vishal Verma , Dave Jiang , Jeff Moyer , hch@lst.de, linux-nvdimm@lists.01.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/13] libnvdimm, namespace: Publish page structure init state / control Message-ID: <20180705082931.echvdqipgvwhghf2@linux-x5ow.site> References: <153077334130.40830.2714147692560185329.stgit@dwillia2-desk3.amr.corp.intel.com> <153077341292.40830.11333232703318633087.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <153077341292.40830.11333232703318633087.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 04, 2018 at 11:50:13PM -0700, Dan Williams wrote: > +static ssize_t memmap_state_store(struct device *dev, > + struct device_attribute *attr, const char *buf, size_t len) > +{ > + int i; > + struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); > + struct memmap_async_state *async = &nd_pfn->async; > + > + if (strcmp(buf, "sync") == 0) > + /* pass */; > + else if (strcmp(buf, "sync\n") == 0) > + /* pass */; > + else > + return -EINVAL; Hmm what about: if (strncmp(buf, "sync", 4)) return -EINVAL; This collapses 6 lines into 4. -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850