Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp139242imu; Tue, 22 Jan 2019 15:31:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7/nRwuw4A3ka8E0vmNgByfXMzKZVFvTx8R/z5MeH0oLWYucykcnXJGJtXPORGi0QAsCt1K X-Received: by 2002:a17:902:5ac7:: with SMTP id g7mr36474423plm.212.1548199860053; Tue, 22 Jan 2019 15:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548199860; cv=none; d=google.com; s=arc-20160816; b=d1xWfEb62vwPbUT98lKO8NIngs/JpK/onWHnQCIzvYXY6rUcokqIQ7YGfoqdUqcBqd JlKF3fvJDqoRbI/eRuV5tzN+BX8XHHlxiLgnp0RAJT+U3Pgs7GMpAqxapifEipceTidD fMkgX/6Z2ro1QnR/4I6ISmHg6PsrGpRmLvg1IEGLAzC0n124wHSk5fX4iaqgqNxiwWxB hUpQ7HKiCbJ10022hPxB+LWJqdElHu9xCqoBu7/egjmWX2c7ve1wMwSiqO5uO3uv2EN4 ms7OgYTs+KmENNmTmcBXkTQOz6vVNpA9HYFAR9NcKuFu7ey2HoXiV0MFkNTCgrOUPunh Z6qg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7FjeXgZyteMMNJ6FNddYRfn8Rbsze0sdjcX/f6Wy+i8=; b=eBSlwGBA0CKdp07w2thzOJSA9jMh9eXYXbwI/FIQ9AlJJMl9QDzVvlZYsJbzfT3k95 uzkEo37asnnDcFycqWAHTPaWsV61l9QlrWYsgu0E3EBiuFjT7HKIN2SM6yU1IDijBkkg 3M4YbLOeMFKY3pmU0XXi3g9oGJ//vuYD2FQ+VAggkzXyvwWTCHhkzR92h6IEn4ZwSUKq ZmVIRcB40+5rkdHBORaFoW4RmiANeca2zNtCFyEnv7RtsYIlikJ4eiG1d1ORO5n6CpeF JMT6/k/4yyB9XtJXBzrLDvGrAJ+bIfYqYAXIos3TYFZ4rbB3d9BhAV7sDbXrVqaRaxj7 qnYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=H3JxqQFY; 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 t9si16491887pfk.35.2019.01.22.15.30.43; Tue, 22 Jan 2019 15:31:00 -0800 (PST) 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; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=H3JxqQFY; 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 S1726838AbfAVX3h (ORCPT + 99 others); Tue, 22 Jan 2019 18:29:37 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36092 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbfAVX3g (ORCPT ); Tue, 22 Jan 2019 18:29:36 -0500 Received: by mail-pg1-f194.google.com with SMTP id n2so148694pgm.3 for ; Tue, 22 Jan 2019 15:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7FjeXgZyteMMNJ6FNddYRfn8Rbsze0sdjcX/f6Wy+i8=; b=H3JxqQFYrqAdBrqoUDPmyanGoA7waPQekzvXnH+DjjUnsbHheNkhPOT8sB3fLbAqrM yflNJ5dQye2+Gc5jHAHPh3p9FtWE9fovE+vcBrzZe0qt04DCbQJraJIag+k05Tg26Z9c swsTAD/URngT49Zz8oCaIV92olpA2Nz3YRTSIvwQ3JEPUVrGXTw6mwC/oWQJNPFnkt5F MMw/bQe2ygS9d3QmqBFArx6KN92KZANndjSWL/+rYmqx6GmQVcBXqdZ1HpyJvIc6KF0+ +Pjnwa/75yF/nK8iZgpo+HBjg1rtlKUjNUg3Cbobd7993AMKKB8x8u1DHUhpors81ppp UEIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7FjeXgZyteMMNJ6FNddYRfn8Rbsze0sdjcX/f6Wy+i8=; b=UrX54hTceJnXrm6QPxjh/kZ+RW8wwwKyCH3IvYuB1kw79XyAyrz6uIY9DtngwhBK17 Bh769328xmsqIClus29IFyJupwR3dudfJhMxTRu6W8En0XqnTttpQUWFWSwJw+y+pBPx OJgHFYBztpRSOg9VpErhjlRvtXLgJpXCWbDNqoKk+J6/H9rMXfkEqhmixiLPb0eeoYda nvjVctlZ+dHGQ5hZ/o9rnZiM+T3/Yb2mFZ2OtN5Qrw/AAEdatX1YpLFPy/ZLpASJAlv9 EBm96ZMKhC4SAB599UgMrjBKBt2W96IAd69ezQDsHlbFVZDDC1rJdTjxWjNM6BezFEci h7SA== X-Gm-Message-State: AJcUukeZbApH/UPyPHFd9l/USEf2KUch2no/b5YMfoNi2BE126B2lqKa GHeNDWU89ogjTl1H2DJBX6uLlg== X-Received: by 2002:a63:1204:: with SMTP id h4mr33862365pgl.51.1548199775330; Tue, 22 Jan 2019 15:29:35 -0800 (PST) Received: from vader ([2620:10d:c090:200::7:930f]) by smtp.gmail.com with ESMTPSA id b202sm26758835pfb.88.2019.01.22.15.29.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 15:29:34 -0800 (PST) Date: Tue, 22 Jan 2019 15:29:33 -0800 From: Omar Sandoval To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, "Ed L. Cashin" , Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH] block: aoe: no need to check return value of debugfs_create functions Message-ID: <20190122232933.GC5884@vader> References: <20190122152151.16139-5-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190122152151.16139-5-gregkh@linuxfoundation.org> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 04:21:04PM +0100, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "Ed L. Cashin" > Cc: Jens Axboe > Cc: linux-block@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --- > drivers/block/aoe/aoeblk.c | 13 +------------ > 1 file changed, 1 insertion(+), 12 deletions(-) > > diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c > index e2c6aae2d636..b602646bfa04 100644 > --- a/drivers/block/aoe/aoeblk.c > +++ b/drivers/block/aoe/aoeblk.c > @@ -207,14 +207,7 @@ aoedisk_add_debugfs(struct aoedev *d) > else > p++; > BUG_ON(*p == '\0'); > - entry = debugfs_create_file(p, 0444, aoe_debugfs_dir, d, > - &aoe_debugfs_fops); > - if (IS_ERR_OR_NULL(entry)) { > - pr_info("aoe: cannot create debugfs file for %s\n", > - d->gd->disk_name); > - return; > - } > - BUG_ON(d->debugfs); > + debugfs_create_file(p, 0444, aoe_debugfs_dir, d, &aoe_debugfs_fops); > d->debugfs = entry; Now entry is uninitialized here when we assign it to d->debugfs. > } > void > @@ -472,10 +465,6 @@ aoeblk_init(void) > if (buf_pool_cache == NULL) > return -ENOMEM; > aoe_debugfs_dir = debugfs_create_dir("aoe", NULL); > - if (IS_ERR_OR_NULL(aoe_debugfs_dir)) { > - pr_info("aoe: cannot create debugfs directory\n"); > - aoe_debugfs_dir = NULL; > - } > return 0; > } > > -- > 2.20.1 >