Re: [PATCH v3 3/5] bug: Assign values once in bug_get_file_line()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 18, 2021 at 02:33:09PM +0000, Andrew Scull wrote:
> Set bug_get_file_line()'s output parameter values directly rather than
> first nullifying them and then conditionally setting new values.
> 
> Signed-off-by: Andrew Scull <ascull@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>
> ---
>  lib/bug.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/bug.c b/lib/bug.c
> index e65398082cbc..45a0584f6541 100644
> --- a/lib/bug.c
> +++ b/lib/bug.c
> @@ -130,9 +130,6 @@ static inline struct bug_entry *module_find_bug(unsigned long bugaddr)
>  void bug_get_file_line(struct bug_entry *bug, const char **file,
>  		       unsigned int *line)
>  {
> -	*file = NULL;
> -	*line = 0;
> -
>  #ifdef CONFIG_DEBUG_BUGVERBOSE
>  #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
>  	*file = bug->file;
> @@ -140,6 +137,9 @@ void bug_get_file_line(struct bug_entry *bug, const char **file,
>  	*file = (const char *)bug + bug->file_disp;
>  #endif
>  	*line = bug->line;
> +#else
> +	*file = NULL;
> +	*line = 0;

Acked-by: Will Deacon <will@xxxxxxxxxx>

Will
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux