From patchwork Thu Apr 12 19:28:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 152166 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F27C6B7098 for ; Fri, 13 Apr 2012 05:28:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757317Ab2DLT2Q (ORCPT ); Thu, 12 Apr 2012 15:28:16 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:16529 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754139Ab2DLT2P (ORCPT ); Thu, 12 Apr 2012 15:28:15 -0400 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g5t0008.atlanta.hp.com (Postfix) with ESMTP id AC08A241D0; Thu, 12 Apr 2012 19:28:14 +0000 (UTC) Received: from [192.168.1.59] (squirrel.fc.hp.com [15.11.146.57]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id F086A144E4; Thu, 12 Apr 2012 19:28:13 +0000 (UTC) Message-ID: <1334258893.3022.7.camel@lorien2> Subject: [PATCH] net/core: simple_strtoul cleanup From: Shuah Khan Reply-To: shuahkhan@gmail.com To: davem@davemloft.net Cc: shuahkhan@gmail.com, netdev@vger.kernel.org, LKML Date: Thu, 12 Apr 2012 13:28:13 -0600 X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Changed net/core/net-sysfs.c: netdev_store() to use kstrtoul() instead of obsolete simple_strtoul(). From 84371b0ed8b277ec8005fd0efbc73165a8bd72b9 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Thu, 12 Apr 2012 10:36:10 -0600 Subject: [PATCH] net/core: simple_strtoul cleanup Signed-off-by: Shuah Khan --- net/core/net-sysfs.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 4955862..97d0f24 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -74,15 +74,14 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr, int (*set)(struct net_device *, unsigned long)) { struct net_device *net = to_net_dev(dev); - char *endp; unsigned long new; int ret = -EINVAL; if (!capable(CAP_NET_ADMIN)) return -EPERM; - new = simple_strtoul(buf, &endp, 0); - if (endp == buf) + ret = kstrtoul(buf, 0, &new); + if (ret) goto err; if (!rtnl_trylock())