public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Arun Easi <aeasi@marvell.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Martin Petersen <martin.petersen@oracle.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	James Bottomley <jejb@linux.ibm.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org,
	GR-QLogic-Storage-Upstream@marvell.com
Subject: Re: [EXT] Re: [PATCH v2 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Date: Wed, 7 Sep 2022 16:12:55 -0700	[thread overview]
Message-ID: <c3dc1171-a625-a84a-e2be-a71e5cbbe97a@acm.org> (raw)
In-Reply-To: <32dee739-58fb-e371-2808-d40a2ee90ee0@marvell.com>

On 9/7/22 15:52, Arun Easi wrote:
> On Wed, 7 Sep 2022, 12:27pm, Bart Van Assche wrote:
>>> +static inline int
>>> +trace_array_printk(struct trace_array *tr, unsigned long ip,
>>> +		       const char *fmt, ...)
>>
>> This is not the recommended way to format a function definition.
> 
> That was mostly a Y&P from the prototype earlier in the file. Is it the
> linebreak after "int" you are referring to, or are there more?

In allmost all kernel code I have seen the function name is on the same 
line as the return type. Additionally, a common style is to align the 
second line with arguments with the opening parenthesis. From 
Documentation/process/coding-style.rst: "A very commonly used style
is to align descendants to a function open parenthesis."

>> Consider running git clang-format HEAD^.
> 
> It is a bit cryptic to me what it is complaining about (sorry
> clang-format newbie here):
> 
> # git clang-format -v HEAD^
> Running clang-format on the following files:
>      include/linux/trace.h
> YAML:671:20: error: unknown enumerated scalar
> SpaceBeforeParens: ControlStatementsExceptForEachMacros
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Error reading /root/aeasi/src/mkp.git/.clang-format: Invalid argument
> error: `clang-format -lines=29:30 -lines=51:84 include/linux/trace.h` failed
> 
> Perhaps my clang-tools are not recent enough.
> 
> # clang-format --version
> clang-format version 10.0.1 (Red Hat 10.0.1-1.module+el8.3.0+7459+90c24896)
> 
> Still digging..

git clang-format HEAD^ reformats the topmost commit according to the 
rules in the .clang-format file in the top-level directory. Please 
review any changes made by that command before amending these to the 
original commit.

I think the error messages above indicate that your version of 
clang-format is too old.

Thanks,

Bart.

      parent reply	other threads:[~2022-09-07 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 18:57 [PATCH v2 0/1] Tracing: Compile error with qla2xxx Arun Easi
2022-09-07 18:57 ` [PATCH v2 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi
2022-09-07 19:27   ` Bart Van Assche
2022-09-07 20:44     ` Steven Rostedt
2022-09-07 22:52     ` [EXT] " Arun Easi
2022-09-07 23:10       ` Arun Easi
2022-09-07 23:12       ` Bart Van Assche [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=c3dc1171-a625-a84a-e2be-a71e5cbbe97a@acm.org \
    --to=bvanassche@acm.org \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=aeasi@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=sudipm.mukherjee@gmail.com \
    /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