netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] net: introduce helper macra CMSG_FOREACH_HDR
Date: Fri, 05 Dec 2014 00:02:32 -0800	[thread overview]
Message-ID: <1417766552.2721.45.camel@perches.com> (raw)
In-Reply-To: <54815B40.1050909@cn.fujitsu.com>

On Fri, 2014-12-05 at 15:14 +0800, Gu Zheng wrote:
> Introduce helper macra

macro

> CMSG_FOREACH_HDR as a wrapper of the enumerating
> cmsghdr from msghdr, just cleanup. 

maybe better to use lower case "for_each_cmsg_hdr"
or some such.

checkpatch would recognize that too as long as it
uses "for_each".

> diff --git a/include/linux/socket.h b/include/linux/socket.h
[]
> @@ -94,6 +94,10 @@ struct cmsghdr {
>  			     (cmsg)->cmsg_len <= (unsigned long) \
>  			     ((mhdr)->msg_controllen - \
>  			      ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
> +#define CMSG_FOREACH_HDR(cmsg, msg)  \
> +	for (cmsg = CMSG_FIRSTHDR(msg); \
> +	     cmsg; \
> +	     cmsg = CMSG_NXTHDR(msg, cmsg))

  reply	other threads:[~2014-12-05  8:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  7:14 [RESEND PATCH] net: introduce helper macra CMSG_FOREACH_HDR Gu Zheng
2014-12-05  8:02 ` Joe Perches [this message]
2014-12-05  8:29   ` Gu Zheng
2014-12-09 20:23     ` David Miller

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=1417766552.2721.45.camel@perches.com \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).