Skip to contentSkip to conversation

spi: use sysfs_emit() in bcm63xx-hsspi and bcmbca-hsspi

PATCH In review Aayush Kumar 2 participants 4 messages Oct 9 – Oct 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover spi: use sysfs_emit() in bcm63xx-hsspi and bcmbca-hsspi

Convert the sysfs show() functions to use sysfs_emit() instead of sprintf().

Aayush Kumar (2):
spi: bcm63xx-hsspi: Use sysfs_emit() instead of sprintf()
spi: bcmbca-hsspi: Use sysfs_emit() instead of sprintf()

 drivers/spi/spi-bcm63xx-hsspi.c | 4 ++--
 drivers/spi/spi-bcmbca-hsspi.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.56.0
#1 lore raw

PATCH 1/2 spi: bcm63xx-hsspi: Use sysfs_emit() instead of sprintf()

show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.

---
 drivers/spi/spi-bcm63xx-hsspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-bcm63xx-hsspi.c +2 -2
index 25f169a2a..824e36bed 100644
@@ -152,7 +152,7 @@ static ssize_t wait_mode_show(struct device *dev, struct device_attribute *attr,
 	struct spi_controller *ctrl = dev_get_drvdata(dev);
 	struct bcm63xx_hsspi *bs = spi_controller_get_devdata(ctrl);
 
-	return sprintf(buf, "%d\n", bs->wait_mode);
+	return sysfs_emit(buf, "%d\n", bs->wait_mode);
 }
 
 static ssize_t wait_mode_store(struct device *dev, struct device_attribute *attr,
@@ -188,7 +188,7 @@ static ssize_t xfer_mode_show(struct device *dev, struct device_attribute *attr,
 	struct spi_controller *ctrl = dev_get_drvdata(dev);
 	struct bcm63xx_hsspi *bs = spi_controller_get_devdata(ctrl);
 
-	return sprintf(buf, "%d\n", bs->xfer_mode);
+	return sysfs_emit(buf, "%d\n", bs->xfer_mode);
 }
 
 static ssize_t xfer_mode_store(struct device *dev, struct device_attribute *attr,
Signature · 1 line
2.56.0
#2 lore raw

PATCH 2/2 spi: bcmbca-hsspi: Use sysfs_emit() instead of sprintf()

In reply to Aayush Kumar

show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.

---
 drivers/spi/spi-bcmbca-hsspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-bcmbca-hsspi.c +1 -1
index 5dc9e0f21..8c0147588 100644
@@ -129,7 +129,7 @@ static ssize_t wait_mode_show(struct device *dev, struct device_attribute *attr,
 	struct spi_controller *ctrl = dev_get_drvdata(dev);
 	struct bcmbca_hsspi *bs = spi_controller_get_devdata(ctrl);
 
-	return sprintf(buf, "%d\n", bs->wait_mode);
+	return sysfs_emit(buf, "%d\n", bs->wait_mode);
 }
 
 static ssize_t wait_mode_store(struct device *dev, struct device_attribute *attr,
Signature · 1 line
2.56.0
maintainer
#3 lore raw
In reply to Aayush Kumar
Quoted 10 lines · Aayush Kumar

spi: use sysfs_emit() in bcm63xx-hsspi and bcmbca-hsspi

Convert the sysfs show() functions to use sysfs_emit() instead of sprintf().

Aayush Kumar (2):
spi: bcm63xx-hsspi: Use sysfs_emit() instead of sprintf()
spi: bcmbca-hsspi: Use sysfs_emit() instead of sprintf()

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.4

Thanks!

[1/2] spi: bcm63xx-hsspi: Use sysfs_emit() instead of sprintf()

      https://git.kernel.org/broonie/misc/c/516d487c6037
[2/2] spi: bcmbca-hsspi: Use sysfs_emit() instead of sprintf()
      https://git.kernel.org/broonie/misc/c/2bc876264259

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark