linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
To: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org,
	Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>,
	linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-c6x-dev-jPsnJVOj+W6hPH1hqNUYSQ@public.gmane.org,
	linux-parisc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-hexagon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-m68k-cunTk1MwBs8S/qaLPR03pWD2FQJk+8+b@public.gmane.org,
	openrisc-cunTk1MwBs9a3B2Vnqf2dGD2FQJk+8+b@public.gmane.org,
	Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-alpha-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nios2-dev-g9ZBwUv/Ih/yUk5EbOjzuce+I+R0W71w@public.gmane.org,
	Vincent Chen <deanbo422-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/3] dma-debug: simplify counting of preallocated requests
Date: Tue, 8 May 2018 10:50:06 +0100	[thread overview]
Message-ID: <b50ef15a-8ffb-e8f2-11a7-b38d2ebda1c6@arm.com> (raw)
In-Reply-To: <20180424140235.9125-3-hch-jcswGhMUV9g@public.gmane.org>

On 24/04/18 15:02, Christoph Hellwig wrote:
> Just keep a single variable with a descriptive name instead of two
> with confusing names.

Reviewed-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>

> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> ---
>   lib/dma-debug.c | 20 ++++----------------
>   1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/dma-debug.c b/lib/dma-debug.c
> index 712a897174e4..075253cb613b 100644
> --- a/lib/dma-debug.c
> +++ b/lib/dma-debug.c
> @@ -132,7 +132,7 @@ static u32 min_free_entries;
>   static u32 nr_total_entries;
>   
>   /* number of preallocated entries requested by kernel cmdline */
> -static u32 req_entries;
> +static u32 nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES;
>   
>   /* debugfs dentry's for the stuff above */
>   static struct dentry *dma_debug_dent        __read_mostly;
> @@ -1011,7 +1011,6 @@ void dma_debug_add_bus(struct bus_type *bus)
>   
>   static int dma_debug_init(void)
>   {
> -	u32 num_entries;
>   	int i;
>   
>   	/* Do not use dma_debug_initialized here, since we really want to be
> @@ -1032,12 +1031,7 @@ static int dma_debug_init(void)
>   		return 0;
>   	}
>   
> -	if (req_entries)
> -		num_entries = req_entries;
> -	else
> -		num_entries = PREALLOC_DMA_DEBUG_ENTRIES;
> -
> -	if (prealloc_memory(num_entries) != 0) {
> +	if (prealloc_memory(nr_prealloc_entries) != 0) {
>   		pr_err("DMA-API: debugging out of memory error - disabled\n");
>   		global_disable = true;
>   
> @@ -1068,16 +1062,10 @@ static __init int dma_debug_cmdline(char *str)
>   
>   static __init int dma_debug_entries_cmdline(char *str)
>   {
> -	int res;
> -
>   	if (!str)
>   		return -EINVAL;
> -
> -	res = get_option(&str, &req_entries);
> -
> -	if (!res)
> -		req_entries = 0;
> -
> +	if (!get_option(&str, &nr_prealloc_entries))
> +		nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES;
>   	return 0;
>   }
>   
> 

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux-foundation.org
Cc: linux-arch@vger.kernel.org, linux-xtensa@linux-xtensa.org,
	Michal Simek <monstr@monstr.eu>,
	Vincent Chen <deanbo422@gmail.com>,
	linux-c6x-dev@linux-c6x.org, linux-parisc@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
	openrisc@lists.librecores.org, Greentime Hu <green.hu@gmail.com>,
	linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org,
	nios2-dev@lists.rocketboards.org,
	linux-snps-arc@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] dma-debug: simplify counting of preallocated requests
Date: Tue, 8 May 2018 10:50:06 +0100	[thread overview]
Message-ID: <b50ef15a-8ffb-e8f2-11a7-b38d2ebda1c6@arm.com> (raw)
Message-ID: <20180508095006.i-mDrsxK_5EjHhZKYyefHUAVVGtxBDp5HV9ObkeUFCg@z> (raw)
In-Reply-To: <20180424140235.9125-3-hch@lst.de>

On 24/04/18 15:02, Christoph Hellwig wrote:
> Just keep a single variable with a descriptive name instead of two
> with confusing names.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   lib/dma-debug.c | 20 ++++----------------
>   1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/dma-debug.c b/lib/dma-debug.c
> index 712a897174e4..075253cb613b 100644
> --- a/lib/dma-debug.c
> +++ b/lib/dma-debug.c
> @@ -132,7 +132,7 @@ static u32 min_free_entries;
>   static u32 nr_total_entries;
>   
>   /* number of preallocated entries requested by kernel cmdline */
> -static u32 req_entries;
> +static u32 nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES;
>   
>   /* debugfs dentry's for the stuff above */
>   static struct dentry *dma_debug_dent        __read_mostly;
> @@ -1011,7 +1011,6 @@ void dma_debug_add_bus(struct bus_type *bus)
>   
>   static int dma_debug_init(void)
>   {
> -	u32 num_entries;
>   	int i;
>   
>   	/* Do not use dma_debug_initialized here, since we really want to be
> @@ -1032,12 +1031,7 @@ static int dma_debug_init(void)
>   		return 0;
>   	}
>   
> -	if (req_entries)
> -		num_entries = req_entries;
> -	else
> -		num_entries = PREALLOC_DMA_DEBUG_ENTRIES;
> -
> -	if (prealloc_memory(num_entries) != 0) {
> +	if (prealloc_memory(nr_prealloc_entries) != 0) {
>   		pr_err("DMA-API: debugging out of memory error - disabled\n");
>   		global_disable = true;
>   
> @@ -1068,16 +1062,10 @@ static __init int dma_debug_cmdline(char *str)
>   
>   static __init int dma_debug_entries_cmdline(char *str)
>   {
> -	int res;
> -
>   	if (!str)
>   		return -EINVAL;
> -
> -	res = get_option(&str, &req_entries);
> -
> -	if (!res)
> -		req_entries = 0;
> -
> +	if (!get_option(&str, &nr_prealloc_entries))
> +		nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES;
>   	return 0;
>   }
>   
> 

  parent reply	other threads:[~2018-05-08  9:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 14:02 dma-debug cleanups, including removing the arch hook Christoph Hellwig
2018-04-24 14:02 ` Christoph Hellwig
2018-04-24 14:02 ` [PATCH 2/3] dma-debug: simplify counting of preallocated requests Christoph Hellwig
2018-04-24 14:02   ` Christoph Hellwig
     [not found]   ` <20180424140235.9125-3-hch-jcswGhMUV9g@public.gmane.org>
2018-05-08  9:50     ` Robin Murphy [this message]
2018-05-08  9:50       ` Robin Murphy
     [not found] ` <20180424140235.9125-1-hch-jcswGhMUV9g@public.gmane.org>
2018-04-24 14:02   ` [PATCH 1/3] dma-debug: move initialization to common code Christoph Hellwig
2018-04-24 14:02     ` Christoph Hellwig
     [not found]     ` <20180424140235.9125-2-hch-jcswGhMUV9g@public.gmane.org>
2018-05-08  9:46       ` Robin Murphy
2018-05-08  9:46         ` Robin Murphy
2018-05-08 10:22       ` Marek Szyprowski
2018-05-08 10:22         ` Marek Szyprowski
2018-04-24 14:02   ` [PATCH 3/3] dma-debug: unexport dma_debug_resize_entries and debug_dma_dump_mappings Christoph Hellwig
2018-04-24 14:02     ` Christoph Hellwig
     [not found]     ` <20180424140235.9125-4-hch-jcswGhMUV9g@public.gmane.org>
2018-05-08 10:05       ` Robin Murphy
2018-05-08 10:05         ` Robin Murphy
2018-05-08 10:45         ` Christoph Hellwig
2018-05-08 10:45           ` Christoph Hellwig
2018-04-27 15:53   ` [PATCH 4/3] dma-debug: remove CONFIG_HAVE_DMA_API_DEBUG Christoph Hellwig
2018-04-27 15:53     ` Christoph Hellwig
     [not found]     ` <20180427155342.GA9232-jcswGhMUV9g@public.gmane.org>
2018-05-08  9:54       ` Robin Murphy
2018-05-08  9:54         ` Robin Murphy
2018-05-07 10:29   ` dma-debug cleanups, including removing the arch hook Christoph Hellwig
2018-05-07 10:29     ` Christoph Hellwig

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=b50ef15a-8ffb-e8f2-11a7-b38d2ebda1c6@arm.com \
    --to=robin.murphy-5wv7dgnigg8@public.gmane.org \
    --cc=deanbo422-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-alpha-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-c6x-dev-jPsnJVOj+W6hPH1hqNUYSQ@public.gmane.org \
    --cc=linux-hexagon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-m68k-cunTk1MwBs8S/qaLPR03pWD2FQJk+8+b@public.gmane.org \
    --cc=linux-parisc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org \
    --cc=monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org \
    --cc=nios2-dev-g9ZBwUv/Ih/yUk5EbOjzuce+I+R0W71w@public.gmane.org \
    --cc=openrisc-cunTk1MwBs9a3B2Vnqf2dGD2FQJk+8+b@public.gmane.org \
    --cc=sparclinux-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).