lkml.org 
[lkml]   [2022]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tracing: Do PTR_ERR() after IS_ERR()
From
Date
在 2022年07月28日 00:28, Steven Rostedt 写道:
> On Wed, 27 Jul 2022 23:35:19 +0800
> Li Qiong <liqiong@nfschina.com> wrote:
>
>> Check IS_ERR() firstly, then do PTR_ERR().
> Why?
>
> The code is fine as is.
>
> -- Steve
>

Hi,

It's all right, assign PTR_ERR() to 'ret' anyway.
But this assignment is valid only at the "IS_ERR()" path.
Maybe it is better put "PTR_ERR()" at error path, keep the code clear.

--
李力琼 <13524287433>
上海市浦东新区海科路99号中科院上海高等研究院3号楼3楼

\
 
 \ /
  Last update: 2022-07-28 02:29    [W:0.060 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site