From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751974AbbJFIqk (ORCPT ); Tue, 6 Oct 2015 04:46:40 -0400 Received: from mga02.intel.com ([134.134.136.20]:37959 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbbJFIqh convert rfc822-to-8bit (ORCPT ); Tue, 6 Oct 2015 04:46:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,643,1437462000"; d="scan'208";a="574990121" From: "Winkler, Tomas" To: Greg Kroah-Hartman CC: "Usyskin, Alexander" , "linux-kernel@vger.kernel.org" , "Alexander Kuleshov" Subject: RE: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output Thread-Topic: [char-misc 1/2 4.3 V2] mei: Fix debugfs filename in error output Thread-Index: AQHQ9ENxBpLnnCCbYEGU8j0YleXRgp5bEiUAgAH9xsD//9rTAIABTsSg Date: Tue, 6 Oct 2015 08:46:32 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B3D45F67F@hasmsx108.ger.corp.intel.com> References: <1442822295-5111-1-git-send-email-tomas.winkler@intel.com> <20151004111906.GA23333@kroah.com> <5B8DA87D05A7694D9FA63FD143655C1B3D45F060@hasmsx108.ger.corp.intel.com> <20151005153036.GA16834@kroah.com> In-Reply-To: <20151005153036.GA16834@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > goto err; > > > > > > You should never care if a debugfs call fails or not. > > > > The system should not be dependent on the debug feature but, it is > > always good to know if there our system is failing > > And what can you do if it is "failing"? Really nothing, so there's > nothing to check here. As far as I can see the function debugfs_create_file may fail for a few reasons and it return NULL if this is happening. I might ignore the error as you suggested, but I'm not sure why not to give a hint in log that this happened. Second, as far as I scanned the kernel sources, checking the return value of this function and acting on this is very common. > > Also, this will > > > "fail" if you don't have CONFIG_DEBUGFS enabled, which means you are > > > using the api wrong :( > > > > The whole file is not compiled if CONFIG_DEBUGFS is not set, please see the > Makefile > > Ok, then you don't need to check anything. Debugfs was created to be > dirt-simple, don't add complexity and "must unwind cleanly" type logic > here where it's not needed at all. That just hurts my sensibilities for > why I made the API the way it is in the first place :) I don't see the code much complex, it is pretty much boilerplate code and this is why this c&p error had happened. So this patch just fixes a c&p error in an error message and if we wish to change the behavior to match your vision I suggest to doing it another patch set... maybe even sweeping the whole kernel. Thanks Tomas