From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752131AbcLHHch (ORCPT ); Thu, 8 Dec 2016 02:32:37 -0500 Received: from mga05.intel.com ([192.55.52.43]:37606 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcLHHcf (ORCPT ); Thu, 8 Dec 2016 02:32:35 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,318,1477983600"; d="scan'208";a="200325669" Date: Thu, 8 Dec 2016 09:29:16 +0200 From: Heikki Krogerus To: Guenter Roeck Cc: Greg KH , Oliver Neukum , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCHv13,1/3] lib/string: add sysfs_match_string helper Message-ID: <20161208072916.GC11966@kuha.fi.intel.com> References: <20161124122144.26259-2-heikki.krogerus@linux.intel.com> <20161207235445.GA15717@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161207235445.GA15717@roeck-us.net> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 07, 2016 at 03:54:45PM -0800, Guenter Roeck wrote: > > +int __sysfs_match_string(const char * const *array, size_t n, const char *str) > > +{ > > + const char *item; > > + int index; > > + > > + for (index = 0; index < n; index++) { > > + item = array[index]; > > + if (!item) > > + break; > > + if (!sysfs_streq(item, str)) > > No idea how this slipped in: sysfs_streq() returns true on a match, > meaning the "!" here is wrong. Good catch. Thanks Guenter. -- heikki