Skip to contentSkip to conversation

Fixing check patch styling issues

PATCH RESEND Superseded Raghu Halharvi 2 participants 4 messages Jul 25, 2023 CXL

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Fixing check patch styling issues

v6 changes:
- PATCH RESEND, the v5 was approved was not committed, Ira suggested to resend both patches.

v5 changes:
- Updated the missing reviewed tag in "cxl/mbox: Remove redundant dev_err() after failed mem alloc" patch (Dave Jiang)

v4 changes:
- Updated the respective patches with reviewers tags for respective patches(Dave Jiang)

v3 changes:
- Update the cover letter and commit message with full author name(Fabio/Alison)
- Correct the "typo error" in commit message(Fabio)

v2 changes:
Thanks Alison, Ira for your comments, modified the v1 patches as suggested.
Dropped the patch containing tab changes in port.c

v1 cover letter:
The following patches are cleanup or fixing the styling issues found using checkpatch

In cxl/core/mbox.c, in case of null check failure, returning errno or -ENOMEM in this case is good enough, removing the redundant dev_err message.

In cxl/core/region.c, the else is not required after the return statement, cleaned it up.

Verified the build and sanity by booting the guest VM using the freshly built components.

Raghu Halharvi (2):
cxl/mbox: Remove redundant dev_err() after failed mem alloc cxl/region: Remove else after return statement

 drivers/cxl/core/mbox.c   | 4 +---
 drivers/cxl/core/region.c | 8 ++++----
 2 files changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH RESEND v6 1/2 cxl/mbox: Remove redundant dev_err() after failed mem alloc

Issue found with checkpatch

A return of errno should be good enough if the memory allocation fails, the error message here is redundant as per the coding style, removing it.

---
 drivers/cxl/core/mbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/cxl/core/mbox.c +1 -3
index d6d067fbee97..af7f37cea871 100644
@@ -1325,10 +1325,8 @@ struct cxl_memdev_state *cxl_memdev_state_create(struct device *dev)
 	struct cxl_memdev_state *mds;
 
 	mds = devm_kzalloc(dev, sizeof(*mds), GFP_KERNEL);
-	if (!mds) {
-		dev_err(dev, "No memory available\n");
+	if (!mds)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	mutex_init(&mds->mbox_mutex);
 	mutex_init(&mds->event.log_lock);
Signature · 1 line
2.39.2
#2 lore raw

PATCH RESEND v6 2/2 cxl/region: Remove else after return statement

In reply to Raghu Halharvi

Issue found with checkpatch

The else section here is redundant after return statement, removing it. Sanity and correctness is not affected due to this fix.

---
 drivers/cxl/core/region.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cxl/core/region.c +4 -4
index e115ba382e04..bfd3b13dd2c1 100644
@@ -133,11 +133,11 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr)
 				&cxlr->dev,
 				"Bypassing cpu_cache_invalidate_memregion() for testing!\n");
 			return 0;
-		} else {
-			dev_err(&cxlr->dev,
-				"Failed to synchronize CPU cache state\n");
-			return -ENXIO;
 		}
+
+		dev_err(&cxlr->dev,
+			"Failed to synchronize CPU cache state\n");
+		return -ENXIO;
 	}
 
 	cpu_cache_invalidate_memregion(IORES_DESC_CXL);
Signature · 1 line
2.39.2
maintainer
#3 lore raw
In reply to Raghu Halharvi
Quoted 3 lines · Raghu Halharvi

v6 changes:
- PATCH RESEND, the v5 was approved was not committed, Ira suggested to resend both patches.

Hi Raghu,

If this was a true RESEND, the version number should not have changed.
See: Documentation/process/submitting-patches.rst

Alas, this v6 has changes from v5 that are not listed here, so this is not a RESEND, it is a new version.

Both patches were rebased, and in Patch 1 that led to a changed function name too.

What to do?
How about you send a reply to this cover letter with the v5->v6 changelog, and let's see if that's clear enough.

Thanks,
Alison

Quoted 44 lines

v5 changes:
- Updated the missing reviewed tag in "cxl/mbox: Remove redundant dev_err() after failed mem alloc" patch (Dave Jiang)

v4 changes:
- Updated the respective patches with reviewers tags for respective patches(Dave Jiang)

v3 changes:
- Update the cover letter and commit message with full author name(Fabio/Alison)
- Correct the "typo error" in commit message(Fabio)

v2 changes:
Thanks Alison, Ira for your comments, modified the v1 patches as suggested.
Dropped the patch containing tab changes in port.c

v1 cover letter:
The following patches are cleanup or fixing the styling issues found using checkpatch

In cxl/core/mbox.c, in case of null check failure, returning errno or -ENOMEM in this case is good enough, removing the redundant dev_err message.

In cxl/core/region.c, the else is not required after the return statement, cleaned it up.

Verified the build and sanity by booting the guest VM using the freshly built components.

Raghu Halharvi (2):
cxl/mbox: Remove redundant dev_err() after failed mem alloc cxl/region: Remove else after return statement

 drivers/cxl/core/mbox.c   | 4 +---
 drivers/cxl/core/region.c | 8 ++++----
 2 files changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.39.2