diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-11-28 07:57:25 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-12-14 06:28:10 -0500 |
commit | 0877eafd1618ef683e2ff2273acdeca5f1b077b9 (patch) | |
tree | 351ac3d06813fc78f2285180f2d4e93a75f5aa1a /drivers | |
parent | bc704fb58f507deea84a4c047a3a71351f0c55aa (diff) |
target/configs: remove trailing newline from udev_path and alias
This patch strips the trailing newline from backend device udev_path and
alias attributes.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_configfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index eb62371611f6..0955bb8979fb 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -1708,6 +1708,9 @@ static ssize_t target_core_store_dev_alias( | |||
1708 | read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN, | 1708 | read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN, |
1709 | "%s", page); | 1709 | "%s", page); |
1710 | 1710 | ||
1711 | if (se_dev->se_dev_alias[read_bytes - 1] == '\n') | ||
1712 | se_dev->se_dev_alias[read_bytes - 1] = '\0'; | ||
1713 | |||
1711 | pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n", | 1714 | pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n", |
1712 | config_item_name(&hba->hba_group.cg_item), | 1715 | config_item_name(&hba->hba_group.cg_item), |
1713 | config_item_name(&se_dev->se_dev_group.cg_item), | 1716 | config_item_name(&se_dev->se_dev_group.cg_item), |
@@ -1754,6 +1757,9 @@ static ssize_t target_core_store_dev_udev_path( | |||
1754 | read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN, | 1757 | read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN, |
1755 | "%s", page); | 1758 | "%s", page); |
1756 | 1759 | ||
1760 | if (se_dev->se_dev_udev_path[read_bytes - 1] == '\n') | ||
1761 | se_dev->se_dev_udev_path[read_bytes - 1] = '\0'; | ||
1762 | |||
1757 | pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n", | 1763 | pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n", |
1758 | config_item_name(&hba->hba_group.cg_item), | 1764 | config_item_name(&hba->hba_group.cg_item), |
1759 | config_item_name(&se_dev->se_dev_group.cg_item), | 1765 | config_item_name(&se_dev->se_dev_group.cg_item), |