[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130304035226.GA4273@neilslaptop.think-freely.org>
Date: Sun, 3 Mar 2013 22:52:26 -0500
From: Neil Horman <nhorman@...driver.com>
To: Cong Wang <amwang@...hat.com>
Cc: netdev@...r.kernel.org, linux-sctp@...r.kernel.org,
Vlad Yasevich <vyasevich@...il.com>,
Sridhar Samudrala <sri@...ibm.com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own
MAX_KMALLOC_SIZE
On Mon, Mar 04, 2013 at 10:28:27AM +0800, Cong Wang wrote:
> From: Cong Wang <amwang@...hat.com>
>
> Don't definite its own MAX_KMALLOC_SIZE, use the one
> defined in mm.
>
> Cc: Vlad Yasevich <vyasevich@...il.com>
> Cc: Sridhar Samudrala <sri@...ibm.com>
> Cc: Neil Horman <nhorman@...driver.com>
> Cc: David S. Miller <davem@...emloft.net>
> Signed-off-by: Cong Wang <amwang@...hat.com>
>
Acked-by: Neil Horman <nhorman@...driver.com>
> ---
> diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
> index 442ad4e..825ea94 100644
> --- a/net/sctp/ssnmap.c
> +++ b/net/sctp/ssnmap.c
> @@ -41,8 +41,6 @@
> #include <net/sctp/sctp.h>
> #include <net/sctp/sm.h>
>
> -#define MAX_KMALLOC_SIZE 131072
> -
> static struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *map, __u16 in,
> __u16 out);
>
> @@ -65,7 +63,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
> int size;
>
> size = sctp_ssnmap_size(in, out);
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> retval = kmalloc(size, gfp);
> else
> retval = (struct sctp_ssnmap *)
> @@ -82,7 +80,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
> return retval;
>
> fail_map:
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> kfree(retval);
> else
> free_pages((unsigned long)retval, get_order(size));
> @@ -124,7 +122,7 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map)
> int size;
>
> size = sctp_ssnmap_size(map->in.len, map->out.len);
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> kfree(map);
> else
> free_pages((unsigned long)map, get_order(size));
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists