Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758938AbZANWf6 (ORCPT ); Wed, 14 Jan 2009 17:35:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754927AbZANWfq (ORCPT ); Wed, 14 Jan 2009 17:35:46 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:50509 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753316AbZANWfp (ORCPT ); Wed, 14 Jan 2009 17:35:45 -0500 References: <200901141316.27584.david-b@pacbell.net> Message-Id: From: Mark Brown To: David Brownell In-Reply-To: <200901141316.27584.david-b@pacbell.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Subject: Re: [patch 2.6.29-rc] regulator: minor cleanup of virtual consumer Date: Wed, 14 Jan 2009 22:36:14 +0000 Cc: Liam Girdwood , lkml Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1657 Lines: 45 On 14 Jan 2009, at 21:16, David Brownell wrote: > From: David Brownell > > Minor cleanup to the regulator set_mode sysfs support: > switch to sysfs_streq() in set_mode(), which is also > a code shrink. Use the same strings that get_mode() > uses, shrinking data too. > > Signed-off-by: David Brownell Excellent, thanks! Acked-by: Mark Brown > > --- > drivers/regulator/virtual.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- a/drivers/regulator/virtual.c > +++ b/drivers/regulator/virtual.c > @@ -226,13 +226,13 @@ static ssize_t set_mode(struct device *d > unsigned int mode; > int ret; > > - if (strncmp(buf, "fast", strlen("fast")) == 0) > + if (sysfs_streq(buf, "fast\n") == 0) > mode = REGULATOR_MODE_FAST; > - else if (strncmp(buf, "normal", strlen("normal")) == 0) > + else if (sysfs_streq(buf, "normal\n") == 0) > mode = REGULATOR_MODE_NORMAL; > - else if (strncmp(buf, "idle", strlen("idle")) == 0) > + else if (sysfs_streq(buf, "idle\n") == 0) > mode = REGULATOR_MODE_IDLE; > - else if (strncmp(buf, "standby", strlen("standby")) == 0) > + else if (sysfs_streq(buf, "standby\n") == 0) > mode = REGULATOR_MODE_STANDBY; > else { > dev_err(dev, "Configuring invalid mode\n"); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/