linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Omkar Wagle <ov.wagle@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MM: kmemleak: Removed coding style warnings and added a NULL check
Date: Wed, 8 Nov 2023 10:41:06 +0000	[thread overview]
Message-ID: <ZUtlwgDB1L2WVzfy@arm.com> (raw)
In-Reply-To: <20231108062756.8129-1-ov.wagle@gmail.com>

On Tue, Nov 07, 2023 at 10:27:56PM -0800, Omkar Wagle wrote:
> @@ -406,10 +406,13 @@ static struct kmemleak_object *__lookup_object(unsigned long ptr, int alias,
>  	unsigned long untagged_ptr = (unsigned long)kasan_reset_tag((void *)ptr);
>  
>  	while (rb) {
> -		struct kmemleak_object *object;
> +		struct kmemleak_object *object = NULL;
>  		unsigned long untagged_objp;
>  
>  		object = rb_entry(rb, struct kmemleak_object, rb_node);
> +		if (!object)
> +			break;

No need for this. rb_entry() is a container_of() and we already check
that rb is not NULL.

> @@ -1027,7 +1030,7 @@ static void object_no_scan(unsigned long ptr)
>  void __ref kmemleak_alloc(const void *ptr, size_t size, int min_count,
>  			  gfp_t gfp)
>  {
> -	pr_debug("%s(0x%px, %zu, %d)\n", __func__, ptr, size, min_count);
> +	pr_debug("%s(0x%p, %zu, %d)\n", __func__, ptr, size, min_count);

That's for debugging, I'd rather keep the %px option. The same comment
applies to all the other pr_debug() changes in this file.

-- 
Catalin


  reply	other threads:[~2023-11-08 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08  6:27 Omkar Wagle
2023-11-08 10:41 ` Catalin Marinas [this message]
2023-11-08 16:54   ` [PATCH 2/2] MM: kmemleak: Add %x to pr_debug Omkar Wagle
2023-11-09 17:06     ` Catalin Marinas

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=ZUtlwgDB1L2WVzfy@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ov.wagle@gmail.com \
    /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