linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] lightnvm pull request
@ 2021-02-14 10:31 Matias Bjørling
  2021-02-14 10:31 ` [PATCH 1/2] lightnvm: fix unnecessary NULL check warnings Matias Bjørling
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matias Bjørling @ 2021-02-14 10:31 UTC (permalink / raw)
  To: axboe, m; +Cc: linux-block, Matias Bjørling

Hi Jens,

A small PR for 5.12. Can you please pick them up when convenient.

Thank you, Matias

Andy Shevchenko (1):
  lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid()

Tian Tao (1):
  lightnvm: fix unnecessary NULL check warnings

 drivers/lightnvm/pblk-core.c     | 5 ++---
 drivers/lightnvm/pblk-gc.c       | 3 +--
 drivers/lightnvm/pblk-recovery.c | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

--
2.25.1


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

* [PATCH 1/2] lightnvm: fix unnecessary NULL check warnings
  2021-02-14 10:31 [PATCH 0/2] lightnvm pull request Matias Bjørling
@ 2021-02-14 10:31 ` Matias Bjørling
  2021-02-14 10:31 ` [PATCH 2/2] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() Matias Bjørling
  2021-02-15  4:28 ` [PATCH 0/2] lightnvm pull request Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Matias Bjørling @ 2021-02-14 10:31 UTC (permalink / raw)
  To: axboe, m; +Cc: linux-block, Tian Tao, Matias Bjørling

From: Tian Tao <tiantao6@hisilicon.com>

Remove NULL checks before vfree() to fix these warnings:
./drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some
freeing functions is not needed.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
---
 drivers/lightnvm/pblk-gc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 2581eebcfc41..b31658be35a7 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -23,8 +23,7 @@
 
 static void pblk_gc_free_gc_rq(struct pblk_gc_rq *gc_rq)
 {
-	if (gc_rq->data)
-		vfree(gc_rq->data);
+	vfree(gc_rq->data);
 	kfree(gc_rq);
 }
 
-- 
2.25.1


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

* [PATCH 2/2] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid()
  2021-02-14 10:31 [PATCH 0/2] lightnvm pull request Matias Bjørling
  2021-02-14 10:31 ` [PATCH 1/2] lightnvm: fix unnecessary NULL check warnings Matias Bjørling
@ 2021-02-14 10:31 ` Matias Bjørling
  2021-02-15  4:28 ` [PATCH 0/2] lightnvm pull request Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Matias Bjørling @ 2021-02-14 10:31 UTC (permalink / raw)
  To: axboe, m; +Cc: linux-block, Andy Shevchenko, Matias Bjørling

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

There is a specific API to treat raw data as GUID, i.e. export_guid()
and import_guid(). Use them instead of guid_copy() with explicit casting.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
---
 drivers/lightnvm/pblk-core.c     | 5 ++---
 drivers/lightnvm/pblk-recovery.c | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 1dddba11e721..33d39d3dd343 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -988,7 +988,7 @@ static int pblk_line_init_metadata(struct pblk *pblk, struct pblk_line *line,
 	bitmap_set(line->lun_bitmap, 0, lm->lun_bitmap_len);
 
 	smeta_buf->header.identifier = cpu_to_le32(PBLK_MAGIC);
-	guid_copy((guid_t *)&smeta_buf->header.uuid, &pblk->instance_uuid);
+	export_guid(smeta_buf->header.uuid, &pblk->instance_uuid);
 	smeta_buf->header.id = cpu_to_le32(line->id);
 	smeta_buf->header.type = cpu_to_le16(line->type);
 	smeta_buf->header.version_major = SMETA_VERSION_MAJOR;
@@ -1803,8 +1803,7 @@ void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line)
 
 	if (le32_to_cpu(emeta_buf->header.identifier) != PBLK_MAGIC) {
 		emeta_buf->header.identifier = cpu_to_le32(PBLK_MAGIC);
-		guid_copy((guid_t *)&emeta_buf->header.uuid,
-							&pblk->instance_uuid);
+		export_guid(emeta_buf->header.uuid, &pblk->instance_uuid);
 		emeta_buf->header.id = cpu_to_le32(line->id);
 		emeta_buf->header.type = cpu_to_le16(line->type);
 		emeta_buf->header.version_major = EMETA_VERSION_MAJOR;
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 299ef47a17b2..0e6f0c76e930 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -706,8 +706,7 @@ struct pblk_line *pblk_recov_l2p(struct pblk *pblk)
 
 		/* The first valid instance uuid is used for initialization */
 		if (!valid_uuid) {
-			guid_copy(&pblk->instance_uuid,
-				  (guid_t *)&smeta_buf->header.uuid);
+			import_guid(&pblk->instance_uuid, smeta_buf->header.uuid);
 			valid_uuid = 1;
 		}
 
-- 
2.25.1


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

* Re: [PATCH 0/2] lightnvm pull request
  2021-02-14 10:31 [PATCH 0/2] lightnvm pull request Matias Bjørling
  2021-02-14 10:31 ` [PATCH 1/2] lightnvm: fix unnecessary NULL check warnings Matias Bjørling
  2021-02-14 10:31 ` [PATCH 2/2] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() Matias Bjørling
@ 2021-02-15  4:28 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-02-15  4:28 UTC (permalink / raw)
  To: Matias Bjørling, m; +Cc: linux-block, Matias Bjørling

On 2/14/21 3:31 AM, Matias Bjørling wrote:
> Hi Jens,
> 
> A small PR for 5.12. Can you please pick them up when convenient.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-02-15  4:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 10:31 [PATCH 0/2] lightnvm pull request Matias Bjørling
2021-02-14 10:31 ` [PATCH 1/2] lightnvm: fix unnecessary NULL check warnings Matias Bjørling
2021-02-14 10:31 ` [PATCH 2/2] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() Matias Bjørling
2021-02-15  4:28 ` [PATCH 0/2] lightnvm pull request Jens Axboe

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