lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <061a2fea-b3da-551d-f6d2-0da30b0ac879@infradead.org>
Date:   Wed, 22 Mar 2023 08:12:23 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Khadija Kamran <kamrankhadijadj@...il.com>,
        outreachy@...ts.linux.dev
Cc:     Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>,
        Christian Gromm <christian.gromm@...rochip.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: most: fix line ending with '('

Hi--

On 3/22/23 08:01, Khadija Kamran wrote:
> Splitting function header to multiple lines because of 80 characters per
> line limit, results in ending the function call line with '('.
> This leads to CHECK reported by checkpatch.pl

Note that checkpatch is not always correct. It's a simple advisor.

> Move the function parameters right after the '(' in the function call
> line. Align the rest of the parameters to the opening parenthesis.

coding-style.rst does indeed say:

  A very commonly used style
  is to align descendants to a function open parenthesis.

That may be poorly worded. What it is trying to say is to align
the rest of the parameters to the first parameter immediately after
the open parenthesis, like this example from kernel/fork.c:

	stack = __vmalloc_node_range(THREAD_SIZE, THREAD_ALIGN,
				     VMALLOC_START, VMALLOC_END,
				     THREADINFO_GFP & ~__GFP_ACCOUNT,
				     PAGE_KERNEL,
				     0, node, __builtin_return_address(0));


And FTR, I still haven't found anything in coding-style.rst that says that
lines should not end with an open parenthesis.  Did I overlook it?

Thanks.

> Signed-off-by: Khadija Kamran <kamrankhadijadj@...il.com>
> ---
> 
> Changes in v2:
>  - Changed the description
> 
>  drivers/staging/most/dim2/hal.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/most/dim2/hal.c b/drivers/staging/most/dim2/hal.c
> index a5d40b5b138a..6abe3ab2b2cf 100644
> --- a/drivers/staging/most/dim2/hal.c
> +++ b/drivers/staging/most/dim2/hal.c
> @@ -346,9 +346,8 @@ static void dim2_clear_ctram(void)
>  		dim2_clear_ctr(ctr_addr);
>  }
> 
> -static void dim2_configure_channel(
> -	u8 ch_addr, u8 type, u8 is_tx, u16 dbr_address, u16 hw_buffer_size,
> -	u16 packet_length)
> +static void dim2_configure_channel(u8 ch_addr, u8 type, u8 is_tx, u16 dbr_address,
> +				   u16 hw_buffer_size, u16 packet_length)
>  {
>  	dim2_configure_cdt(ch_addr, dbr_address, hw_buffer_size, packet_length);
>  	dim2_configure_cat(MLB_CAT, ch_addr, type, is_tx ? 1 : 0);
> --
> 2.34.1
> 

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ