public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected],
	GNU/Weeb Mailing List <[email protected]>,
	[email protected]
Subject: [PATCH] net: fix err_cast.cocci warnings
Date: Fri, 1 Apr 2022 07:33:03 +0800	[thread overview]
Message-ID: <YkY6L0HKkmfYONdl@71276691420c> (raw)
In-Reply-To: <[email protected]>

From: kernel test robot <[email protected]>

net/socket.c:1571:9-16: WARNING: ERR_CAST can be used with sock


 Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

Fixes: 3af464ccde38 ("net: add __sys_socket_file()")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://github.com/ammarfaizi2/linux-block axboe/linux-block/sock-nolock
head:   8698873371093e22f708c2cf3a31f4dc2caab84f
commit: 3af464ccde389a5df95af3e221d098ac34d4606f [7/9] net: add __sys_socket_file()
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

 net/socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/socket.c
+++ b/net/socket.c
@@ -1568,7 +1568,7 @@ struct file *__sys_socket_direct(int fam
 
 	sock = __sys_socket_create(family, type, protocol);
 	if (IS_ERR(sock))
-		return ERR_PTR(PTR_ERR(sock));
+		return ERR_CAST(sock);
 
 	flags = type & ~SOCK_TYPE_MASK;
 	if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK))

  reply	other threads:[~2022-03-31 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 23:42 [ammarfaizi2-block:axboe/linux-block/sock-nolock 7/9] net/socket.c:1571:9-16: WARNING: ERR_CAST can be used with sock kernel test robot
2022-03-31 23:33 ` kernel test robot [this message]
2022-04-01  1:14   ` [PATCH] net: fix err_cast.cocci warnings Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkY6L0HKkmfYONdl@71276691420c \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox