From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 614D6ECAAD8 for ; Wed, 21 Sep 2022 08:16:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AE7710E8E0; Wed, 21 Sep 2022 08:16:11 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A6F810E8E0 for ; Wed, 21 Sep 2022 08:15:44 +0000 (UTC) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3DC36601F3F; Wed, 21 Sep 2022 09:15:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663748143; bh=XH9jh6d/hbkh2EaYj2CvFnDhMpxuJds1twj/Gjm5QII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n6N75gL0cvd7s2ORUOI6HiDaAATa+J+CFW2qnVM07rXmVNZdqrxfaQ/SnVqiAR3Ui KrKJAZfDhqFDlTbrqYYMFygw5NGnBObQ6i57rbeTQxXi33u4qix6JWe3HPs+Q+OFv0 9b2nJT8Hl0DQbgkhUEqhuMyPYbIYKK+xYr765lsey+cKk0LdXt9S6T10WcQrDDpqbE X2qV1/Mp5jC7hS3CdH/pfQMDVRPuINTxtihbx5kkezlXKdIBOWYPZdQ+pfHeDvYCdL iD+kdPhLt7PxdbkFAjdJ79s7ZhLFWQBgKv0Jk7+PP8LmRoJRr/Cne0Bx42srTYeoAk p2LYSYU+7SK8g== Message-ID: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Date: Wed, 21 Sep 2022 10:15:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield Content-Language: en-US To: Chunfeng Yun , Chun-Kuang Hu , Vinod Koul References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220920090038.15133-2-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jitao Shi , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kishon Vijay Abraham I , linux-phy@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Stanley Chu , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Il 20/09/22 11:00, Chunfeng Yun ha scritto: > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > local ones can be remove; add the new helper to make bitfield update > easier. > > Signed-off-by: Chunfeng Yun > --- > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h b/drivers/phy/mediatek/phy-mtk-io.h > index 500fcdab165d..a723d4afc9b4 100644 > --- a/drivers/phy/mediatek/phy-mtk-io.h > +++ b/drivers/phy/mediatek/phy-mtk-io.h > @@ -8,6 +8,7 @@ > #ifndef __PHY_MTK_H__ > #define __PHY_MTK_H__ > > +#include > #include > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 bits) > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val) > writel(tmp, reg); > } > > +/* field @mask should be constant and continuous */ "Field @mask shall be [...]" ^^^^^ > +static inline void mtk_phy_update_field(void __iomem *reg, u32 mask, u32 val) ...so, (void __iomem *reg, const u32 mask, u32 val) > +{ > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > +} > + > #endif From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4030BECAAD8 for ; Wed, 21 Sep 2022 08:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231365AbiIUIRE (ORCPT ); Wed, 21 Sep 2022 04:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbiIUIQh (ORCPT ); Wed, 21 Sep 2022 04:16:37 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE8D4BE2A for ; Wed, 21 Sep 2022 01:15:44 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3DC36601F3F; Wed, 21 Sep 2022 09:15:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663748143; bh=XH9jh6d/hbkh2EaYj2CvFnDhMpxuJds1twj/Gjm5QII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n6N75gL0cvd7s2ORUOI6HiDaAATa+J+CFW2qnVM07rXmVNZdqrxfaQ/SnVqiAR3Ui KrKJAZfDhqFDlTbrqYYMFygw5NGnBObQ6i57rbeTQxXi33u4qix6JWe3HPs+Q+OFv0 9b2nJT8Hl0DQbgkhUEqhuMyPYbIYKK+xYr765lsey+cKk0LdXt9S6T10WcQrDDpqbE X2qV1/Mp5jC7hS3CdH/pfQMDVRPuINTxtihbx5kkezlXKdIBOWYPZdQ+pfHeDvYCdL iD+kdPhLt7PxdbkFAjdJ79s7ZhLFWQBgKv0Jk7+PP8LmRoJRr/Cne0Bx42srTYeoAk p2LYSYU+7SK8g== Message-ID: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Date: Wed, 21 Sep 2022 10:15:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield Content-Language: en-US To: Chunfeng Yun , Chun-Kuang Hu , Vinod Koul Cc: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Jitao Shi , Stanley Chu References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220920090038.15133-2-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 20/09/22 11:00, Chunfeng Yun ha scritto: > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > local ones can be remove; add the new helper to make bitfield update > easier. > > Signed-off-by: Chunfeng Yun > --- > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h b/drivers/phy/mediatek/phy-mtk-io.h > index 500fcdab165d..a723d4afc9b4 100644 > --- a/drivers/phy/mediatek/phy-mtk-io.h > +++ b/drivers/phy/mediatek/phy-mtk-io.h > @@ -8,6 +8,7 @@ > #ifndef __PHY_MTK_H__ > #define __PHY_MTK_H__ > > +#include > #include > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 bits) > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val) > writel(tmp, reg); > } > > +/* field @mask should be constant and continuous */ "Field @mask shall be [...]" ^^^^^ > +static inline void mtk_phy_update_field(void __iomem *reg, u32 mask, u32 val) ...so, (void __iomem *reg, const u32 mask, u32 val) > +{ > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > +} > + > #endif From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F04DBECAAD8 for ; Wed, 21 Sep 2022 08:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bf/AQ2EnRovHeivHm8Q6YWLFQNoTw61g2EdgSkjkzdE=; b=KtdkjfLLjGybAF nXrEcqA9R22MUA4SmX3gn/JGgszgwszAjT7lOS/bgbtK/Mq72SzGBXh0LG+2nMTG3VxHLcuS1ilYy 3en8w8XKnwMTOH+sXyEr0gaFb/e2v3rOJ3+/aUHRArom/LmDTKHzJzcbC+j8o42b3udgXLi11xhl7 wnSoMqYNK66MOVspH3blEyZCPL2By1m4O94nSJwmhHXySHxitUhOUKbDc4nY82qTyFzTOS5rUh+Rw djVBsLSsRTWzf/WtGxRzHMv5olhjYXtFQfrVeAUktu7R2G3Zs2JM118rVJNiZXegtjL302ucFpun4 rthBavNqd7R8e8TUz2+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oav3l-009wQZ-8C; Wed, 21 Sep 2022 08:26:21 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oautU-009rJO-LI; Wed, 21 Sep 2022 08:15:46 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3DC36601F3F; Wed, 21 Sep 2022 09:15:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663748143; bh=XH9jh6d/hbkh2EaYj2CvFnDhMpxuJds1twj/Gjm5QII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n6N75gL0cvd7s2ORUOI6HiDaAATa+J+CFW2qnVM07rXmVNZdqrxfaQ/SnVqiAR3Ui KrKJAZfDhqFDlTbrqYYMFygw5NGnBObQ6i57rbeTQxXi33u4qix6JWe3HPs+Q+OFv0 9b2nJT8Hl0DQbgkhUEqhuMyPYbIYKK+xYr765lsey+cKk0LdXt9S6T10WcQrDDpqbE X2qV1/Mp5jC7hS3CdH/pfQMDVRPuINTxtihbx5kkezlXKdIBOWYPZdQ+pfHeDvYCdL iD+kdPhLt7PxdbkFAjdJ79s7ZhLFWQBgKv0Jk7+PP8LmRoJRr/Cne0Bx42srTYeoAk p2LYSYU+7SK8g== Message-ID: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Date: Wed, 21 Sep 2022 10:15:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield Content-Language: en-US To: Chunfeng Yun , Chun-Kuang Hu , Vinod Koul Cc: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Jitao Shi , Stanley Chu References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220920090038.15133-2-chunfeng.yun@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_011544_893456_81B9D38D X-CRM114-Status: GOOD ( 14.75 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Il 20/09/22 11:00, Chunfeng Yun ha scritto: > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > local ones can be remove; add the new helper to make bitfield update > easier. > > Signed-off-by: Chunfeng Yun > --- > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h b/drivers/phy/mediatek/phy-mtk-io.h > index 500fcdab165d..a723d4afc9b4 100644 > --- a/drivers/phy/mediatek/phy-mtk-io.h > +++ b/drivers/phy/mediatek/phy-mtk-io.h > @@ -8,6 +8,7 @@ > #ifndef __PHY_MTK_H__ > #define __PHY_MTK_H__ > > +#include > #include > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 bits) > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val) > writel(tmp, reg); > } > > +/* field @mask should be constant and continuous */ "Field @mask shall be [...]" ^^^^^ > +static inline void mtk_phy_update_field(void __iomem *reg, u32 mask, u32 val) ...so, (void __iomem *reg, const u32 mask, u32 val) > +{ > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > +} > + > #endif -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BE87C6FA8E for ; Wed, 21 Sep 2022 08:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L0LPDE71U4/uopUEn8jkOha8cnEb/vp6crgUkNtdqQs=; b=zpHNcBJtB1km5a GZfJ1tDZqFl9yLFVbSe4hC+uJww7KDqXvR7GshRWylQtHHZPPPCg46LBfRiwpOOyHf6YWlogwYz9p EJdqvScjpfIOqSw16fD4blFLFw8Bb1jpqmWwlai0DpC9Hd+ArgvA3L0x+5yYZQDrTe+F2E7xBCs7I epEfBMXne0k1cogAySUiy9Gf2F/Z4tY/XghfyzzBOmTInU5XZIPV9HK3N5usspF0X4lPPJp6VTG3D PnbouloHAHJ0MDysCMWR3Qi5q5Lc6h+LMds6LswqUhNs8xez0mKKCISn7N9LvwneXsRf5/EGLfcxu 9jI0EKM3vIOX/mfAcFwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oav2r-009w1t-Vm; Wed, 21 Sep 2022 08:25:26 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oautU-009rJO-LI; Wed, 21 Sep 2022 08:15:46 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3DC36601F3F; Wed, 21 Sep 2022 09:15:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663748143; bh=XH9jh6d/hbkh2EaYj2CvFnDhMpxuJds1twj/Gjm5QII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n6N75gL0cvd7s2ORUOI6HiDaAATa+J+CFW2qnVM07rXmVNZdqrxfaQ/SnVqiAR3Ui KrKJAZfDhqFDlTbrqYYMFygw5NGnBObQ6i57rbeTQxXi33u4qix6JWe3HPs+Q+OFv0 9b2nJT8Hl0DQbgkhUEqhuMyPYbIYKK+xYr765lsey+cKk0LdXt9S6T10WcQrDDpqbE X2qV1/Mp5jC7hS3CdH/pfQMDVRPuINTxtihbx5kkezlXKdIBOWYPZdQ+pfHeDvYCdL iD+kdPhLt7PxdbkFAjdJ79s7ZhLFWQBgKv0Jk7+PP8LmRoJRr/Cne0Bx42srTYeoAk p2LYSYU+7SK8g== Message-ID: <2d13b383-7d25-240b-bdbb-e53848df4d47@collabora.com> Date: Wed, 21 Sep 2022 10:15:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 01/18] phy: mediatek: add a new helper to update bitfield Content-Language: en-US To: Chunfeng Yun , Chun-Kuang Hu , Vinod Koul Cc: Philipp Zabel , Kishon Vijay Abraham I , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Jitao Shi , Stanley Chu References: <20220920090038.15133-1-chunfeng.yun@mediatek.com> <20220920090038.15133-2-chunfeng.yun@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220920090038.15133-2-chunfeng.yun@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_011544_893456_81B9D38D X-CRM114-Status: GOOD ( 14.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 20/09/22 11:00, Chunfeng Yun ha scritto: > Due to FIELD_PREP() macro can be used to prepare a bitfield value, > local ones can be remove; add the new helper to make bitfield update > easier. > > Signed-off-by: Chunfeng Yun > --- > drivers/phy/mediatek/phy-mtk-io.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/phy/mediatek/phy-mtk-io.h b/drivers/phy/mediatek/phy-mtk-io.h > index 500fcdab165d..a723d4afc9b4 100644 > --- a/drivers/phy/mediatek/phy-mtk-io.h > +++ b/drivers/phy/mediatek/phy-mtk-io.h > @@ -8,6 +8,7 @@ > #ifndef __PHY_MTK_H__ > #define __PHY_MTK_H__ > > +#include > #include > > static inline void mtk_phy_clear_bits(void __iomem *reg, u32 bits) > @@ -35,4 +36,10 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val) > writel(tmp, reg); > } > > +/* field @mask should be constant and continuous */ "Field @mask shall be [...]" ^^^^^ > +static inline void mtk_phy_update_field(void __iomem *reg, u32 mask, u32 val) ...so, (void __iomem *reg, const u32 mask, u32 val) > +{ > + mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val)); > +} > + > #endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel