lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b1f92ed707eb469aa626fe0be03eaf96@meizu.com>
Date:   Mon, 28 Mar 2022 03:02:02 +0000
From:   白浩文 <baihaowen@...zu.com>
To:     Dave Hansen <dave.hansen@...el.com>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "luto@...nel.org" <luto@...nel.org>,
        "peterz@...radead.org" <peterz@...radead.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 答复: [PATCH] x86/mm: Directly return instead of using local ret variable

Thank you for pointing my mistaken.
________________________________________
发件人: Dave Hansen <dave.hansen@...el.com>
发送时间: 2022年3月28日 10:49:19
收件人: 白浩文; dave.hansen@...ux.intel.com; luto@...nel.org; peterz@...radead.org
抄送: linux-kernel@...r.kernel.org
主题: Re: [PATCH] x86/mm: Directly return instead of using local ret variable

On 3/27/22 19:12, Haowen Bai wrote:
>
> diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
> index 3f83e31..4eff3ee 100644
> --- a/arch/x86/mm/pf_in.c
> +++ b/arch/x86/mm/pf_in.c
> @@ -130,7 +130,6 @@ enum reason_type get_ins_type(unsigned long ins_addr)
>       unsigned char *p;
>       struct prefix_bits prf;
>       int i;
> -     enum reason_type rv = OTHERS;
>
>       p = (unsigned char *)ins_addr;
>       p += skip_prefix(p, &prf);
> @@ -141,7 +140,7 @@ enum reason_type get_ins_type(unsigned long ins_addr)
>       CHECK_OP_TYPE(opcode, imm_wop, IMM_WRITE);
>
>  exit:
> -     return rv;
> +     return OTHERS;
>  }
>  #undef CHECK_OP_TYPE
>

Does this even compile?  Take a look at this macro:

> #define CHECK_OP_TYPE(opcode, array, type) \
>         for (i = 0; i < ARRAY_SIZE(array); i++) { \
>                 if (array[i] == opcode) { \
>                         rv = type; \
>                         goto exit; \
>                 } \

It uses 'rv'.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ