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] [day] [month] [year] [list]
Message-ID: <87ppbi3b6v.fsf@nemi.mork.no>
Date:	Wed, 17 Dec 2014 09:58:00 +0100
From:	Bjørn Mork <bjorn@...k.no>
To:	Joe Perches <joe@...ches.com>
Cc:	Josh Triplett <josh@...htriplett.org>,
	LKML <linux-kernel@...r.kernel.org>,
	kernelnewbies <kernelnewbies@...nelnewbies.org>
Subject: Re: newbies CheckpatchTips for multiline statements (Breaking function calls)

Joe Perches <joe@...ches.com> writes:

> This style is fine, and generally perferred. However, some driver
> writers prefer to have the trailing line of a function call line up with
> the starting '('. They use tabs, followed by spaces, to align the
> trailing line: 
>
>  
>         pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
>                                             GFP_KERNEL,
>                                             &pdata->urb->transfer_dma);

It might be worth noting that the network subsystem maintainer prefers
this style as well.  So most networking patches should probably use it.
The exception would be files which already use the other style.

You should also be aware of the implications of this style: You have to
modify all three lines if you change anything on the first line causing
the position of the starting '(' to change.  I.e., a patch like this is
not acceptable:

         -pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
         +p->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
                                              GFP_KERNEL,
                                              &pdata->urb->transfer_dma);


It needs to be

         -pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
         -                                    GFP_KERNEL,
         -                                    &pdata->urb->transfer_dma);
         +p->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
         +                                GFP_KERNEL,
         +                                &pdata->urb->transfer_dma);


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ