Skip to contentSkip to conversation

kallsyms: add required space for unified style

PATCH In review Deming Wang 2 participants 2 messages Oct 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kallsyms: add required space for unified style

add required space before and after operators.

---
 scripts/kallsyms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/kallsyms.c +3 -3
index 03fa07ad45d9..1df9944030e2 100644
@@ -213,7 +213,7 @@ static void check_symbol_range(const char *sym, unsigned long long addr,
 
 static struct sym_entry *read_symbol(FILE *in)
 {
-	char name[KSYM_NAME_LEN_BUFFER+1], type;
+	char name[KSYM_NAME_LEN_BUFFER + 1], type;
 	unsigned long long addr;
 	unsigned int len;
 	struct sym_entry *sym;
@@ -388,7 +388,7 @@ static int expand_symbol(const unsigned char *data, int len, char *result)
 		c = *data;
 		/* if the table holds a single char that is the same as the one
 		 * we are looking for, then end the search */
-		if (best_table[c][0]==c && best_table_len[c]==1) {
+		if (best_table[c][0] == c && best_table_len[c] == 1) {
 			*result++ = c;
 			total++;
 		} else {
@@ -641,7 +641,7 @@ static int find_best_token(void)
 {
 	int i, best, bestprofit;
 
-	bestprofit=-10000;
+	bestprofit = -10000;
 	best = 0;
 
 	for (i = 0; i < 0x10000; i++) {
Signature · 1 line
2.27.0
#1 lore raw
Quoted 2 lines · Deming Wang

add required space before and after operators.

There are some other instances, like i+1, *result=0;, total=0... that could be fixed too.

One way to find them is clang-format -i + git add --patch :)

That will also show you other different formatting issues, like a couple if (...) ...; in a single line, if( without space, etc.

Cheers,
Miguel