<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/misc/intel_menlow.c, branch v2.6.27</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>drivers/misc: elide a non-zero test on a result that is never 0</title>
<updated>2008-04-29T15:06:04+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2008-04-29T07:59:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3a8ca95e9d62980fd3b41165ec05032c63ce21da'/>
<id>3a8ca95e9d62980fd3b41165ec05032c63ce21da</id>
<content type='text'>
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//&lt;smpl&gt;
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//&lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//&lt;smpl&gt;
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//&lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intel_menlow: Storage class should be before const qualifier</title>
<updated>2008-04-21T22:28:49+00:00</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2008-04-21T22:28:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f7e8dd5071340541587e588c8fb4404dd5b0462d'/>
<id>f7e8dd5071340541587e588c8fb4404dd5b0462d</id>
<content type='text'>
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Jesper Juhl &lt;jesper.juhl@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Jesper Juhl &lt;jesper.juhl@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intel_menlo: extract return values using PTR_ERR</title>
<updated>2008-02-15T23:29:30+00:00</updated>
<author>
<name>Thomas Sujith</name>
<email>sujith.thomas@intel.com</email>
</author>
<published>2008-02-15T06:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6'/>
<id>69f6b8dd6b94ac594b6920b4530a3390fb1d3fd6</id>
<content type='text'>
Need to extract errors using PTR_ERR macro and
process accordingly.thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Need to extract errors using PTR_ERR macro and
process accordingly.thermal_cooling_device_register
returning NULL means that CONFIG_THERMAL=n and in that
case no need to create symbolic links.

Signed-off-by: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intel_menlo: introduce new platform specific driver</title>
<updated>2008-02-02T04:20:57+00:00</updated>
<author>
<name>Thomas Sujith</name>
<email>sujith.thomas@intel.com</email>
</author>
<published>2008-01-25T03:45:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cc0573b3250214034062ddf8c64359596d8af521'/>
<id>cc0573b3250214034062ddf8c64359596d8af521</id>
<content type='text'>
Intel menlow platform specific driver for thermal management extension.

Signed-off-by: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Intel menlow platform specific driver for thermal management extension.

Signed-off-by: Thomas Sujith &lt;sujith.thomas@intel.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
