From patchwork Wed Feb 19 05:09:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daeseok Youn X-Patchwork-Id: 321731 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 64F2A2C01AB for ; Wed, 19 Feb 2014 16:09:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750771AbaBSFJ4 (ORCPT ); Wed, 19 Feb 2014 00:09:56 -0500 Received: from mail-oa0-f42.google.com ([209.85.219.42]:49203 "EHLO mail-oa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbaBSFJz (ORCPT ); Wed, 19 Feb 2014 00:09:55 -0500 Received: by mail-oa0-f42.google.com with SMTP id i7so20552354oag.1 for ; Tue, 18 Feb 2014 21:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=8YahpST96wzT9okEVttj2hA1rKIb5bZodvZAiV/vnT0=; b=XwjoeA1HumRrgrivvD7ZOHSwiZDTqkcHaMFf9CUbgJPTW95sy1b+16FiSvSeMdGbUT lCZIzi/xWNz63el5Rx1+dKnhKAjIaKRBJojGwwVm+HiboOrsY93LHN3ZMaDhs5nPb+ix eiO1jGrwavPOzJIJ2oBQq5LxuTymOLtblj7MPJUZAgQMk1F6eiwP5mfyJOugw4pAwpVo 8fj3/K39bSzGhiWuObeJuBAkCglI/+h34KY43Pe403tM7vgw/DadoR1KALbkCEzw5mBm 8uaRrXcv6vloyZDs0KfOpjN7u7rUgqa0izVHyNz73GguqSCB4L5U4fdXY2zaVfCywesF IRbQ== X-Received: by 10.182.107.232 with SMTP id hf8mr81288obb.75.1392786594040; Tue, 18 Feb 2014 21:09:54 -0800 (PST) Received: from daeseok-laptop.cloud.net ([121.50.21.19]) by mx.google.com with ESMTPSA id hl3sm66246718obb.0.2014.02.18.21.09.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 21:09:53 -0800 (PST) From: Daeseok Youn To: tj@kernel.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] atm: libahci: replace obselete simple_strtoul() with kstrtouint() Date: Wed, 19 Feb 2014 14:09:49 +0900 Message-ID: <1983660.RVkLooTtjT@daeseok-laptop.cloud.net> User-Agent: KMail/4.8.5 (Linux/3.2.0-58-generic; KDE/4.8.5; x86_64; ; ) MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From 18bd7236f36a248a0871f810cec3c1e98f098a91 Mon Sep 17 00:00:00 2001 From: Daeseok Youn Date: Wed, 19 Feb 2014 13:44:24 +0900 Subject: [PATCH] atm: libahci: replace obselete simple_strtoul() with kstrtouint() Signed-off-by: Daeseok Youn --- drivers/ata/libahci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 36605ab..417946b 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1032,12 +1032,13 @@ static ssize_t ahci_led_show(struct ata_port *ap, char *buf) static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, size_t size) { - int state; + unsigned int state; int pmp; struct ahci_port_priv *pp = ap->private_data; struct ahci_em_priv *emp; - state = simple_strtoul(buf, NULL, 0); + if (kstrtouint(buf, 0, &state) < 0) + return -EINVAL; /* get the slot number from the message */