All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jincheng Miao <jmiao-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul
Date: Wed, 10 Dec 2014 10:54:57 +0800	[thread overview]
Message-ID: <5487B601.20305@redhat.com> (raw)
In-Reply-To: <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Here is my patch for it, and it also resolves issue of pci_num_vf() 
definition.

And I will send V3 for a while.


On 12/10/2014 10:38 AM, Helin Zhang wrote:
> strict_strtoul() was just a redefinition of kstrtoul() for a long
> time. From kernel version of 3.18, strict_strtoul() will not be
> defined at all. A compile time kernel version check is needed to
> decide which function or macro can be used for a specific version
> of kernel.
>
> Signed-off-by: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>   lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
> index d1ca26e..2fcc5f4 100644
> --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
> +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
> @@ -83,7 +83,11 @@ 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 LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
>   	if (0 != strict_strtoul(buf, 0, &max_vfs))
> +#else
> +	if (0 != kstrtoul(buf, 0, &max_vfs))
> +#endif
>   		return -EINVAL;
>   
>   	if (0 == max_vfs)

  parent reply	other threads:[~2014-12-10  2:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  2:38 [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul Helin Zhang
     [not found] ` <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-10  2:54   ` Jincheng Miao [this message]
     [not found]     ` <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-12-10  3:01       ` Zhang, Helin
2014-12-10  3:37         ` Qiu, Michael
2014-12-10  4:00       ` Zhang, Helin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5487B601.20305@redhat.com \
    --to=jmiao-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.