Signed-off-by: Christoph Lameter <[email protected]>
---
include/net/neighbour.h | 7 +------
include/net/netfilter/nf_conntrack.h | 9 ++-------
2 files changed, 3 insertions(+), 13 deletions(-)
Index: linux-2.6/include/net/neighbour.h
===================================================================
--- linux-2.6.orig/include/net/neighbour.h 2009-06-03 16:23:29.000000000 -0500
+++ linux-2.6/include/net/neighbour.h 2009-06-03 16:36:23.000000000 -0500
@@ -89,12 +89,7 @@ struct neigh_statistics
unsigned long unres_discards; /* number of unresolved drops */
};
-#define NEIGH_CACHE_STAT_INC(tbl, field) \
- do { \
- preempt_disable(); \
- (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
- preempt_enable(); \
- } while (0)
+#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
struct neighbour
{
Index: linux-2.6/include/net/netfilter/nf_conntrack.h
===================================================================
--- linux-2.6.orig/include/net/netfilter/nf_conntrack.h 2009-06-03 16:23:29.000000000 -0500
+++ linux-2.6/include/net/netfilter/nf_conntrack.h 2009-06-03 16:37:17.000000000 -0500
@@ -291,14 +291,9 @@ extern int nf_conntrack_set_hashsize(con
extern unsigned int nf_conntrack_htable_size;
extern unsigned int nf_conntrack_max;
-#define NF_CT_STAT_INC(net, count) \
- (per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++)
+#define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count)
#define NF_CT_STAT_INC_ATOMIC(net, count) \
-do { \
- local_bh_disable(); \
- per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++; \
- local_bh_enable(); \
-} while (0)
+ this_cpu_inc((net)->ct.stat->count)
#define MODULE_ALIAS_NFCT_HELPER(helper) \
MODULE_ALIAS("nfct-helper-" helper)
--
On Fri, Jun 05, 2009 at 03:18:23PM -0400, [email protected] wrote:
...
> --- linux-2.6.orig/include/net/netfilter/nf_conntrack.h 2009-06-03 16:23:29.000000000 -0500
...
> #define NF_CT_STAT_INC_ATOMIC(net, count) \
> -do { \
> - local_bh_disable(); \
> - per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++; \
> - local_bh_enable(); \
> -} while (0)
> + this_cpu_inc((net)->ct.stat->count)
Why not put this on one line?
#define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
obin
On Mon, 8 Jun 2009, Robin Holt wrote:
> > + this_cpu_inc((net)->ct.stat->count)
>
> Why not put this on one line?
> #define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
Would be more than 78 characters in a line.
* Christoph Lameter <[email protected]> wrote:
> On Mon, 8 Jun 2009, Robin Holt wrote:
>
> > > + this_cpu_inc((net)->ct.stat->count)
> >
> > Why not put this on one line?
> > #define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
>
> Would be more than 78 characters in a line.
I think you can ignore such types of warnings in general. I think
checkpatch should be silent up to 90 chars or so, if there's not
more than say 3 tabs in that line. (if there's a lot of tabs that
means the indentation level is wrong.)
Ingo