Skip to content

Commit

Permalink
Merge branch 'synaptics-rmi4' into next
Browse files Browse the repository at this point in the history
Merge updated Synaptics RMI4 support, including support for SMBus
controllers and flashing firmware.
  • Loading branch information
Dmitry Torokhov committed Dec 16, 2016
2 parents f43d3ec + 5191d88 commit ebfb018
Show file tree
Hide file tree
Showing 868 changed files with 48,217 additions and 52,207 deletions.
28 changes: 19 additions & 9 deletions Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,13 @@ locations and some common work such as cleanup has to be done. If there is no
cleanup needed then just return directly.

Choose label names which say what the goto does or why the goto exists. An
example of a good name could be "out_buffer:" if the goto frees "buffer". Avoid
using GW-BASIC names like "err1:" and "err2:". Also don't name them after the
goto location like "err_kmalloc_failed:"
example of a good name could be "out_free_buffer:" if the goto frees "buffer".
Avoid using GW-BASIC names like "err1:" and "err2:", as you would have to
renumber them if you ever add or remove exit paths, and they make correctness
difficult to verify anyway.

It is advised to indent labels with a single space (not tab), so that
"diff -p" does not confuse labels with functions.

The rationale for using gotos is:

Expand All @@ -425,20 +429,29 @@ The rationale for using gotos is:
goto out_buffer;
}
...
out_buffer:
out_free_buffer:
kfree(buffer);
return result;
}

A common type of bug to be aware of is "one err bugs" which look like this:

err:
err:
kfree(foo->bar);
kfree(foo);
return ret;

The bug in this code is that on some exit paths "foo" is NULL. Normally the
fix for this is to split it up into two error labels "err_bar:" and "err_foo:".
fix for this is to split it up into two error labels "err_free_bar:" and
"err_free_foo:":

err_free_bar:
kfree(foo->bar);
err_free_foo:
kfree(foo);
return ret;

Ideally you should simulate errors to test all exit paths.


Chapter 8: Commenting
Expand All @@ -461,9 +474,6 @@ When commenting the kernel API functions, please use the kernel-doc format.
See the files Documentation/kernel-documentation.rst and scripts/kernel-doc
for details.

Linux style for comments is the C89 "/* ... */" style.
Don't use C99-style "// ..." comments.

The preferred style for long (multi-line) comments is:

/*
Expand Down
6 changes: 2 additions & 4 deletions Documentation/DMA-API-HOWTO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,8 @@ to "Closing".

1) Struct scatterlist requirements.

Don't invent the architecture specific struct scatterlist; just use
<asm-generic/scatterlist.h>. You need to enable
CONFIG_NEED_SG_DMA_LENGTH if the architecture supports IOMMUs
(including software IOMMU).
You need to enable CONFIG_NEED_SG_DMA_LENGTH if the architecture
supports IOMMUs (including software IOMMU).

2) ARCH_DMA_MINALIGN

Expand Down
10 changes: 9 additions & 1 deletion Documentation/DocBook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# To add a new book the only step required is to add the book to the
# list of DOCBOOKS.

DOCBOOKS := z8530book.xml device-drivers.xml \
DOCBOOKS := z8530book.xml \
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
writing_usb_driver.xml networking.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
Expand All @@ -22,9 +22,15 @@ ifeq ($(DOCBOOKS),)
# Skip DocBook build if the user explicitly requested no DOCBOOKS.
.DEFAULT:
@echo " SKIP DocBook $@ target (DOCBOOKS=\"\" specified)."
else
ifneq ($(SPHINXDIRS),)

# Skip DocBook build if the user explicitly requested a sphinx dir
.DEFAULT:
@echo " SKIP DocBook $@ target (SPHINXDIRS specified)."
else


###
# The build process is as follows (targets):
# (xmldocs) [by docproc]
Expand Down Expand Up @@ -66,6 +72,7 @@ installmandocs: mandocs

# no-op for the DocBook toolchain
epubdocs:
latexdocs:

###
#External programs used
Expand Down Expand Up @@ -221,6 +228,7 @@ silent_gen_xml = :
echo "</programlisting>") > $@

endif # DOCBOOKS=""
endif # SPHINDIR=...

###
# Help targets as used by the top-level makefile
Expand Down
Loading

0 comments on commit ebfb018

Please sign in to comment.