gustavonihei commented on a change in pull request #4774: URL: https://github.com/apache/incubator-nuttx/pull/4774#discussion_r746972143
########## File path: drivers/ioexpander/gpio.c ########## @@ -578,47 +568,16 @@ int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor) * Name: gpio_pin_unregister * * Description: - * Unregister GPIO pin device driver. - * - * - Input pin types will be registered at /dev/gpinN - * - Output pin types will be registered at /dev/gpoutN - * - Interrupt pin types will be registered at /dev/gpintN - * - * Where N is the provided minor number in the range of 0-99. - * + * Unregister GPIO pin device driver at /dev/gpioN, where N is the provided + * minor number in the range of 0-99. * ****************************************************************************/ void gpio_pin_unregister(FAR struct gpio_dev_s *dev, int minor) { - FAR const char *fmt; char devname[16]; Review comment: ```suggestion char devname[32]; ``` If we consider the max value for int minor, it requires more than 16 characters. ########## File path: drivers/ioexpander/gpio.c ########## @@ -562,13 +554,11 @@ int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor) { return ret; } - - fmt = "/dev/gpint%u"; } break; } - snprintf(devname, 16, fmt, (unsigned int)minor); + snprintf(devname, 16, "/dev/gpio%u", (unsigned int) minor); Review comment: ```suggestion snprintf(devname, sizeof(devname), "/dev/gpio%u", (unsigned int) minor); ``` Using `sizeof` to make it less error prone to future changes. -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org