From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758573AbcGZVt7 (ORCPT ); Tue, 26 Jul 2016 17:49:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:7767 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753583AbcGZVty convert rfc822-to-8bit (ORCPT ); Tue, 26 Jul 2016 17:49:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,426,1464678000"; d="scan'208";a="1003072692" Subject: Re: staging: lustre: One function call less in class_register_type() after error detection Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=windows-1252 From: Oleg Drokin In-Reply-To: <0f9ecc7c-f98a-0296-563b-6fcfab459c31@users.sourceforge.net> Date: Tue, 26 Jul 2016 17:49:49 -0400 Cc: , , "Andreas Dilger" , Greg Kroah-Hartman , LKML , , Julia Lawall , Bhumika Goyal Content-Transfer-Encoding: 8BIT Message-Id: <2BFF8460-ECEA-470D-ACD6-A9D7E540FE33@intel.com> References: <566ABCD9.1060404@users.sourceforge.net> <566D7733.1030102@users.sourceforge.net> <56784D83.7080108@users.sourceforge.net> <56784F0C.6040007@users.sourceforge.net> <20151221234857.GA27079@kroah.com> <59d94e70-7476-728e-5f63-013557ec2db9@users.sourceforge.net> <0f9ecc7c-f98a-0296-563b-6fcfab459c31@users.sourceforge.net> To: SF Markus Elfring X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Jul 26, 2016, at 3:56 PM, SF Markus Elfring wrote: >> But kobject_put() already checks for NULL, right? > > Yes. - Such an input parameter validation is performed by the > function implementation. > > >> you just submitted another batch about that in other area. > > I sent update suggestions because of this function property for two > Linux software modules in the year 2015. > > >>> Adjust jump targets according to the Linux coding style convention. >> >> Not that I am totally against this patch, > > Thanks for your feedback. > > >> but when we do not need the extra checks, a single jump target is ok too in my mind > > A single goto label will look convenient for a while. It will often work > for several use cases. > > >> (extra benefit - there's not going to be any chance of a mistake to where to jump to). > > I have got an other opinion when you would like to care for a bit > more software efficiency. > > >> And when we have a single jump target, there's no supersmart naming >> like free_this_and_that_and_that_other_thing_too. > > How often do you care for efficient exception handling in the shown > function implementations? This function is called several times during lustre module insert. Namely it's called 5 times for 5 types: osc, mdc, lov, lmv, mgc. It's not called any more than that, so it's not exactly a super hot-path function to overoptimize it, and the failure is presumed to never happen too (or the module would be non-functional). I guess you have already did all the work so I don't have any principal objections here, it's just like I said, in a non-super contended path, a single "fail" label is probably easier on the developer when they need to add another check there, as opposed to figuring and possibly adding a correct another label that would do something sensible. Thank you for your contributions.