linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const
@ 2021-07-08 18:34 Bart Van Assche
  2021-07-28 23:05 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2021-07-08 18:34 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, Jaegeuk Kim, Bart Van Assche

This patch makes it possible to pass a const char * argument to
setup_fault_attr() without having to cast away constness.

Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/linux/fault-inject.h | 2 +-
 lib/fault-inject.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index e525f6957c49..afc649f0102b 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -42,7 +42,7 @@ struct fault_attr {
 	}
 
 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
-int setup_fault_attr(struct fault_attr *attr, char *str);
+int setup_fault_attr(struct fault_attr *attr, const char *str);
 bool should_fail(struct fault_attr *attr, ssize_t size);
 
 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index ce12621b4275..45520151b32d 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -15,7 +15,7 @@
  * setup_fault_attr() is a helper function for various __setup handlers, so it
  * returns 0 on error, because that is what __setup handlers do.
  */
-int setup_fault_attr(struct fault_attr *attr, char *str)
+int setup_fault_attr(struct fault_attr *attr, const char *str)
 {
 	unsigned long probability;
 	unsigned long interval;

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

* Re: [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const
  2021-07-08 18:34 [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const Bart Van Assche
@ 2021-07-28 23:05 ` Bart Van Assche
  2021-07-29  0:35   ` Akinobu Mita
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2021-07-28 23:05 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, Jaegeuk Kim

On 7/8/21 11:34 AM, Bart Van Assche wrote:
> This patch makes it possible to pass a const char * argument to
> setup_fault_attr() without having to cast away constness.
> 
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   include/linux/fault-inject.h | 2 +-
>   lib/fault-inject.c           | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
> index e525f6957c49..afc649f0102b 100644
> --- a/include/linux/fault-inject.h
> +++ b/include/linux/fault-inject.h
> @@ -42,7 +42,7 @@ struct fault_attr {
>   	}
>   
>   #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
> -int setup_fault_attr(struct fault_attr *attr, char *str);
> +int setup_fault_attr(struct fault_attr *attr, const char *str);
>   bool should_fail(struct fault_attr *attr, ssize_t size);
>   
>   #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
> diff --git a/lib/fault-inject.c b/lib/fault-inject.c
> index ce12621b4275..45520151b32d 100644
> --- a/lib/fault-inject.c
> +++ b/lib/fault-inject.c
> @@ -15,7 +15,7 @@
>    * setup_fault_attr() is a helper function for various __setup handlers, so it
>    * returns 0 on error, because that is what __setup handlers do.
>    */
> -int setup_fault_attr(struct fault_attr *attr, char *str)
> +int setup_fault_attr(struct fault_attr *attr, const char *str)
>   {
>   	unsigned long probability;
>   	unsigned long interval;

Hi Akinobu,

Did I send this patch to the right person?

Thanks,

Bart.

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

* Re: [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const
  2021-07-28 23:05 ` Bart Van Assche
@ 2021-07-29  0:35   ` Akinobu Mita
  0 siblings, 0 replies; 3+ messages in thread
From: Akinobu Mita @ 2021-07-29  0:35 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: LKML, Jaegeuk Kim

2021年7月29日(木) 8:05 Bart Van Assche <bvanassche@acm.org>:
>
> On 7/8/21 11:34 AM, Bart Van Assche wrote:
> > This patch makes it possible to pass a const char * argument to
> > setup_fault_attr() without having to cast away constness.
> >
> > Cc: Akinobu Mita <akinobu.mita@gmail.com>
> > Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> > ---
> >   include/linux/fault-inject.h | 2 +-
> >   lib/fault-inject.c           | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
> > index e525f6957c49..afc649f0102b 100644
> > --- a/include/linux/fault-inject.h
> > +++ b/include/linux/fault-inject.h
> > @@ -42,7 +42,7 @@ struct fault_attr {
> >       }
> >
> >   #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
> > -int setup_fault_attr(struct fault_attr *attr, char *str);
> > +int setup_fault_attr(struct fault_attr *attr, const char *str);
> >   bool should_fail(struct fault_attr *attr, ssize_t size);
> >
> >   #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
> > diff --git a/lib/fault-inject.c b/lib/fault-inject.c
> > index ce12621b4275..45520151b32d 100644
> > --- a/lib/fault-inject.c
> > +++ b/lib/fault-inject.c
> > @@ -15,7 +15,7 @@
> >    * setup_fault_attr() is a helper function for various __setup handlers, so it
> >    * returns 0 on error, because that is what __setup handlers do.
> >    */
> > -int setup_fault_attr(struct fault_attr *attr, char *str)
> > +int setup_fault_attr(struct fault_attr *attr, const char *str)
> >   {
> >       unsigned long probability;
> >       unsigned long interval;
>
> Hi Akinobu,
>
> Did I send this patch to the right person?

The fault injection patches are usually merged through the -mm tree.
Could you send this with CCing Andrew?

This patch looks good to me.

Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>

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

end of thread, other threads:[~2021-07-29  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 18:34 [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const Bart Van Assche
2021-07-28 23:05 ` Bart Van Assche
2021-07-29  0:35   ` Akinobu Mita

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