On Tue, Jul 04, 2023 at 04:07:43PM +0100, Dan Scally wrote: > On 30/06/2023 13:06, Hans de Goede wrote: ... > > + strscpy(work->board_info.type, fwnode_get_name(vcm_fwnode), > > + I2C_NAME_SIZE); > > + /* Strip "-<link>" postfix */ > > + sep = strchrnul(work->board_info.type, '-'); > > + *sep = 0; > > I think strreplace(work->board_info.type, '-', '\0') here would be cleaner, > and either way probably we need #include <linux/string.h> for the str* funcs > here What we need is something like strcut(str, '<$CHAR>'). But related to the above code we can (besides using sizeof() instead of I2C_NAME_SIZE): snprintf(work->board_info.type, sizeof(work->board_info.type), "%pfwP", vcm_fwnode); -- With Best Regards, Andy Shevchenko