Thread (22 messages) flat view 22 messages, 8 authors, 2012-05-07

Re: [PATCH] Bluetooth: Fix coding style

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-05-07 17:06:00
Also in: linux-bluetooth

Hi Dave,
quoted
Whose rules are they?
Find me an example in another major core subsystem, let's use
mm/memory.c as an example as that file gets hit by a lot of people,
that uses the multi-line conditional TAB-only crap you guys seem to
keep using.

They don't.  All the examples you'll find are of the form:

	if (a &&
	    b)

not:

	if (a &&
			b)
except of course in zap_vma_ptes(), remap_pmd_range(), remap_pud_range()
and do_wp_page().

So we also have this one:

		if ((vma->vm_flags & (VM_WRITE|VM_SHARED)) ==
				     (VM_WRITE|VM_SHARED))
			goto reuse;

And this:

	} else if (unlikely((vma->vm_flags & (VM_WRITE|VM_SHARED)) ==
					(VM_WRITE|VM_SHARED))) {

What kind of style requirement is that one?

			tmp = vma->vm_ops->page_mkwrite(vma, &vmf);
			if (unlikely(tmp &
					(VM_FAULT_ERROR | VM_FAULT_NOPAGE))) {
				ret = tmp;
				goto unwritable_page;
			}

Have you actually looked at mm/memory.c and confirmed that it is a good
example of multi-line indentation?

When it comes to function declaration and function calls, the style in
mm/memory.c is mixed. We can start counting, but for both other
multi-line cases it seems that tab-only indentation is predominant.

Regards

Marcel

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help