On Thu, Mar 21, 2019 at 02:26:02PM +0100, Christian Gromm wrote:
> +static ssize_t mdev_link_direction_store(struct config_item *item,
> +                                      const char *page, size_t count)
> +{
> +     struct mdev_link *mdev_link = to_mdev_link(item);
> +     char *buf = (char *)page;
> +
> +     if (strcmp(buf, "dir_rx\n") && strcmp(buf, "rx\n") &&
> +         strcmp(buf, "dir_tx\n") && strcmp(buf, "tx\n"))

Please use sysfs_streq() here instead of strcmp().  It's ugly to
require that the input has a \n char.  Same for everything.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to