From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755671AbcAHONA (ORCPT ); Fri, 8 Jan 2016 09:13:00 -0500 Received: from mga01.intel.com ([192.55.52.88]:34864 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755655AbcAHOM4 (ORCPT ); Fri, 8 Jan 2016 09:12:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,538,1444719600"; d="scan'208";a="877333208" Message-ID: <1452262398.1342.4.camel@linux.intel.com> Subject: Re: [PATCH v3 0/9] lib/string: introduce match_string() helper From: Andy Shevchenko To: Al Viro Cc: Tejun Heo , Linus Walleij , Dmitry Eremin-Solenikov , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "David S . Miller" , David Airlie , Andrew Morton , Rasmus Villemoes Date: Fri, 08 Jan 2016 16:13:18 +0200 In-Reply-To: <20160108131908.GB17997@ZenIV.linux.org.uk> References: <1452258558-119552-1-git-send-email-andriy.shevchenko@linux.intel.com> <20160108131908.GB17997@ZenIV.linux.org.uk> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-01-08 at 13:19 +0000, Al Viro wrote: > On Fri, Jan 08, 2016 at 03:09:09PM +0200, Andy Shevchenko wrote: > > There are users of a simple string matching in the array. Let's do > > a common > > helper for that. >   > What's the reason for making it return -ENODATA when no match is > found? What else can be suitable? > That one of the callers wants to return that as error in such case? > At least one other is returning -EINVAL in the same situation... Linus Acked this, maybe he missed that one. Linus, do we still need to return -EINVAL in pinmux? In general our error reporting sucks, you know. So, any return value will be not ideal and self-explanatory (see json approach in perf). But I prefer return some return code instead of opaque -1, for example. This at least helps some users. -- Andy Shevchenko Intel Finland Oy