Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp283105pxf; Thu, 1 Apr 2021 00:39:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWO2ioPslkv3LZ6/L5lUUEyZgwGAL0RqfRPfD8XwMOR6l0zzvuLcp8o1WcOW+pI9qtUKPh X-Received: by 2002:a17:907:7014:: with SMTP id wr20mr7746538ejb.179.1617262797817; Thu, 01 Apr 2021 00:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617262797; cv=none; d=google.com; s=arc-20160816; b=vag9hBQa7kUoPFcR/rUdO7IecOlo6JRxh8aUrCkd93IklWtJKjeD5/S0eIT0Wgzst/ HMw9ytZnmwYLPoi607ZvCRNhDAbjgjXlL/cQYtHwHiL6VemwkyAjsgjLWnRNSxLSOvtl 7sbmRNLAEk5c8dWdrKnUkSBVbcfnLvQvUK3OuN/kTket9esj1YFQhUvIYwx3yC7myIU0 cNQPU9KKAG01Xvn5KSywagEIKBvmM7XGKnDihM1+sTlxpc0sOhZAhh1WaU7I/zkebj2C W1PzF3f+BeSppU3mX+fAF5g6/vaj1v1Nr6tezOV6b/aqeKfiN4ZK6sPgji3Wx6OT0Mx5 WAeQ== 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; bh=EAyPjKYjiT9o60F9uChpeo6STuiH8MJxv3oK4EF3urU=; b=0N9217zZJjYjenmhD/fBUjFCisCJRMFEqWjzMdfnydvak6xRZCjJqz5LRo3x/am9DK WXa7OushMlSJ4lU+RqUSCGKeNxHqu1R/rOt4GL1B6coT7y6ZyCSYthtGlQhXyJxLhje2 Y8SBl44wbbNRertxg4P6HdRvcjRvErGjrJn3p8V5Zh8B4M4BH4q7NtMpse3/+GrgPfDP hc5jDdjTosDyZnwic0/5NxQ1+OTqffN+QZWbC5qB0QAQW87M/LrKDXL36I20eJBRiBnF OyG2y5Asz69XRdqcBt83pc4WxFU/ESRMwlAYEFmMJ8rBsIKlC6QAy9quD8pdovd8usV+ 5syg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si4152493edk.222.2021.04.01.00.39.35; Thu, 01 Apr 2021 00:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbhDAHgD (ORCPT + 99 others); Thu, 1 Apr 2021 03:36:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:46608 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbhDAHfm (ORCPT ); Thu, 1 Apr 2021 03:35:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 78C66AF32; Thu, 1 Apr 2021 07:35:41 +0000 (UTC) Date: Thu, 1 Apr 2021 09:35:40 +0200 From: Daniel Wagner To: Chaitanya Kulkarni Cc: "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Hannes Reinecke , Chao Leng , Victor Gladkov Subject: Re: [PATCH] nvme: Export fast_io_fail_tmo to sysfs Message-ID: <20210401073540.6tsv2ib3fapnglqo@beryllium.lan> References: <20210331131228.131118-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chaitanya, On Wed, Mar 31, 2021 at 08:34:31PM +0000, Chaitanya Kulkarni wrote: > > WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. > > For now keep the current style. Okay, I thought so too. I am just wondering if a patch for changing all the permission sets is acceptable. I prefer the the octal permissions ;) > > +static ssize_t nvme_ctrl_fast_io_fail_tmo_show(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + struct nvme_ctrl *ctrl = dev_get_drvdata(dev); > > + > > + if (ctrl->opts->fast_io_fail_tmo == -1) > > + return sprintf(buf, "off\n"); > > + return sprintf(buf, "%d\n", ctrl->opts->fast_io_fail_tmo); > > do we need snprintf() for 2nd ? Sure thing can do. Also here I followed the existing style. The other store functions tend to use sprintf(). > > + err = kstrtoint(buf, 10, &fast_io_fail_tmo); > > + if (err) > > + return -EINVAL; > > + > > since you are returning an error, you can remove next else if, this also > removes the extra line after above return. Something like this on the top > of yours totally untested :- Right, same here, followed the existing style. I prepare a patch which addresses your comments for the existing code as well. Thanks, Daniel