Re: [PATCH 01/14] staging: most: add new file configfs.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux