All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Fixing check patch styling issues
@ 2023-05-08  8:25 Raghu Halharvi
  2023-05-08  8:25 ` [PATCH v3 1/2] cxl/mbox: Remove redundant dev_err() after failed mem alloc Raghu Halharvi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Raghu Halharvi @ 2023-05-08  8:25 UTC (permalink / raw)
  To: linux-cxl, Alison Schofield, raghuhack78, ira.weiny, bwidawsk,
	dan.j.williams, vishal.l.verma
  Cc: linux-kernel

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

-- 
2.39.2


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

* [PATCH v3 1/2] cxl/mbox: Remove redundant dev_err() after failed mem alloc
  2023-05-08  8:25 [PATCH v3 0/2] Fixing check patch styling issues Raghu Halharvi
@ 2023-05-08  8:25 ` Raghu Halharvi
  2023-05-08  8:25 ` [PATCH v3 2/2] cxl/region: Remove else after return statement Raghu Halharvi
  2023-05-08 16:01 ` [PATCH v3 0/2] Fixing check patch styling issues Dave Jiang
  2 siblings, 0 replies; 4+ messages in thread
From: Raghu Halharvi @ 2023-05-08  8:25 UTC (permalink / raw)
  To: linux-cxl, Alison Schofield, raghuhack78, ira.weiny, bwidawsk,
	dan.j.williams, vishal.l.verma
  Cc: linux-kernel

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.

Signed-off-by: Raghu Halharvi <raghuhack78@gmail.com>
---
 drivers/cxl/core/mbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index f2addb457172..11ea145b4b1f 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -1112,10 +1112,8 @@ struct cxl_dev_state *cxl_dev_state_create(struct device *dev)
 	struct cxl_dev_state *cxlds;
 
 	cxlds = devm_kzalloc(dev, sizeof(*cxlds), GFP_KERNEL);
-	if (!cxlds) {
-		dev_err(dev, "No memory available\n");
+	if (!cxlds)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	mutex_init(&cxlds->mbox_mutex);
 	mutex_init(&cxlds->event.log_lock);
-- 
2.39.2


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

* [PATCH v3 2/2] cxl/region: Remove else after return statement
  2023-05-08  8:25 [PATCH v3 0/2] Fixing check patch styling issues Raghu Halharvi
  2023-05-08  8:25 ` [PATCH v3 1/2] cxl/mbox: Remove redundant dev_err() after failed mem alloc Raghu Halharvi
@ 2023-05-08  8:25 ` Raghu Halharvi
  2023-05-08 16:01 ` [PATCH v3 0/2] Fixing check patch styling issues Dave Jiang
  2 siblings, 0 replies; 4+ messages in thread
From: Raghu Halharvi @ 2023-05-08  8:25 UTC (permalink / raw)
  To: linux-cxl, Alison Schofield, raghuhack78, ira.weiny, bwidawsk,
	dan.j.williams, vishal.l.verma
  Cc: linux-kernel

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.

Signed-off-by: Raghu Halharvi <raghuhack78@gmail.com>
---
 drivers/cxl/core/region.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index f29028148806..a46d6ad9ef0a 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -2666,11 +2666,11 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr)
 				"Bypassing cpu_cache_invalidate_memregion() for testing!\n");
 			clear_bit(CXL_REGION_F_INCOHERENT, &cxlr->flags);
 			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);
-- 
2.39.2


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

* Re: [PATCH v3 0/2] Fixing check patch styling issues
  2023-05-08  8:25 [PATCH v3 0/2] Fixing check patch styling issues Raghu Halharvi
  2023-05-08  8:25 ` [PATCH v3 1/2] cxl/mbox: Remove redundant dev_err() after failed mem alloc Raghu Halharvi
  2023-05-08  8:25 ` [PATCH v3 2/2] cxl/region: Remove else after return statement Raghu Halharvi
@ 2023-05-08 16:01 ` Dave Jiang
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2023-05-08 16:01 UTC (permalink / raw)
  To: Raghu Halharvi, linux-cxl, Alison Schofield, ira.weiny, bwidawsk,
	dan.j.williams, vishal.l.verma
  Cc: linux-kernel



On 5/8/23 1:25 AM, Raghu Halharvi wrote:
> v3 changes:
> - Update the cover letter and commit message with full author
>    name(Fabio/Alison)
> - Correct the "typo error" in commit message(Fabio)

Hi Raghu,
Please make sure you pick up all the review tags given by reviewers in 
the previous round and also add them to the respective patches.

Using the b4 tool can do that for you.
https://people.kernel.org/monsieuricon/introducing-b4-and-patch-attestation


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

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

end of thread, other threads:[~2023-05-08 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08  8:25 [PATCH v3 0/2] Fixing check patch styling issues Raghu Halharvi
2023-05-08  8:25 ` [PATCH v3 1/2] cxl/mbox: Remove redundant dev_err() after failed mem alloc Raghu Halharvi
2023-05-08  8:25 ` [PATCH v3 2/2] cxl/region: Remove else after return statement Raghu Halharvi
2023-05-08 16:01 ` [PATCH v3 0/2] Fixing check patch styling issues Dave Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.