All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] device-dax: include bus.h in super.c
@ 2020-09-25  9:18 Jason Yan
  2020-09-25 18:24 ` Dan Williams
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Yan @ 2020-09-25  9:18 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, dave.jiang, vgoyal, linux-nvdimm
  Cc: Jason Yan, Hulk Robot

This addresses the following sparse warning:

drivers/dax/super.c:452:6: warning: symbol 'run_dax' was not declared.
Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/dax/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index edc279be3e59..2cf6faf265c5 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -16,6 +16,7 @@
 #include <linux/dax.h>
 #include <linux/fs.h>
 #include "dax-private.h"
+#include "bus.h"
 
 static dev_t dax_devt;
 DEFINE_STATIC_SRCU(dax_srcu);
-- 
2.25.4
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH] device-dax: include bus.h in super.c
  2020-09-25  9:18 [PATCH] device-dax: include bus.h in super.c Jason Yan
@ 2020-09-25 18:24 ` Dan Williams
  2020-09-28  1:15   ` Jason Yan
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Williams @ 2020-09-25 18:24 UTC (permalink / raw)
  To: Jason Yan; +Cc: linux-nvdimm, Hulk Robot

On Fri, Sep 25, 2020 at 2:17 AM Jason Yan <yanaijie@huawei.com> wrote:
>
> This addresses the following sparse warning:
>
> drivers/dax/super.c:452:6: warning: symbol 'run_dax' was not declared.
> Should it be static?

run_dax() is a core helper defined in drivers/dax/super.c that is
meant to hide the definition of 'struct dax_device' from the wider
kernel that does not need to poke into its internals. There's also no
need for drivers/dax/super.c to be given knowledge of other core
details that are contained within bus.h. So, I think this patch
provides no value and goes against the principle of least privilege
(https://en.wikipedia.org/wiki/Principle_of_least_privilege)
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH] device-dax: include bus.h in super.c
  2020-09-25 18:24 ` Dan Williams
@ 2020-09-28  1:15   ` Jason Yan
  2020-09-28  1:18     ` Jason Yan
  2020-09-28 19:16     ` Dan Williams
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Yan @ 2020-09-28  1:15 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-nvdimm, Hulk Robot

Hi Dan,

在 2020/9/26 2:24, Dan Williams 写道:
> On Fri, Sep 25, 2020 at 2:17 AM Jason Yan <yanaijie@huawei.com> wrote:
>>
>> This addresses the following sparse warning:
>>
>> drivers/dax/super.c:452:6: warning: symbol 'run_dax' was not declared.
>> Should it be static?
> 
> run_dax() is a core helper defined in drivers/dax/super.c that is
> meant to hide the definition of 'struct dax_device' from the wider
> kernel that does not need to poke into its internals. There's also no
> need for drivers/dax/super.c to be given knowledge of other core
> details that are contained within bus.h. So, I think this patch
> provides no value and goes against the principle of least privilege
> (https://en.wikipedia.org/wiki/Principle_of_least_privilege)
> 

Sorry I did not get what you mean. I only included the internal bus.h
which is drivers/dax/bus.h. Why is this affecting the other part of the
kernel?

Thanks,
Jason
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH] device-dax: include bus.h in super.c
  2020-09-28  1:15   ` Jason Yan
@ 2020-09-28  1:18     ` Jason Yan
  2020-09-28 19:16     ` Dan Williams
  1 sibling, 0 replies; 5+ messages in thread
From: Jason Yan @ 2020-09-28  1:18 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-nvdimm, Hulk Robot



在 2020/9/28 9:15, Jason Yan 写道:
> Hi Dan,
> 
> 在 2020/9/26 2:24, Dan Williams 写道:
>> On Fri, Sep 25, 2020 at 2:17 AM Jason Yan <yanaijie@huawei.com> wrote:
>>>
>>> This addresses the following sparse warning:
>>>
>>> drivers/dax/super.c:452:6: warning: symbol 'run_dax' was not declared.
>>> Should it be static?
>>
>> run_dax() is a core helper defined in drivers/dax/super.c that is
>> meant to hide the definition of 'struct dax_device' from the wider
>> kernel that does not need to poke into its internals. There's also no
>> need for drivers/dax/super.c to be given knowledge of other core
>> details that are contained within bus.h. So, I think this patch
>> provides no value and goes against the principle of least privilege
>> (https://en.wikipedia.org/wiki/Principle_of_least_privilege)
>>
> 
> Sorry I did not get what you mean. I only included the internal bus.h
> which is drivers/dax/bus.h. Why is this affecting the other part of the
> kernel?
> 

And I did that because of run_dax() is declared in the drivers/dax/bus.h 
and defined in drivers/dax/super.c. The is totally an internal change in 
dax and can fix the sparse warning.

> Thanks,
> Jason
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH] device-dax: include bus.h in super.c
  2020-09-28  1:15   ` Jason Yan
  2020-09-28  1:18     ` Jason Yan
@ 2020-09-28 19:16     ` Dan Williams
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Williams @ 2020-09-28 19:16 UTC (permalink / raw)
  To: Jason Yan; +Cc: linux-nvdimm, Hulk Robot

On Sun, Sep 27, 2020 at 6:15 PM Jason Yan <yanaijie@huawei.com> wrote:
>
> Hi Dan,
>
> 在 2020/9/26 2:24, Dan Williams 写道:
> > On Fri, Sep 25, 2020 at 2:17 AM Jason Yan <yanaijie@huawei.com> wrote:
> >>
> >> This addresses the following sparse warning:
> >>
> >> drivers/dax/super.c:452:6: warning: symbol 'run_dax' was not declared.
> >> Should it be static?
> >
> > run_dax() is a core helper defined in drivers/dax/super.c that is
> > meant to hide the definition of 'struct dax_device' from the wider
> > kernel that does not need to poke into its internals. There's also no
> > need for drivers/dax/super.c to be given knowledge of other core
> > details that are contained within bus.h. So, I think this patch
> > provides no value and goes against the principle of least privilege
> > (https://en.wikipedia.org/wiki/Principle_of_least_privilege)
> >
>
> Sorry I did not get what you mean. I only included the internal bus.h
> which is drivers/dax/bus.h. Why is this affecting the other part of the
> kernel?

It's not affecting other parts of the kernel. driver/dax/super.c does
not need the other definitions in bus.h. You could make the argument
that the definition of run_dax() needs to move somewhere else that
super.c could include, but just blindly giving super.c access to all
the other definitions in bus.h is the wrong fix in my view.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

end of thread, other threads:[~2020-09-28 19:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25  9:18 [PATCH] device-dax: include bus.h in super.c Jason Yan
2020-09-25 18:24 ` Dan Williams
2020-09-28  1:15   ` Jason Yan
2020-09-28  1:18     ` Jason Yan
2020-09-28 19:16     ` Dan Williams

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.