[PATCH 1/4] tools: gpio: Small updates for output format

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

 



Use %2d for the GPIO line number. This should align the results
horziontally for most gpio chips.

The GPIO label uses quotes for real values. For GPIO names this is
currently missing. The patch adds the missing quote.

Signed-off-by: Markus Pargmann <mpa@xxxxxxxxxxxxxx>
---
 tools/gpio/lsgpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c
index 5535ce81f8f7..6af118cc7efb 100644
--- a/tools/gpio/lsgpio.c
+++ b/tools/gpio/lsgpio.c
@@ -111,9 +111,9 @@ int list_device(const char *device_name)
 			perror("Failed to issue LINEINFO IOCTL\n");
 			goto exit_close_error;
 		}
-		fprintf(stdout, "\tline %d:", linfo.line_offset);
+		fprintf(stdout, "\tline %2d:", linfo.line_offset);
 		if (linfo.name[0])
-			fprintf(stdout, " %s", linfo.name);
+			fprintf(stdout, " \"%s\"", linfo.name);
 		else
 			fprintf(stdout, " unnamed");
 		if (linfo.label[0])
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux