Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1611564
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] VSOCK: remove unnecessary ternary operator on return value |
| Date | 2017-03-29 07:00 +0200 |
| Message-ID | <tqdS9-1Qy-13@gated-at.bofh.it> (permalink) |
| References | <tq1Hk-1nl-33@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Colin King <colin.king@canonical.com>
Date: Tue, 28 Mar 2017 16:54:24 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Rather than assign the positive errno values to ret and then
> checking if it is positive and flip the sign, just set ret to
> be the -ve errno value.
>
> Detected by CoverityScan, CID#986649 ("Logically Dead Code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Just return the error directly instead of having this variable.
Thanks.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] VSOCK: remove unnecessary ternary operator on return value Colin King <colin.king@canonical.com> - 2017-03-28 18:00 +0200 Re: [PATCH] VSOCK: remove unnecessary ternary operator on return value walter harms <wharms@bfs.de> - 2017-03-28 18:10 +0200 Re: [PATCH] VSOCK: remove unnecessary ternary operator on return value David Miller <davem@davemloft.net> - 2017-03-29 07:00 +0200
csiph-web