From patchwork Sun Dec 12 13:39:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 400862 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBCDcsMc018003 for ; Sun, 12 Dec 2010 13:38:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936Ab0LLNiw (ORCPT ); Sun, 12 Dec 2010 08:38:52 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:54961 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557Ab0LLNiw (ORCPT ); Sun, 12 Dec 2010 08:38:52 -0500 Received: from localhost.localdomain (unknown [87.66.45.201]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F186435C96; Sun, 12 Dec 2010 13:38:49 +0000 (UTC) From: Laurent Pinchart To: linux-omap@vger.kernel.org Cc: omar.ramirez@ti.com, rene.sapiens@ti.com, ernesto@ti.com, felipe.contreras@gmail.com, ionut.nicu@gmail.com Subject: [PATCH] dspbridge: Fix atoi to support hexadecimal numbers correctly Date: Sun, 12 Dec 2010 14:39:37 +0100 Message-Id: <1292161177-5266-1-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.2.2 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 12 Dec 2010 13:38:55 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 3581a55..b76f26c 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1020,8 +1020,6 @@ static s32 atoi(char *psz_buf) { char *pch = psz_buf; s32 base = 0; - unsigned long res; - int ret_val; while (isspace(*pch)) pch++; @@ -1033,9 +1031,7 @@ static s32 atoi(char *psz_buf) base = 16; } - ret_val = strict_strtoul(pch, base, &res); - - return ret_val ? : res; + return simple_strtoul(pch, NULL, base); } /*