diff mbox

[net-next] include/net/raw.h: Convert raw_seq_private macro to inline

Message ID 1283835677.23280.108.camel@Joe-Laptop
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Joe Perches Sept. 7, 2010, 5:01 a.m. UTC
On Mon, 2010-09-06 at 18:47 -0700, David Miller wrote:
> raw_seq_private() expands to something which dereferences the pointer,
> which you've now made void, which is illegal and breaks the build.
> Reverted.

Apologies, I had this in my tree which I didn't send
because it wasn't a private_data cast removal.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/net/raw.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Nick Bowler Sept. 7, 2010, 3:37 p.m. UTC | #1
On 2010-09-06 22:01 -0700, Joe Perches wrote:
> diff --git a/include/net/raw.h b/include/net/raw.h
> index 43c5750..c621200 100644
> --- a/include/net/raw.h
> +++ b/include/net/raw.h
> @@ -45,7 +45,10 @@ struct raw_iter_state {
>  	struct raw_hashinfo *h;
>  };
>  
> -#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
> +inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)

This needs to be declared static.

> +{
> +	return seq->private;
> +}
>  void *raw_seq_start(struct seq_file *seq, loff_t *pos);
>  void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
>  void raw_seq_stop(struct seq_file *seq, void *v);
diff mbox

Patch

diff --git a/include/net/raw.h b/include/net/raw.h
index 43c5750..c621200 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -45,7 +45,10 @@  struct raw_iter_state {
 	struct raw_hashinfo *h;
 };
 
-#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
+inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
+{
+	return seq->private;
+}
 void *raw_seq_start(struct seq_file *seq, loff_t *pos);
 void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 void raw_seq_stop(struct seq_file *seq, void *v);