Skip to contentSkip to conversation

netlabel: use GFP flags from caller instead of GFP_ATOMIC

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 22, 2012

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

PATCH 1/1 netlabel: use GFP flags from caller instead of GFP_ATOMIC

This function takes a GFP flags as a parameter, but they are never used. We don't take a lock in this function so there is no reason to prefer GFP_ATOMIC over the caller's GFP flags.

There is only one caller, cipso_v4_map_cat_rng_ntoh(), and it passes GFP_ATOMIC as the GFP flags so this doesn't change how the code works. It's just a cleanup.

net/netlabel/netlabel_kapi.c +1 -1
index 2560e7b..7c94aed 100644
@@ -597,7 +597,7 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
 			iter = iter->next;
 			iter_max_spot = iter->startbit + NETLBL_CATMAP_SIZE;
 		}
-		ret_val = netlbl_secattr_catmap_setbit(iter, spot, GFP_ATOMIC);
+		ret_val = netlbl_secattr_catmap_setbit(iter, spot, flags);
 	}
 
 	return ret_val;
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 22 Mar 2012 09:41:01 +0300

Quoted 9 lines

This function takes a GFP flags as a parameter, but they are never used. We don't take a lock in this function so there is no reason to prefer GFP_ATOMIC over the caller's GFP flags.

There is only one caller, cipso_v4_map_cat_rng_ntoh(), and it passes GFP_ATOMIC as the GFP flags so this doesn't change how the code works. It's just a cleanup.

Applied.