netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Subject: [PATCH net-next 1/6] net: qualcomm: rmnet: Remove the rmnet_map_results enum
Date: Sun,  3 Dec 2017 23:37:03 -0700	[thread overview]
Message-ID: <1512369428-20455-2-git-send-email-subashab@codeaurora.org> (raw)
In-Reply-To: <1512369428-20455-1-git-send-email-subashab@codeaurora.org>

Only the success and consumed entries were actually in use.
Use standard error codes instead.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 .../net/ethernet/qualcomm/rmnet/rmnet_handlers.c    | 21 ++++++++-------------
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h     |  9 ---------
 2 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index 29842cc..1e1ea10 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -126,12 +126,12 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
 
 	if (skb_headroom(skb) < required_headroom) {
 		if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL))
-			return RMNET_MAP_CONSUMED;
+			goto fail;
 	}
 
 	map_header = rmnet_map_add_map_header(skb, additional_header_len, 0);
 	if (!map_header)
-		return RMNET_MAP_CONSUMED;
+		goto fail;
 
 	if (port->egress_data_format & RMNET_EGRESS_FORMAT_MUXING) {
 		if (mux_id == 0xff)
@@ -142,7 +142,11 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
 
 	skb->protocol = htons(ETH_P_MAP);
 
-	return RMNET_MAP_SUCCESS;
+	return 0;
+
+fail:
+	kfree_skb(skb);
+	return -ENOMEM;
 }
 
 static void
@@ -209,17 +213,8 @@ void rmnet_egress_handler(struct sk_buff *skb)
 	}
 
 	if (port->egress_data_format & RMNET_EGRESS_FORMAT_MAP) {
-		switch (rmnet_map_egress_handler(skb, port, mux_id, orig_dev)) {
-		case RMNET_MAP_CONSUMED:
-			return;
-
-		case RMNET_MAP_SUCCESS:
-			break;
-
-		default:
-			kfree_skb(skb);
+		if (rmnet_map_egress_handler(skb, port, mux_id, orig_dev))
 			return;
-		}
 	}
 
 	rmnet_vnd_tx_fixup(skb, orig_dev);
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 3af3fe7..4df359d 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -30,15 +30,6 @@ struct rmnet_map_control_command {
 	};
 }  __aligned(1);
 
-enum rmnet_map_results {
-	RMNET_MAP_SUCCESS,
-	RMNET_MAP_CONSUMED,
-	RMNET_MAP_GENERAL_FAILURE,
-	RMNET_MAP_NOT_ENABLED,
-	RMNET_MAP_FAILED_AGGREGATION,
-	RMNET_MAP_FAILED_MUX
-};
-
 enum rmnet_map_commands {
 	RMNET_MAP_COMMAND_NONE,
 	RMNET_MAP_COMMAND_FLOW_DISABLE,
-- 
1.9.1

  reply	other threads:[~2017-12-04  6:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04  6:37 [PATCH net-next 0/6] net: qualcomm: rmnet: Configuration options Subash Abhinov Kasiviswanathan
2017-12-04  6:37 ` Subash Abhinov Kasiviswanathan [this message]
2017-12-05 16:53   ` [PATCH net-next 1/6] net: qualcomm: rmnet: Remove the rmnet_map_results enum David Miller
2017-12-05 19:02     ` Subash Abhinov Kasiviswanathan
2017-12-04  6:37 ` [PATCH net-next 2/6] net: qualcomm: rmnet: Remove the some redundant macros Subash Abhinov Kasiviswanathan
2017-12-04  6:37 ` [PATCH net-next 3/6] net: qualcomm: rmnet: Allow only one rmnet dev per muxid per real dev Subash Abhinov Kasiviswanathan
2017-12-04  6:37 ` [PATCH net-next 4/6] net: qualcomm: rmnet: Process packets over ethernet Subash Abhinov Kasiviswanathan
2017-12-05 16:55   ` David Miller
2017-12-04  6:37 ` [PATCH net-next 5/6] net: qualcomm: rmnet: Allow to configure flags for new devices Subash Abhinov Kasiviswanathan
2017-12-08 16:26   ` Dan Williams
2017-12-08 18:59     ` Subash Abhinov Kasiviswanathan
2017-12-04  6:37 ` [PATCH net-next 6/6] net: qualcomm: rmnet: Allow to configure flags for existing devices Subash Abhinov Kasiviswanathan

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=1512369428-20455-2-git-send-email-subashab@codeaurora.org \
    --to=subashab@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).