mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alshehhi Family <family@alshehhi.io>
To: masahiroy@kernel.org
Cc: linux-kernel@vger.kernel.org, trivial@kernel.org,
	Husain Alshehhi <husain@alshehhi.io>
Subject: Re: [PATCH] Fix styling issues reported by checkpatch in usr/gen_init_cpio.c
Date: Mon, 06 Dec 2021 05:22:47 +0000	[thread overview]
Message-ID: <87y24y1f4p.fsf@alshehhi.io> (raw)
In-Reply-To: <20211206032840.531625-1-husain@alshehhi.io>


This is my first Patch to the linux kernel. I am not sure whether
details on how this patch is tested should be included in the commit
message or not. Nevertheless, here are the details.

Original:

    /home/husain/src/linux/scripts/checkpatch.pl --file --terse --emacs /home/husain/src/linux/usr/gen_init_cpio.c
    /home/husain/src/linux/usr/gen_init_cpio.c:42: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:76: WARNING: const array should probably be static const
    /home/husain/src/linux/usr/gen_init_cpio.c:79: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:83: WARNING: Unnecessary typecast of c90 int constant - '(long) 0' could be '0L'
    /home/husain/src/linux/usr/gen_init_cpio.c:84: WARNING: Unnecessary typecast of c90 int constant - '(long) 0' could be '0L'
    /home/husain/src/linux/usr/gen_init_cpio.c:86: WARNING: Unnecessary typecast of c90 int constant - '(long) 0' could be '0L'
    /home/husain/src/linux/usr/gen_init_cpio.c:92: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    /home/husain/src/linux/usr/gen_init_cpio.c:110: ERROR: space required after that ',' (ctx:VxV)
    /home/husain/src/linux/usr/gen_init_cpio.c:111: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:119: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    /home/husain/src/linux/usr/gen_init_cpio.c:124: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    /home/husain/src/linux/usr/gen_init_cpio.c:143: WARNING: Comparisons should place the constant on the right side of the test
    /home/husain/src/linux/usr/gen_init_cpio.c:159: ERROR: space required after that ',' (ctx:VxV)
    /home/husain/src/linux/usr/gen_init_cpio.c:160: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:173: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    /home/husain/src/linux/usr/gen_init_cpio.c:214: WARNING: Comparisons should place the constant on the right side of the test
    /home/husain/src/linux/usr/gen_init_cpio.c:253: ERROR: space required after that ',' (ctx:VxV)
    /home/husain/src/linux/usr/gen_init_cpio.c:254: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:267: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    /home/husain/src/linux/usr/gen_init_cpio.c:285: WARNING: Comparisons should place the constant on the right side of the test
    /home/husain/src/linux/usr/gen_init_cpio.c:311: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:313: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:331: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:335: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:337: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:344: ERROR: trailing statements should be on next line
    /home/husain/src/linux/usr/gen_init_cpio.c:349: ERROR: space required after that ',' (ctx:VxV)
    /home/husain/src/linux/usr/gen_init_cpio.c:350: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:382: ERROR: trailing whitespace
    /home/husain/src/linux/usr/gen_init_cpio.c:384: ERROR: trailing statements should be on next line
    /home/husain/src/linux/usr/gen_init_cpio.c:385: ERROR: trailing statements should be on next line
    /home/husain/src/linux/usr/gen_init_cpio.c:398: WARNING: sizeof expanded should be sizeof(expanded)
    /home/husain/src/linux/usr/gen_init_cpio.c:418: WARNING: Comparisons should place the constant on the right side of the test
    /home/husain/src/linux/usr/gen_init_cpio.c:430: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:452: ERROR: code indent should use tabs where possible
    /home/husain/src/linux/usr/gen_init_cpio.c:454: ERROR: trailing statements should be on next line
    /home/husain/src/linux/usr/gen_init_cpio.c:527: WARNING: space prohibited between function name and open parenthesis '('
    /home/husain/src/linux/usr/gen_init_cpio.c:577: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:595: ERROR: space prohibited after that '!' (ctx:BxW)
    /home/husain/src/linux/usr/gen_init_cpio.c:595: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:613: ERROR: space prohibited after that '!' (ctx:BxW)
    /home/husain/src/linux/usr/gen_init_cpio.c:613: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:622: WARNING: Missing a blank line after declarations
    /home/husain/src/linux/usr/gen_init_cpio.c:622: ERROR: space prohibited after that '!' (ctx:BxW)
    /home/husain/src/linux/usr/gen_init_cpio.c:623: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:631: WARNING: Comparisons should place the constant on the right side of the test
    total: 17 errors, 29 warnings, 640 lines checked

After applying the change:

    /home/husain/src/linux/scripts/checkpatch.pl --file --terse --emacs /home/husain/src/linux/usr/gen_init_cpio.c
    /home/husain/src/linux/usr/gen_init_cpio.c:76: WARNING: const array should probably be static const
    /home/husain/src/linux/usr/gen_init_cpio.c:79: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:111: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:160: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:254: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:351: WARNING: quoted string split across lines
    /home/husain/src/linux/usr/gen_init_cpio.c:581: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:599: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:617: ERROR: do not use assignment in if condition
    /home/husain/src/linux/usr/gen_init_cpio.c:628: ERROR: do not use assignment in if condition
    total: 4 errors, 6 warnings, 645 lines checked


      reply	other threads:[~2021-12-06  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06  3:28 husain
2021-12-06  5:22 ` Alshehhi Family [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y24y1f4p.fsf@alshehhi.io \
    --to=family@alshehhi.io \
    --cc=husain@alshehhi.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®