From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932636AbbJHXD5 (ORCPT ); Thu, 8 Oct 2015 19:03:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:36859 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932580AbbJHXDy (ORCPT ); Thu, 8 Oct 2015 19:03:54 -0400 Date: Fri, 9 Oct 2015 01:03:53 +0200 From: "Luis R. Rodriguez" To: Josh Boyer Cc: "Luis R. Rodriguez" , Greg KH , Ming Lei , Jonathan Corbet , "Linux-Kernel@Vger. Kernel. Org" , linux-doc@vger.kernel.org, David Woodhouse , David Howells , Seth Forshee , Rusty Russell , Michal Marek , Matthew Garrett , kyle@kernel.org, linux-security-module , keyrings@linux-nfs.org, Tom Gundersen Subject: Re: [PATCH v2 5/5] firmware: add an extensible system data helpers Message-ID: <20151008230353.GM14464@wotan.suse.de> References: <1443721449-22882-1-git-send-email-mcgrof@do-not-panic.com> <1443721449-22882-6-git-send-email-mcgrof@do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2015 at 01:59:11PM -0400, Josh Boyer wrote: > On Thu, Oct 1, 2015 at 1:44 PM, Luis R. Rodriguez > > +static inline int desc_sync_found_call_cb(const struct sysdata_file_desc *desc, > > + const struct sysdata_file *sysdata) > > +{ > > + BUG_ON(desc->sync_reqs.mode != SYNCDATA_SYNC); > > ngh... Why do these inline functions all have BUG_ONs in them? If it > is to catch a programming error, why can't you just return EINVAL like > you do in the async function case? (Even that WARN_ON seems > excessive). Sure, I've replaced the pesky BUG_ON() with returning -EINVAL's. Let me know if there is anything else. Luis