On 02/03/2018 09:22, Julia Suvorova wrote:
> Signed-off-by: Julia Suvorova <jus...@mail.ru>
> ---
>  scripts/checkpatch.pl | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 1b4b812..6c4fb42 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2584,6 +2584,11 @@ sub process {
>                       ERROR("__func__ should be used instead of gcc specific 
> __FUNCTION__\n"  . $herecurr);
>               }
>  
> +# recommend g_path_get_* over basename(3) and dirname(3)
> +             if ($line =~ /\b(basename|dirname)\s*\(/) {
> +                     WARN("consider using g_path_get_$1 in preference to 
> $1(3)\n" . $herecurr);
> +             }
> +
>  # recommend qemu_strto* over strto* for numeric conversions
>               if ($line =~ /\b(strto[^kd].*?)\s*\(/) {
>                       ERROR("consider using qemu_$1 in preference to $1\n" . 
> $herecurr);
> 

Hi Julia, the patch is fine, but given Alex's objections let's warn only
if you are doing g_strdup(basename(...)) or g_strdup(dirname(...)).

(No other action is needed on your other patch).

Thanks!

Paolo

Reply via email to