From d280b0651fbf3622deffbe21632f094c358a44b3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 8 Feb 2019 08:30:06 -0600 Subject: [PATCH] tools/nxstyle.c: Make sure that all files begin with a comment on line 1 (which should be the file header). --- arch/misoc/src/minerva/minerva_swint.c | 3 ++- tools/nxstyle.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/misoc/src/minerva/minerva_swint.c b/arch/misoc/src/minerva/minerva_swint.c index 76be63fc619..98cc6d3a7ce 100644 --- a/arch/misoc/src/minerva/minerva_swint.c +++ b/arch/misoc/src/minerva/minerva_swint.c @@ -77,7 +77,8 @@ static void up_registerdump(const uint32_t * regs) regs[REG_S8], regs[REG_S9], regs[REG_S10], regs[REG_S11]); #ifdef MINERVA32_SAVE_GP svcinfo("GP:%08x SP:%08x FP:%08x TP:%08x RA:%08x\n", - regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]); + regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP], + regs[REG_RA]); #else svcinfo("SP:%08x FP:%08x TP:%08x RA:%08x\n", regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]); diff --git a/tools/nxstyle.c b/tools/nxstyle.c index ece480d7ca2..7b873026d2f 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -209,6 +209,14 @@ int main(int argc, char **argv, char **envp) comment_lineno); } } + + /* Files must begin with a comment (the file header) */ + + if (lineno == 1 && (line[n] != '/' || line[n + 1] != '*')) + { + fprintf(stderr, + "Missing file header comment block at line 1\n"); + } } /* STEP 1: Find the indentation level and the start of real stuff on