From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DED1CC282C3 for ; Tue, 22 Jan 2019 17:29:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B057C21019 for ; Tue, 22 Jan 2019 17:29:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbfAVR3I (ORCPT ); Tue, 22 Jan 2019 12:29:08 -0500 Received: from mga11.intel.com ([192.55.52.93]:45182 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbfAVR3I (ORCPT ); Tue, 22 Jan 2019 12:29:08 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2019 09:29:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,507,1539673200"; d="scan'208";a="127701073" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.14]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jan 2019 09:29:07 -0800 Date: Tue, 22 Jan 2019 09:29:07 -0800 From: Sean Christopherson To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org Subject: Re: [PATCH] kvm: no need to check return value of debugfs_create functions Message-ID: <20190122172907.GF28513@linux.intel.com> References: <20190122152151.16139-51-gregkh@linuxfoundation.org> <20190122172102.GE28513@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190122172102.GE28513@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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 09:21:02AM -0800, Sean Christopherson wrote: > On Tue, Jan 22, 2019 at 04:21:50PM +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. > > What about wanting to make the debugfs all-or-nothing? That seems like > a legitimate usage of checking the return value. > > E.g. KVM removes the debugfs if kvm_arch_create_vcpu_debugfs() fails, and > the arch/x86/kvm/debugfs.c implementation of kvm_arch_create_vcpu_debugfs() > returns an error if any of its debugfs_create_file() calls fail. > > If you're adamant about removing all debugfs create return value checks, > the aforementioned debugfs_create_file() calls should also be removed. > And at that point kvm_create_vcpu_debugfs() should have a 'void' return > value. Belatedly saw the other series. It'll require a bit more coordination, but folding this into the x86 series would allow for converting the KVM call stack to have 'void' returns.