[bootlin/training-materials updates] master: serial-{get, reset}-counter: Use same spacing as in Linux (14067527)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Oct 29 10:46:39 CEST 2021


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/14067527690dee875f0cab14bb026af02fc426c9

>---------------------------------------------------------------

commit 14067527690dee875f0cab14bb026af02fc426c9
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date:   Tue Jun 22 11:48:36 2021 +0200

    serial-{get,reset}-counter: Use same spacing as in Linux
    
    Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


>---------------------------------------------------------------

14067527690dee875f0cab14bb026af02fc426c9
 .../nfsroot/root/serial/serial-get-counter.c       | 36 +++++++++++-----------
 .../nfsroot/root/serial/serial-reset-counter.c     | 35 +++++++++++----------
 2 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-get-counter.c b/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-get-counter.c
index 4b097ad2..7cf799ed 100644
--- a/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-get-counter.c
+++ b/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-get-counter.c
@@ -10,26 +10,26 @@
 
 int main(int argc, char *argv[])
 {
-    unsigned int val;
-    int fd, ret;
+	unsigned int val;
+	int fd, ret;
 
-    if (argc != 2) {
-	fprintf(stderr, "Usage: %s /dev/UART\n", argv[0]);
-	exit (1);
-    }
+	if (argc != 2) {
+		fprintf(stderr, "Usage: %s /dev/UART\n", argv[0]);
+		exit(1);
+	}
 
-    fd = open(argv[1], O_RDWR);
-    if (fd < 0) {
-	fprintf(stderr, "Unable to open %s\n", argv[1]);
-        exit (1);
-    }
+	fd = open(argv[1], O_RDWR);
+	if (fd < 0) {
+		fprintf(stderr, "Unable to open %s\n", argv[1]);
+		exit(1);
+	}
 
-    ret = ioctl(fd, SERIAL_GET_COUNTER, & val);
-    if (ret < 0) {
-        fprintf(stderr, "Unable to get counter\n");
-        exit (1);
-    }
+	ret = ioctl(fd, SERIAL_GET_COUNTER, &val);
+	if (ret < 0) {
+		fprintf(stderr, "Unable to get counter\n");
+		exit(1);
+	}
 
-    printf("Counter value: %d\n", val);
-    return 0;
+	printf("Counter value: %d\n", val);
+	return 0;
 }
diff --git a/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-reset-counter.c b/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-reset-counter.c
index 951b96e5..6e5e8267 100644
--- a/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-reset-counter.c
+++ b/lab-data/linux-kernel/modules/nfsroot/root/serial/serial-reset-counter.c
@@ -10,25 +10,26 @@
 
 int main(int argc, char *argv[])
 {
-    int fd, ret;
+	int fd, ret;
 
-    if (argc != 2) {
-	fprintf(stderr, "Usage: %s /dev/UART\n", argv[0]);
-	exit (1);
-    }
+	if (argc != 2) {
+		fprintf(stderr, "Usage: %s /dev/UART\n", argv[0]);
+		exit(1);
+	}
 
-    fd = open(argv[1], O_RDWR);
-    if (fd < 0) {
-	fprintf(stderr, "Unable to open %s\n", argv[1]);
-        exit (1);
-    }
+	fd = open(argv[1], O_RDWR);
+	if (fd < 0) {
+		fprintf(stderr, "Unable to open %s\n", argv[1]);
+		exit(1);
+	}
 
-    ret = ioctl(fd, SERIAL_RESET_COUNTER);
-    if (ret < 0) {
-        fprintf(stderr, "Unable to reset counter\n");
-        exit (1);
-    }
+	ret = ioctl(fd, SERIAL_RESET_COUNTER);
+	if (ret < 0) {
+		fprintf(stderr, "Unable to reset counter\n");
+		exit(1);
+	}
 
-    printf("Counter reset\n");
-    return 0;
+
+	printf("Counter reset\n");
+	return 0;
 }




More information about the training-materials-updates mailing list