Skip to contentSkip to conversation

linux-next: build warning after merge of the block tree

PATCH In review Stephen Rothwell 3 participants 4 messages Jun 9, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the block tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

drivers/nvdimm/pmem.c: In function 'pmem_pagemap_cleanup':
drivers/nvdimm/pmem.c:338:24: warning: unused variable 'q' [-Wunused-variable]
338 | struct request_queue *q =
| ^

Introduced by commit

80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 11 lines · Stephen Rothwell

Hi all,

After merging the block tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

drivers/nvdimm/pmem.c: In function 'pmem_pagemap_cleanup':
drivers/nvdimm/pmem.c:338:24: warning: unused variable 'q' [-Wunused-variable]
338 | struct request_queue *q =
| ^

Ugh, I should have caught this... fix incoming.

Quoted 7 lines

Introduced by commit

80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")

--
Cheers,
Stephen Rothwell

#2 lore raw

PATCH 1/1 libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning

In reply to Stephen Rothwell

The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer dereference with the queue_to_disk() helper neglected to remove the @q variable when queue_to_disk() was replaced.

Drop the conversion of @pgmap to its containing 'struct request_queue' since pgmap->owner supersedes the need to reference @q.

Fixes 80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")
---
 drivers/nvdimm/pmem.c |    2 --
 1 file changed, 2 deletions(-)
drivers/nvdimm/pmem.c +0 -2
index fc6b78dd2d24..1e0615b8565e 100644
@@ -335,8 +335,6 @@ static const struct attribute_group *pmem_attribute_groups[] = {
 
 static void pmem_pagemap_cleanup(struct dev_pagemap *pgmap)
 {
-	struct request_queue *q =
-		container_of(pgmap->ref, struct request_queue, q_usage_counter);
 	struct pmem_device *pmem = pgmap->owner;
 
 	blk_cleanup_disk(pmem->disk);
maintainer
#3 lore raw

Re: [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning

Quoted 6 lines · Dan Williams

The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer dereference with the queue_to_disk() helper neglected to remove the @q variable when queue_to_disk() was replaced.

Drop the conversion of @pgmap to its containing 'struct request_queue' since pgmap->owner supersedes the need to reference @q.

I folded this in.

Signature · 1 line
Jens Axboe