diff mbox series

phy: freescale: imx8qm-hsio: Include bitfield.h for FIELD_PREP

Message ID 20240620-phy-fsl-imx8qm-hsio-add-bitfield-include-v1-1-5c7c09ed87e6@kernel.org
State Accepted
Commit aefa036be8c216c8b344d34c9f35ff907b9c315a
Headers show
Series phy: freescale: imx8qm-hsio: Include bitfield.h for FIELD_PREP | expand

Commit Message

Nathan Chancellor June 20, 2024, 3:21 p.m. UTC
In various configurations/architectures, bitfield.h may not be
transitively included, which results in a compiler error because
FIELD_PREP is an unexpanded macro:

  drivers/phy/freescale/phy-fsl-imx8qm-hsio.c:459:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    459 |         val = FIELD_PREP(HSIO_MODE_MASK, val);
        |               ^
  1 error generated.

Include bitfield.h explicitly to fix the build.

Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 82c56b6dd24fcdf811f2b47b72e5585c8a79b685
change-id: 20240620-phy-fsl-imx8qm-hsio-add-bitfield-include-ab94e9b1bb1b

Best regards,

Comments

Frank Li June 20, 2024, 3:52 p.m. UTC | #1
On Thu, Jun 20, 2024 at 08:21:15AM -0700, Nathan Chancellor wrote:
> In various configurations/architectures, bitfield.h may not be
> transitively included, which results in a compiler error because
> FIELD_PREP is an unexpanded macro:
> 
>   drivers/phy/freescale/phy-fsl-imx8qm-hsio.c:459:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>     459 |         val = FIELD_PREP(HSIO_MODE_MASK, val);
>         |               ^
>   1 error generated.
> 
> Include bitfield.h explicitly to fix the build.
> 
> Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> index dcf9c45ff5d6..5dca93cd325c 100644
> --- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> +++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> @@ -3,6 +3,7 @@
>   * Copyright 2024 NXP
>   */
>  
> +#include <linux/bitfield.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/io.h>
> 
> ---
> base-commit: 82c56b6dd24fcdf811f2b47b72e5585c8a79b685
> change-id: 20240620-phy-fsl-imx8qm-hsio-add-bitfield-include-ab94e9b1bb1b
> 
> Best regards,
> -- 
> Nathan Chancellor <nathan@kernel.org>
>
Vinod Koul June 20, 2024, 4:38 p.m. UTC | #2
On Thu, 20 Jun 2024 08:21:15 -0700, Nathan Chancellor wrote:
> In various configurations/architectures, bitfield.h may not be
> transitively included, which results in a compiler error because
> FIELD_PREP is an unexpanded macro:
> 
>   drivers/phy/freescale/phy-fsl-imx8qm-hsio.c:459:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>     459 |         val = FIELD_PREP(HSIO_MODE_MASK, val);
>         |               ^
>   1 error generated.
> 
> [...]

Applied, thanks!

[1/1] phy: freescale: imx8qm-hsio: Include bitfield.h for FIELD_PREP
      commit: aefa036be8c216c8b344d34c9f35ff907b9c315a

Best regards,
diff mbox series

Patch

diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
index dcf9c45ff5d6..5dca93cd325c 100644
--- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
+++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
@@ -3,6 +3,7 @@ 
  * Copyright 2024 NXP
  */
 
+#include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/io.h>