linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fscache: replace open-coded pr_warn_once() with actual call
@ 2020-07-05 22:43 Jason A. Donenfeld
  2020-07-06 14:23 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Jason A. Donenfeld @ 2020-07-05 22:43 UTC (permalink / raw)
  To: dhowells, linux-cachefs, linux-kernel; +Cc: Jason A. Donenfeld

There's no reason to open code this here, so instead replace it with
pr_warn_once, which amounts to exactly the same thing.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 fs/fscache/page.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 26af6fdf1538..dc8dce79fa8d 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -1173,14 +1173,9 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
 	trace_fscache_page(cookie, page, fscache_page_cached);
 
 	_debug("- mark %p{%lx}", page, page->index);
-	if (TestSetPageFsCache(page)) {
-		static bool once_only;
-		if (!once_only) {
-			once_only = true;
-			pr_warn("Cookie type %s marked page %lx multiple times\n",
-				cookie->def->name, page->index);
-		}
-	}
+	if (TestSetPageFsCache(page))
+		pr_warn_once("Cookie type %s marked page %lx multiple times\n",
+			     cookie->def->name, page->index);
 
 	if (cookie->def->mark_page_cached)
 		cookie->def->mark_page_cached(cookie->netfs_data,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fscache: replace open-coded pr_warn_once() with actual call
  2020-07-05 22:43 [PATCH] fscache: replace open-coded pr_warn_once() with actual call Jason A. Donenfeld
@ 2020-07-06 14:23 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2020-07-06 14:23 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: dhowells, linux-cachefs, linux-kernel

Jason A. Donenfeld <Jason@zx2c4.com> wrote:

> There's no reason to open code this here, so instead replace it with
> pr_warn_once, which amounts to exactly the same thing.

Note that this file is set to be entirely deleted here:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-iter

David


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-06 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 22:43 [PATCH] fscache: replace open-coded pr_warn_once() with actual call Jason A. Donenfeld
2020-07-06 14:23 ` David Howells

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).