From: Matthew Wilcox <willy@infradead.org>
To: Qian Cai <cai@lca.pw>
Cc: catalin.marinas@arm.com, will@kernel.org, andreyknvl@google.com,
aryabinin@virtuozzo.com, glider@google.com, dvyukov@google.com,
linux-arm-kernel@lists.infradead.org, kasan-dev@googlegroups.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm64/mm: fix variable 'tag' set but not used
Date: Thu, 1 Aug 2019 09:00:13 -0700 [thread overview]
Message-ID: <20190801160013.GK4700@bombadil.infradead.org> (raw)
In-Reply-To: <1564670825-4050-1-git-send-email-cai@lca.pw>
On Thu, Aug 01, 2019 at 10:47:05AM -0400, Qian Cai wrote:
Given this:
> -#define __tag_set(addr, tag) (addr)
> +static inline const void *__tag_set(const void *addr, u8 tag)
> +{
> + return addr;
> +}
> +
> #define __tag_reset(addr) (addr)
> #define __tag_get(addr) 0
> #endif
> @@ -301,8 +305,8 @@ static inline void *phys_to_virt(phys_addr_t x)
> #define page_to_virt(page) ({ \
> unsigned long __addr = \
> ((__page_to_voff(page)) | PAGE_OFFSET); \
> - unsigned long __addr_tag = \
> - __tag_set(__addr, page_kasan_tag(page)); \
> + const void *__addr_tag = \
> + __tag_set((void *)__addr, page_kasan_tag(page)); \
> ((void *)__addr_tag); \
> })
Can't you simplify that macro to:
#define page_to_virt(page) ({ \
unsigned long __addr = \
((__page_to_voff(page)) | PAGE_OFFSET); \
- unsigned long __addr_tag = \
- __tag_set(__addr, page_kasan_tag(page)); \
- ((void *)__addr_tag); \
+ __tag_set((void *)__addr, page_kasan_tag(page)); \
})
next prev parent reply other threads:[~2019-08-01 16:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 14:47 Qian Cai
2019-08-01 16:00 ` Matthew Wilcox [this message]
2019-08-01 16:20 ` Qian Cai
2019-08-05 15:37 ` Andrey Konovalov
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=20190801160013.GK4700@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=andreyknvl@google.com \
--cc=aryabinin@virtuozzo.com \
--cc=cai@lca.pw \
--cc=catalin.marinas@arm.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=will@kernel.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