* [STYLE v1 1/3] cxl/mbox: remove redundant debug msg
[not found] <20230419111443.231151-1-raghuhack78@gmail.com>
@ 2023-04-19 11:14 ` Raghu H
2023-04-27 19:05 ` Ira Weiny
2023-04-27 19:32 ` Alison Schofield
2023-04-19 11:14 ` [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors Raghu H
2023-04-19 11:14 ` [STYLE v1 3/3] cxl/core/region:Remove else after return statement Raghu H
2 siblings, 2 replies; 9+ messages in thread
From: Raghu H @ 2023-04-19 11:14 UTC (permalink / raw)
To: linux-cxl, Alison Schofield, raghuhack78, Vishal Verma,
Ira Weiny, Ben Widawsky, Dan Williams
Cc: linux-kernel
A return of errno should be good enough if the memory allocation fails,
the debug message here is redundatant as per the coding style, removing it.
Signed-off-by: Raghu H <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 [flat|nested] 9+ messages in thread
* [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors
[not found] <20230419111443.231151-1-raghuhack78@gmail.com>
2023-04-19 11:14 ` [STYLE v1 1/3] cxl/mbox: remove redundant debug msg Raghu H
@ 2023-04-19 11:14 ` Raghu H
2023-04-27 19:06 ` Ira Weiny
2023-04-19 11:14 ` [STYLE v1 3/3] cxl/core/region:Remove else after return statement Raghu H
2 siblings, 1 reply; 9+ messages in thread
From: Raghu H @ 2023-04-19 11:14 UTC (permalink / raw)
To: linux-cxl, Alison Schofield, raghuhack78, Vishal Verma,
Ira Weiny, Ben Widawsky, Dan Williams
Cc: linux-kernel
Styling errors due to linux of unwanted spaces in the definition,
modified the definition to use tab to fix the styling issue.
Signed-off-by: Raghu H <raghuhack78@gmail.com>
---
drivers/cxl/core/port.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 8ee6b6e2e2a4..7c3aaed180ca 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -95,15 +95,15 @@ static ssize_t size_show(struct device *dev, struct device_attribute *attr,
}
static DEVICE_ATTR_RO(size);
-#define CXL_DECODER_FLAG_ATTR(name, flag) \
-static ssize_t name##_show(struct device *dev, \
- struct device_attribute *attr, char *buf) \
-{ \
- struct cxl_decoder *cxld = to_cxl_decoder(dev); \
- \
- return sysfs_emit(buf, "%s\n", \
- (cxld->flags & (flag)) ? "1" : "0"); \
-} \
+#define CXL_DECODER_FLAG_ATTR(name, flag) \
+static ssize_t name##_show(struct device *dev, \
+ struct device_attribute *attr, char *buf) \
+{ \
+ struct cxl_decoder *cxld = to_cxl_decoder(dev); \
+ \
+ return sysfs_emit(buf, "%s\n", \
+ (cxld->flags & (flag)) ? "1" : "0"); \
+} \
static DEVICE_ATTR_RO(name)
CXL_DECODER_FLAG_ATTR(cap_pmem, CXL_DECODER_F_PMEM);
--
2.39.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [STYLE v1 3/3] cxl/core/region:Remove else after return statement
[not found] <20230419111443.231151-1-raghuhack78@gmail.com>
2023-04-19 11:14 ` [STYLE v1 1/3] cxl/mbox: remove redundant debug msg Raghu H
2023-04-19 11:14 ` [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors Raghu H
@ 2023-04-19 11:14 ` Raghu H
2023-04-27 19:13 ` Ira Weiny
2 siblings, 1 reply; 9+ messages in thread
From: Raghu H @ 2023-04-19 11:14 UTC (permalink / raw)
To: linux-cxl, Alison Schofield, raghuhack78, Vishal Verma,
Ira Weiny, Ben Widawsky, Dan Williams
Cc: linux-kernel
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 H <raghuhack78@gmail.com>
---
drivers/cxl/core/region.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index f29028148806..1d695107b4a7 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -2666,11 +2666,10 @@ 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 [flat|nested] 9+ messages in thread
* Re: [STYLE v1 1/3] cxl/mbox: remove redundant debug msg
2023-04-19 11:14 ` [STYLE v1 1/3] cxl/mbox: remove redundant debug msg Raghu H
@ 2023-04-27 19:05 ` Ira Weiny
2023-04-27 19:32 ` Alison Schofield
1 sibling, 0 replies; 9+ messages in thread
From: Ira Weiny @ 2023-04-27 19:05 UTC (permalink / raw)
To: Raghu H, linux-cxl, Alison Schofield, Vishal Verma, Ira Weiny,
Ben Widawsky, Dan Williams
Cc: linux-kernel
Raghu H wrote:
> A return of errno should be good enough if the memory allocation fails,
> the debug message here is redundatant as per the coding style, removing it.
>
> Signed-off-by: Raghu H <raghuhack78@gmail.com>
I'm not seeing a lot of value in this error message either. There are
plenty of other places probe can fail without any errors at all.
I guess:
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors
2023-04-19 11:14 ` [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors Raghu H
@ 2023-04-27 19:06 ` Ira Weiny
0 siblings, 0 replies; 9+ messages in thread
From: Ira Weiny @ 2023-04-27 19:06 UTC (permalink / raw)
To: Raghu H, linux-cxl, Alison Schofield, Vishal Verma, Ira Weiny,
Ben Widawsky, Dan Williams
Cc: linux-kernel
Raghu H wrote:
> Styling errors due to linux of unwanted spaces in the definition,
> modified the definition to use tab to fix the styling issue.
>
> Signed-off-by: Raghu H <raghuhack78@gmail.com>
NAK
This is unnecessary churn. The formatting of the file is fine and very
readable.
Ira
> ---
> drivers/cxl/core/port.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index 8ee6b6e2e2a4..7c3aaed180ca 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -95,15 +95,15 @@ static ssize_t size_show(struct device *dev, struct device_attribute *attr,
> }
> static DEVICE_ATTR_RO(size);
>
> -#define CXL_DECODER_FLAG_ATTR(name, flag) \
> -static ssize_t name##_show(struct device *dev, \
> - struct device_attribute *attr, char *buf) \
> -{ \
> - struct cxl_decoder *cxld = to_cxl_decoder(dev); \
> - \
> - return sysfs_emit(buf, "%s\n", \
> - (cxld->flags & (flag)) ? "1" : "0"); \
> -} \
> +#define CXL_DECODER_FLAG_ATTR(name, flag) \
> +static ssize_t name##_show(struct device *dev, \
> + struct device_attribute *attr, char *buf) \
> +{ \
> + struct cxl_decoder *cxld = to_cxl_decoder(dev); \
> + \
> + return sysfs_emit(buf, "%s\n", \
> + (cxld->flags & (flag)) ? "1" : "0"); \
> +} \
> static DEVICE_ATTR_RO(name)
>
> CXL_DECODER_FLAG_ATTR(cap_pmem, CXL_DECODER_F_PMEM);
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [STYLE v1 3/3] cxl/core/region:Remove else after return statement
2023-04-19 11:14 ` [STYLE v1 3/3] cxl/core/region:Remove else after return statement Raghu H
@ 2023-04-27 19:13 ` Ira Weiny
2023-04-27 19:49 ` Alison Schofield
0 siblings, 1 reply; 9+ messages in thread
From: Ira Weiny @ 2023-04-27 19:13 UTC (permalink / raw)
To: Raghu H, linux-cxl, Alison Schofield, Vishal Verma, Ira Weiny,
Ben Widawsky, Dan Williams
Cc: linux-kernel
Raghu H wrote:
> 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 H <raghuhack78@gmail.com>
Ok, per my eyes I would have liked an extra space before the dev_err()
but...
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> ---
> drivers/cxl/core/region.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index f29028148806..1d695107b4a7 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2666,11 +2666,10 @@ 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 [flat|nested] 9+ messages in thread
* Re: [STYLE v1 1/3] cxl/mbox: remove redundant debug msg
2023-04-19 11:14 ` [STYLE v1 1/3] cxl/mbox: remove redundant debug msg Raghu H
2023-04-27 19:05 ` Ira Weiny
@ 2023-04-27 19:32 ` Alison Schofield
1 sibling, 0 replies; 9+ messages in thread
From: Alison Schofield @ 2023-04-27 19:32 UTC (permalink / raw)
To: Raghu H
Cc: linux-cxl, Vishal Verma, Ira Weiny, Ben Widawsky, Dan Williams,
linux-kernel
On Wed, Apr 19, 2023 at 11:14:41AM +0000, Raghu H wrote:
> A return of errno should be good enough if the memory allocation fails,
> the debug message here is redundatant as per the coding style, removing it.
Hi Raghu,
Thanks for the patch. The code change looks fine.
Here is some feedback on the commit msg and log:
This removes a dev_err() not a debug message, dev_dbg()
Commit msg can be clearer like:
cxl/mbox: Remove redundant dev_err() after failed mem alloc
Please include PATCH in the subject line.
See Documentation/process/submitting-patches.rst or peruse other
patches on the mailing list and subsystem to see examples.
Alison
>
> Signed-off-by: Raghu H <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 [flat|nested] 9+ messages in thread
* Re: [STYLE v1 3/3] cxl/core/region:Remove else after return statement
2023-04-27 19:13 ` Ira Weiny
@ 2023-04-27 19:49 ` Alison Schofield
2023-04-28 0:00 ` RAGHU H
0 siblings, 1 reply; 9+ messages in thread
From: Alison Schofield @ 2023-04-27 19:49 UTC (permalink / raw)
To: Ira Weiny
Cc: Raghu H, linux-cxl, Vishal Verma, Ben Widawsky, Dan Williams,
linux-kernel
On Thu, Apr 27, 2023 at 12:13:14PM -0700, Ira Weiny wrote:
> Raghu H wrote:
> > 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 H <raghuhack78@gmail.com>
>
> Ok, per my eyes I would have liked an extra space before the dev_err()
> but...
Well, I asked Rahgu to give us a v2 with mostly patch formatting fixups,
so let's get that extra space too :)
>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>
> > ---
> > drivers/cxl/core/region.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> > index f29028148806..1d695107b4a7 100644
> > --- a/drivers/cxl/core/region.c
> > +++ b/drivers/cxl/core/region.c
> > @@ -2666,11 +2666,10 @@ 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 [flat|nested] 9+ messages in thread
* Re: [STYLE v1 3/3] cxl/core/region:Remove else after return statement
2023-04-27 19:49 ` Alison Schofield
@ 2023-04-28 0:00 ` RAGHU H
0 siblings, 0 replies; 9+ messages in thread
From: RAGHU H @ 2023-04-28 0:00 UTC (permalink / raw)
To: Alison Schofield
Cc: Ira Weiny, linux-cxl, Vishal Verma, Ben Widawsky, Dan Williams,
linux-kernel
Thanks Alison & Ira for comments
I missed your messages due to personal reasons.
Will clean and follow it up with v2 very soon.
On Fri, Apr 28, 2023 at 1:19 AM Alison Schofield
<alison.schofield@intel.com> wrote:
>
> On Thu, Apr 27, 2023 at 12:13:14PM -0700, Ira Weiny wrote:
> > Raghu H wrote:
> > > 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 H <raghuhack78@gmail.com>
> >
> > Ok, per my eyes I would have liked an extra space before the dev_err()
> > but...
>
> Well, I asked Rahgu to give us a v2 with mostly patch formatting fixups,
> so let's get that extra space too :)
>
> >
> > Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> >
> > > ---
> > > drivers/cxl/core/region.c | 7 +++----
> > > 1 file changed, 3 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> > > index f29028148806..1d695107b4a7 100644
> > > --- a/drivers/cxl/core/region.c
> > > +++ b/drivers/cxl/core/region.c
> > > @@ -2666,11 +2666,10 @@ 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 [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-04-28 0:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230419111443.231151-1-raghuhack78@gmail.com>
2023-04-19 11:14 ` [STYLE v1 1/3] cxl/mbox: remove redundant debug msg Raghu H
2023-04-27 19:05 ` Ira Weiny
2023-04-27 19:32 ` Alison Schofield
2023-04-19 11:14 ` [STYLE v1 2/3] cxl/core/port: Use tabs to fix styling errors Raghu H
2023-04-27 19:06 ` Ira Weiny
2023-04-19 11:14 ` [STYLE v1 3/3] cxl/core/region:Remove else after return statement Raghu H
2023-04-27 19:13 ` Ira Weiny
2023-04-27 19:49 ` Alison Schofield
2023-04-28 0:00 ` RAGHU H
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®