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: <CAATdQgD+e6FSFfOvmuib14f1-O6w6znH5agf3gP774Qd6udCUw@mail.gmail.com>
Date:   Thu, 10 Jun 2021 11:31:25 +0800
From:   Ikjoon Jang <ikjn@...omium.org>
To:     Chunfeng Yun <chunfeng.yun@...iatek.com>
Cc:     Mathias Nyman <mathias.nyman@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-usb@...r.kernel.org,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        open list <linux-kernel@...r.kernel.org>,
        Eddie Hung <eddie.hung@...iatek.com>,
        Sergei Shtylyov <sergei.shtylyov@...il.com>
Subject: Re: [PATCH v3 1/4] usb: xhci-mtk: use bitfield instead of bool

On Fri, May 7, 2021 at 10:11 AM Chunfeng Yun <chunfeng.yun@...iatek.com> wrote:
>
> Use bitfield instead of bool in struct
>
> Refer to coding-style.rst 17) Using bool:
> "If a structure has many true/false values, consider consolidating
> them into a bitfield with 1 bit members, or using an appropriate
> fixed width type, such as u8."
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>

Reviewed-and-Tested-by: Ikjoon Jang <ikjn@...omium.org>

> ---
> v3: split @has_ippc out into anather patch suggested by Greg
> v2: add more changelog suggested by Greg
> ---
>  drivers/usb/host/xhci-mtk.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
> index cd3a37bb73e6..94a59b3d178f 100644
> --- a/drivers/usb/host/xhci-mtk.h
> +++ b/drivers/usb/host/xhci-mtk.h
> @@ -138,17 +138,17 @@ struct xhci_hcd_mtk {
>         struct mu3h_sch_bw_info *sch_array;
>         struct list_head bw_ep_chk_list;
>         struct mu3c_ippc_regs __iomem *ippc_regs;
> -       bool has_ippc;
>         int num_u2_ports;
>         int num_u3_ports;
>         int u3p_dis_msk;
>         struct regulator *vusb33;
>         struct regulator *vbus;
>         struct clk_bulk_data clks[BULK_CLKS_NUM];
> -       bool lpm_support;
> -       bool u2_lpm_disable;
> +       unsigned int has_ippc:1;
> +       unsigned int lpm_support:1;
> +       unsigned int u2_lpm_disable:1;
>         /* usb remote wakeup */
> -       bool uwk_en;
> +       unsigned int uwk_en:1;
>         struct regmap *uwk;
>         u32 uwk_reg_base;
>         u32 uwk_vers;
> --
> 2.18.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ