[PATCH 01/14] staging: most: add new file configfs.c
Dan Carpenter
dan.carpenter at oracle.com
Fri Mar 22 10:46:52 UTC 2019
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
More information about the devel
mailing list