DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] eal: replace strict_strtoul with kstrtoul
@ 2014-10-24  7:07 Jincheng Miao
  2014-10-30  0:04 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Jincheng Miao @ 2014-10-24  7:07 UTC (permalink / raw)
  To: dev

>From upstream kernel commit 3db2e9cd, strict_strto* serial functions
are removed. So that we should directly used kstrtoul instead.

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c       | 4 ++--
 lib/librte_eal/linuxapp/kni/kni_vhost.c         | 2 +-
 lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index d1ca26e..47ff2f3 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -83,7 +83,7 @@ store_max_vfs(struct device *dev, struct device_attribute *attr,
 	unsigned long max_vfs;
 	struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
 
-	if (0 != strict_strtoul(buf, 0, &max_vfs))
+	if (0 != kstrtoul(buf, 0, &max_vfs))
 		return -EINVAL;
 
 	if (0 == max_vfs)
@@ -174,7 +174,7 @@ store_max_read_request_size(struct device *dev,
 	unsigned long size = 0;
 	int ret;
 
-	if (strict_strtoul(buf, 0, &size) != 0)
+	if (0 != kstrtoul(buf, 0, &size))
 		return -EINVAL;
 
 	ret = pcie_set_readrq(pci_dev, (int)size);
diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c
index fe512c2..ba0c1ac 100644
--- a/lib/librte_eal/linuxapp/kni/kni_vhost.c
+++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c
@@ -739,7 +739,7 @@ set_sock_en(struct device *dev, struct device_attribute *attr,
 	unsigned long en;
 	int err = 0;
 
-	if (0 != strict_strtoul(buf, 0, &en))
+	if (0 != kstrtoul(buf, 0, &en))
 		return -EINVAL;
 
 	if (en)
diff --git a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
index dfb271d..8a3727d 100644
--- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
+++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
@@ -123,7 +123,7 @@ store_memsize(struct device *dev, struct device_attribute *attr,
 	int err = 0;
 	unsigned long mem_size;
 
-	if (0 != strict_strtoul(buf, 0, &mem_size))
+	if (0 != kstrtoul(buf, 0, &mem_size))
 		return  -EINVAL;
 
 	mutex_lock(&dom0_dev.data_lock);
-- 
1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: replace strict_strtoul with kstrtoul
  2014-10-24  7:07 [dpdk-dev] [PATCH] eal: replace strict_strtoul with kstrtoul Jincheng Miao
@ 2014-10-30  0:04 ` Thomas Monjalon
  2014-10-30  2:30   ` Jincheng Miao
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2014-10-30  0:04 UTC (permalink / raw)
  To: Jincheng Miao; +Cc: dev

Hi Jincheng,

2014-10-24 15:07, Jincheng Miao:
> From upstream kernel commit 3db2e9cd, strict_strto* serial functions
> are removed. So that we should directly used kstrtoul instead.

kstrtoul appeared in version 2.6.39 in commit 33ee3b2e2eb9b
("kstrto*: converting strings to integers done (hopefully) right")

So we need a compatibility fallback.

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: replace strict_strtoul with kstrtoul
  2014-10-30  0:04 ` Thomas Monjalon
@ 2014-10-30  2:30   ` Jincheng Miao
  0 siblings, 0 replies; 3+ messages in thread
From: Jincheng Miao @ 2014-10-30  2:30 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev


On 10/30/2014 08:04 AM, Thomas Monjalon wrote:
> Hi Jincheng,
>
> 2014-10-24 15:07, Jincheng Miao:
>>  From upstream kernel commit 3db2e9cd, strict_strto* serial functions
>> are removed. So that we should directly used kstrtoul instead.
> kstrtoul appeared in version 2.6.39 in commit 33ee3b2e2eb9b
> ("kstrto*: converting strings to integers done (hopefully) right")
>
> So we need a compatibility fallback.

Hi Thomas,

The solution could be simple, we could check the version of kernel,
and define a macro kstrtoul for old kernel.

Regards & thanks,
Jincheng Miao


>
> Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-30  2:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-24  7:07 [dpdk-dev] [PATCH] eal: replace strict_strtoul with kstrtoul Jincheng Miao
2014-10-30  0:04 ` Thomas Monjalon
2014-10-30  2:30   ` Jincheng Miao

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git