linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
@ 2019-07-29 18:55 Enrico Weigelt, metux IT consult
  2019-07-29 19:03 ` Marcelo Ricardo Leitner
  2019-07-29 21:02 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-07-29 18:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: vyasevich, nhorman, marcelo.leitner, davem, linux-sctp, netdev

From: Enrico Weigelt <info@metux.net>

IS_ERR() already calls unlikely(), so this extra unlikely() call
around IS_ERR() is not needed.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 net/sctp/socket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index aa80cda..9d1f83b 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -985,7 +985,7 @@ static int sctp_setsockopt_bindx(struct sock *sk,
 		return -EINVAL;
 
 	kaddrs = memdup_user(addrs, addrs_size);
-	if (unlikely(IS_ERR(kaddrs)))
+	if (IS_ERR(kaddrs))
 		return PTR_ERR(kaddrs);
 
 	/* Walk through the addrs buffer and count the number of addresses. */
@@ -1315,7 +1315,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk,
 		return -EINVAL;
 
 	kaddrs = memdup_user(addrs, addrs_size);
-	if (unlikely(IS_ERR(kaddrs)))
+	if (IS_ERR(kaddrs))
 		return PTR_ERR(kaddrs);
 
 	/* Allow security module to validate connectx addresses. */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
  2019-07-29 18:55 [PATCH] net: sctp: drop unneeded likely() call around IS_ERR() Enrico Weigelt, metux IT consult
@ 2019-07-29 19:03 ` Marcelo Ricardo Leitner
  2019-07-29 21:02 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2019-07-29 19:03 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, vyasevich, nhorman, davem, linux-sctp, netdev

On Mon, Jul 29, 2019 at 08:55:21PM +0200, Enrico Weigelt, metux IT consult wrote:
> From: Enrico Weigelt <info@metux.net>
> 
> IS_ERR() already calls unlikely(), so this extra unlikely() call
> around IS_ERR() is not needed.
> 
> Signed-off-by: Enrico Weigelt <info@metux.net>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  net/sctp/socket.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index aa80cda..9d1f83b 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -985,7 +985,7 @@ static int sctp_setsockopt_bindx(struct sock *sk,
>  		return -EINVAL;
>  
>  	kaddrs = memdup_user(addrs, addrs_size);
> -	if (unlikely(IS_ERR(kaddrs)))
> +	if (IS_ERR(kaddrs))
>  		return PTR_ERR(kaddrs);
>  
>  	/* Walk through the addrs buffer and count the number of addresses. */
> @@ -1315,7 +1315,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk,
>  		return -EINVAL;
>  
>  	kaddrs = memdup_user(addrs, addrs_size);
> -	if (unlikely(IS_ERR(kaddrs)))
> +	if (IS_ERR(kaddrs))
>  		return PTR_ERR(kaddrs);
>  
>  	/* Allow security module to validate connectx addresses. */
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
  2019-07-29 18:55 [PATCH] net: sctp: drop unneeded likely() call around IS_ERR() Enrico Weigelt, metux IT consult
  2019-07-29 19:03 ` Marcelo Ricardo Leitner
@ 2019-07-29 21:02 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2019-07-29 21:02 UTC (permalink / raw)
  To: info
  Cc: linux-kernel, vyasevich, nhorman, marcelo.leitner, linux-sctp, netdev

From: "Enrico Weigelt, metux IT consult" <info@metux.net>
Date: Mon, 29 Jul 2019 20:55:21 +0200

> From: Enrico Weigelt <info@metux.net>
> 
> IS_ERR() already calls unlikely(), so this extra unlikely() call
> around IS_ERR() is not needed.
> 
> Signed-off-by: Enrico Weigelt <info@metux.net>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
  2019-06-05 21:03 Enrico Weigelt, metux IT consult
  2019-06-05 21:50 ` Marcelo Ricardo Leitner
@ 2019-06-05 23:58 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2019-06-05 23:58 UTC (permalink / raw)
  To: info
  Cc: linux-kernel, vyasevich, nhorman, marcelo.leitner, linux-sctp, netdev

From: "Enrico Weigelt, metux IT consult" <info@metux.net>
Date: Wed,  5 Jun 2019 23:03:27 +0200

> From: Enrico Weigelt <info@metux.net>
> 
> IS_ERR() already calls unlikely(), so this extra unlikely() call
> around IS_ERR() is not needed.
> 
> Signed-off-by: Enrico Weigelt <info@metux.net>

Skipping this because of the overlap...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
  2019-06-05 21:50 ` Marcelo Ricardo Leitner
@ 2019-06-05 22:53   ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 7+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-05 22:53 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner, Enrico Weigelt, metux IT consult
  Cc: linux-kernel, vyasevich, nhorman, davem, linux-sctp, netdev

On 05.06.19 21:50, Marcelo Ricardo Leitner wrote:
> On Wed, Jun 05, 2019 at 11:03:27PM +0200, Enrico Weigelt, metux IT consult wrote:
>> From: Enrico Weigelt <info@metux.net>
>>
>> IS_ERR() already calls unlikely(), so this extra unlikely() call
>> around IS_ERR() is not needed.
>>
>> Signed-off-by: Enrico Weigelt <info@metux.net>
> 
> Hi,
> 
> This patch overlaps with
> Jun 05 Kefeng Wang     (4.4K) [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL)

I've missed Kefeng's patch ... feel free to ignore mine.


--mtx


-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
  2019-06-05 21:03 Enrico Weigelt, metux IT consult
@ 2019-06-05 21:50 ` Marcelo Ricardo Leitner
  2019-06-05 22:53   ` Enrico Weigelt, metux IT consult
  2019-06-05 23:58 ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2019-06-05 21:50 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, vyasevich, nhorman, davem, linux-sctp, netdev

On Wed, Jun 05, 2019 at 11:03:27PM +0200, Enrico Weigelt, metux IT consult wrote:
> From: Enrico Weigelt <info@metux.net>
> 
> IS_ERR() already calls unlikely(), so this extra unlikely() call
> around IS_ERR() is not needed.
> 
> Signed-off-by: Enrico Weigelt <info@metux.net>

Hi,

This patch overlaps with
Jun 05 Kefeng Wang     (4.4K) [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL)

  Marcelo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] net: sctp: drop unneeded likely() call around IS_ERR()
@ 2019-06-05 21:03 Enrico Weigelt, metux IT consult
  2019-06-05 21:50 ` Marcelo Ricardo Leitner
  2019-06-05 23:58 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-05 21:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: vyasevich, nhorman, marcelo.leitner, davem, linux-sctp, netdev

From: Enrico Weigelt <info@metux.net>

IS_ERR() already calls unlikely(), so this extra unlikely() call
around IS_ERR() is not needed.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 net/sctp/socket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 39ea0a3..c7b0f51 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -985,7 +985,7 @@ static int sctp_setsockopt_bindx(struct sock *sk,
 		return -EINVAL;
 
 	kaddrs = memdup_user(addrs, addrs_size);
-	if (unlikely(IS_ERR(kaddrs)))
+	if (IS_ERR(kaddrs))
 		return PTR_ERR(kaddrs);
 
 	/* Walk through the addrs buffer and count the number of addresses. */
@@ -1315,7 +1315,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk,
 		return -EINVAL;
 
 	kaddrs = memdup_user(addrs, addrs_size);
-	if (unlikely(IS_ERR(kaddrs)))
+	if (IS_ERR(kaddrs))
 		return PTR_ERR(kaddrs);
 
 	/* Allow security module to validate connectx addresses. */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-29 21:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 18:55 [PATCH] net: sctp: drop unneeded likely() call around IS_ERR() Enrico Weigelt, metux IT consult
2019-07-29 19:03 ` Marcelo Ricardo Leitner
2019-07-29 21:02 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-06-05 21:03 Enrico Weigelt, metux IT consult
2019-06-05 21:50 ` Marcelo Ricardo Leitner
2019-06-05 22:53   ` Enrico Weigelt, metux IT consult
2019-06-05 23:58 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).