<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">></span>Question for lustre-devel...  Isn't this the opposite of the style that we're currently trying to use in Gerrit submissions?  Is my memory faulty?<o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You are correct. Is this change really necessary? I will respone shortly.<o:p></o:p></span></p>
<p class="MsoNormal"><br>
<br>
-------- Original Message -------- <o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="right" style="text-align:right"><b>Subject: <o:p></o:p></b></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal">[HPDD-discuss] [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure<o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="right" style="text-align:right"><b>Date: <o:p></o:p></b></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal">Sat, 20 Jun 2015 18:58:59 +0200<o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="right" style="text-align:right"><b>From: <o:p></o:p></b></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal">Julia Lawall <a href="mailto:Julia.Lawall@lip6.fr"><Julia.Lawall@lip6.fr></a><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="right" style="text-align:right"><b>To: <o:p></o:p></b></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal">Oleg Drokin <a href="mailto:oleg.drokin@intel.com"><oleg.drokin@intel.com></a><o:p></o:p></p>
</td>
</tr>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="right" style="text-align:right"><b>CC: <o:p></o:p></b></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><a href="mailto:devel@driverdev.osuosl.org"><devel@driverdev.osuosl.org></a>, Greg Kroah-Hartman
<a href="mailto:gregkh@linuxfoundation.org"><gregkh@linuxfoundation.org></a>, <a href="mailto:kernel-janitors@vger.kernel.org">
<kernel-janitors@vger.kernel.org></a>, <a href="mailto:linux-kernel@vger.kernel.org">
<linux-kernel@vger.kernel.org></a>, <a href="mailto:HPDD-discuss@lists.01.org"><HPDD-discuss@lists.01.org></a><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<pre>!x is more normal for kzalloc failure in the kernel.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>The semantic patch that makes this change is as follows:<o:p></o:p></pre>
<pre>(<a href="http://coccinelle.lip6.fr/">http://coccinelle.lip6.fr/</a>)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>// <smpl><o:p></o:p></pre>
<pre>@@<o:p></o:p></pre>
<pre>expression x;<o:p></o:p></pre>
<pre>statement S1, S2;<o:p></o:p></pre>
<pre>@@<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>x = kzalloc(...);<o:p></o:p></pre>
<pre>if (<o:p></o:p></pre>
<pre>- x == NULL<o:p></o:p></pre>
<pre>+ !x<o:p></o:p></pre>
<pre> ) S1 else S2<o:p></o:p></pre>
<pre>// </smpl><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Julia Lawall <a href="mailto:Julia.Lawall@lip6.fr"><Julia.Lawall@lip6.fr></a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>---<o:p></o:p></pre>
<pre> drivers/staging/lustre/lustre/fid/fid_request.c |    4 ++--<o:p></o:p></pre>
<pre> 1 file changed, 2 insertions(+), 2 deletions(-)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>diff -u -p a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c<o:p></o:p></pre>
<pre>--- a/drivers/staging/lustre/lustre/fid/fid_request.c<o:p></o:p></pre>
<pre>+++ b/drivers/staging/lustre/lustre/fid/fid_request.c<o:p></o:p></pre>
<pre>@@ -498,11 +498,11 @@ int client_fid_init(struct obd_device *o<o:p></o:p></pre>
<pre>        int rc;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        cli->cl_seq = kzalloc(sizeof(*cli->cl_seq), GFP_NOFS);<o:p></o:p></pre>
<pre>-       if (cli->cl_seq == NULL)<o:p></o:p></pre>
<pre>+       if (!cli->cl_seq)<o:p></o:p></pre>
<pre>               return -ENOMEM;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        prefix = kzalloc(MAX_OBD_NAME + 5, GFP_NOFS);<o:p></o:p></pre>
<pre>-       if (prefix == NULL) {<o:p></o:p></pre>
<pre>+       if (!prefix) {<o:p></o:p></pre>
<pre>               rc = -ENOMEM;<o:p></o:p></pre>
<pre>               goto out_free_seq;<o:p></o:p></pre>
<pre>        }<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>HPDD-discuss mailing list<o:p></o:p></pre>
<pre><a href="mailto:HPDD-discuss@lists.01.org">HPDD-discuss@lists.01.org</a><o:p></o:p></pre>
<pre><a href="https://lists.01.org/mailman/listinfo/hpdd-discuss">https://lists.01.org/mailman/listinfo/hpdd-discuss</a><o:p></o:p></pre>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>