Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1088945pxy; Wed, 5 May 2021 23:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx878ZqvjZca5/K7M3bwI7YalgwhCknOedTO7SjNzqKMrY+KbBPXWPW3Qh93eg7kLxyiUju X-Received: by 2002:a65:4986:: with SMTP id r6mr2814750pgs.392.1620282728674; Wed, 05 May 2021 23:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620282728; cv=none; d=google.com; s=arc-20160816; b=rO//0abPhh5/EIl6aTwpiRbgFGuLt8NSAyBfm1JXsM7+B/+vYqdTwAOXP9l2tDDQdc gzfOdDgSzKe14nDHDHLhxFm1jGc2Ex+zv+wO2tJUxMWkSxmq113IhiS+ItbGhgHQy8YW her2TeEgsVwQ8gmsJq+CrDBHqgkyzZwhaE+evQqQjAFNfYwfHXz6j78aoHSlBsiEnvxZ oN32URbCZb8zT80NIQNUoZleUy42+uGm4cOChSp6WNUVuUmn4yLY9oAy86WCZEUV1zGr rTAg73FxRv7/G5nNe0tZ8WwNWA42xZW3NBSOvH/V+/2+E/+QguJ0156nLbDHG3a3hyIW vrpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=540lT/BPg43XEzcE9p2MIxVF5mdjF2S9y98FJnmhzZg=; b=ZJrMETs6bPOigmGT1m9QWEvAFrZjUmBrzI/WLwu308cu6Huv3VUkoWrIqkQInjBoc9 OPBb+5VGfwOX86Kwepm+43zVa93S6B0oNRrVT7Vn40V8Q1EYBmcM+IOda1deKS4T24Fq +DocYuRPptCCDqwLPESgxBQ7xkeC0OTX2T1Iv4vt3CR94f8LXSr7926YbQlb6ITTDtis Hz9F0Q+jbk2r8eC/emFeN1IveJLHmKyptYldbe7Lkr65g3NOZ5CXXLvesKHwa4uIxSMi jCwLxuB3vr1oB80TGIVVuaCgH9uGI6jk8QnARUwIIzMSPb6/4LrFZDzjaSlzzurolKfk xl2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si1798602pjp.156.2021.05.05.23.31.54; Wed, 05 May 2021 23:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232151AbhEFGcU (ORCPT + 99 others); Thu, 6 May 2021 02:32:20 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:46580 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229622AbhEFGcT (ORCPT ); Thu, 6 May 2021 02:32:19 -0400 X-UUID: 0822898dcc654ef2968c1a1964e460d4-20210506 X-UUID: 0822898dcc654ef2968c1a1964e460d4-20210506 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 844788870; Thu, 06 May 2021 14:31:19 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 May 2021 14:31:17 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 6 May 2021 14:31:17 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , Ikjoon Jang , Eddie Hung Subject: [PATCH v2 1/3] usb: xhci-mtk: use bitfield instead of bool Date: Thu, 6 May 2021 14:31:14 +0800 Message-ID: <20210506063116.41757-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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." Due to @has_ippc's default vaule is 0, no need set it again if fail to get ippc base address Signed-off-by: Chunfeng Yun --- v2: add more changelog suggested by Greg --- drivers/usb/host/xhci-mtk.c | 2 -- drivers/usb/host/xhci-mtk.h | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index b2058b3bc834..2548976bcf05 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -495,8 +495,6 @@ static int xhci_mtk_probe(struct platform_device *pdev) goto put_usb2_hcd; } mtk->has_ippc = true; - } else { - mtk->has_ippc = false; } device_init_wakeup(dev, true); 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