netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] netlabel: use GFP flags from caller instead of GFP_ATOMIC
@ 2012-03-22  6:41 Dan Carpenter
  2012-03-22 23:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-22  6:41 UTC (permalink / raw)
  To: Paul Moore; +Cc: David S. Miller, netdev, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 2560e7b..7c94aed 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -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;

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

* Re: [patch] netlabel: use GFP flags from caller instead of GFP_ATOMIC
  2012-03-22  6:41 [patch] netlabel: use GFP flags from caller instead of GFP_ATOMIC Dan Carpenter
@ 2012-03-22 23:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-03-22 23:30 UTC (permalink / raw)
  To: dan.carpenter; +Cc: paul, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 22 Mar 2012 09:41:01 +0300

> 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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

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

end of thread, other threads:[~2012-03-22 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22  6:41 [patch] netlabel: use GFP flags from caller instead of GFP_ATOMIC Dan Carpenter
2012-03-22 23:30 ` 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).