Skip to contentSkip to conversation

packet: minor: make if case unlikely

PATCH In review Daniel Borkmann 3 participants 3 messages Oct 23, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 packet: minor: make if case unlikely

This patch fixes the character width of max. 80 chars and also marks the if-statement as unlikely since those flags are not supported for the receive path anyway.

---
 net/packet/af_packet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/packet/af_packet.c +2 -1
index 1f2f465..adb1931 100644
@@ -2601,7 +2601,8 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
 	struct sockaddr_ll *sll;
 	int vnet_hdr_len = 0;
 
-	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_ERRQUEUE)) {
+	if (unlikely(flags & ~(MSG_PEEK | MSG_DONTWAIT | MSG_TRUNC |
+			       MSG_CMSG_COMPAT | MSG_ERRQUEUE))) {
 		err = -EINVAL;
 		goto out;
 	}
maintainer
#1 lore raw

From: Daniel Borkmann <[email protected]>
Date: Tue, 23 Oct 2012 13:58:34 +0200

Quoted 5 lines

This patch fixes the character width of max. 80 chars and also marks the if-statement as unlikely since those flags are not supported for the receive path anyway.

Please, don't submit patches like this.

80 characters is a soft "guidelline" there is no strict requirement for it.

I'm tossing this entire series.

#2 lore raw
Quoted 7 lines · David Miller

From: Daniel Borkmann <[email protected]>
Date: Tue, 23 Oct 2012 13:58:34 +0200

Quoted 4 lines

This patch fixes the character width of max. 80 chars and also marks the if-statement as unlikely since those flags are not supported for the receive path anyway.

Quoted 6 lines
Quoted 1 line

Please, don't submit patches like this.

80 characters is a soft "guidelline" there is no strict requirement for it.

Good to know.

Thanks for the feedback.