You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/03/03 09:20:56 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8707: arch/imx6: Fix a compilation error with UBSan

xiaoxiang781216 commented on code in PR #8707:
URL: https://github.com/apache/nuttx/pull/8707#discussion_r1124205985


##########
arch/arm/src/imx6/imx_gpio.c:
##########
@@ -542,16 +544,25 @@ int imx_config_gpio(gpio_pinset_t pinset)
         }
         break;
 
-      case GPIO_PERIPH:
-        {
-          /* Configure the pin as a peripheral */
-
-          ret = imx_gpio_configperiph(pinset);
-        }
-        break;
-
       default:
-        ret = -EINVAL;
+
+        /* Workaround for:
+         * chip/imx_gpio.c:545:7: error: case label does not reduce to an
+         *   integer constant
+         *    545 |       case GPIO_PERIPH:
+         *        |       ^~~~
+         */
+
+        if (pinset == GPIO_PERIPH)

Review Comment:
   but GPIO_PERIPH is a const macro?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org