diff mbox series

[3/8] block: Make ioprio_best() static

Message ID 20220620161153.11741-3-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series block: Fix IO priority mess | expand

Commit Message

Jan Kara June 20, 2022, 4:11 p.m. UTC
Nobody outside of block/ioprio.c uses it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/ioprio.c         | 2 +-
 include/linux/ioprio.h | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

Comments

Damien Le Moal June 20, 2022, 11:47 p.m. UTC | #1
On 6/21/22 01:11, Jan Kara wrote:
> Nobody outside of block/ioprio.c uses it.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  block/ioprio.c         | 2 +-
>  include/linux/ioprio.h | 5 -----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/block/ioprio.c b/block/ioprio.c
> index 2a34cbca18ae..b5cf7339709b 100644
> --- a/block/ioprio.c
> +++ b/block/ioprio.c
> @@ -154,7 +154,7 @@ static int get_task_ioprio(struct task_struct *p)
>  	return ret;
>  }
>  
> -int ioprio_best(unsigned short aprio, unsigned short bprio)
> +static int ioprio_best(unsigned short aprio, unsigned short bprio)
>  {
>  	if (!ioprio_valid(aprio))
>  		aprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NORM);
> diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
> index 61ed6bb4998e..519d51fc8902 100644
> --- a/include/linux/ioprio.h
> +++ b/include/linux/ioprio.h
> @@ -66,11 +66,6 @@ static inline int get_current_ioprio(void)
>  	return prio;
>  }
>  
> -/*
> - * For inheritance, return the highest of the two given priorities
> - */

Nit: you could move this comment over the static function. But the name
makes it fairly obvious what it does :)

> -extern int ioprio_best(unsigned short aprio, unsigned short bprio);
> -
>  extern int set_task_ioprio(struct task_struct *task, int ioprio);
>  
>  #ifdef CONFIG_BLOCK
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Jan Kara June 21, 2022, 8:01 a.m. UTC | #2
On Tue 21-06-22 08:47:29, Damien Le Moal wrote:
> > diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
> > index 61ed6bb4998e..519d51fc8902 100644
> > --- a/include/linux/ioprio.h
> > +++ b/include/linux/ioprio.h
> > @@ -66,11 +66,6 @@ static inline int get_current_ioprio(void)
> >  	return prio;
> >  }
> >  
> > -/*
> > - * For inheritance, return the highest of the two given priorities
> > - */
> 
> Nit: you could move this comment over the static function. But the name
> makes it fairly obvious what it does :)

Yeah, I didn't find it particularly useful, especially after ioprio_best()
becomes pure min() so I've just deleted it...

> > -extern int ioprio_best(unsigned short aprio, unsigned short bprio);
> > -
> >  extern int set_task_ioprio(struct task_struct *task, int ioprio);
> >  
> >  #ifdef CONFIG_BLOCK
> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

Thanks for review!

								Honza
diff mbox series

Patch

diff --git a/block/ioprio.c b/block/ioprio.c
index 2a34cbca18ae..b5cf7339709b 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -154,7 +154,7 @@  static int get_task_ioprio(struct task_struct *p)
 	return ret;
 }
 
-int ioprio_best(unsigned short aprio, unsigned short bprio)
+static int ioprio_best(unsigned short aprio, unsigned short bprio)
 {
 	if (!ioprio_valid(aprio))
 		aprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NORM);
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 61ed6bb4998e..519d51fc8902 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -66,11 +66,6 @@  static inline int get_current_ioprio(void)
 	return prio;
 }
 
-/*
- * For inheritance, return the highest of the two given priorities
- */
-extern int ioprio_best(unsigned short aprio, unsigned short bprio);
-
 extern int set_task_ioprio(struct task_struct *task, int ioprio);
 
 #ifdef CONFIG_BLOCK