mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Henrik Austad <henrik@austad.us>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	alsa-devel@vger.kernel.org, linux-netdev@vger.kernel.org,
	henrk@austad.us, Henrik Austad <haustad@cisco.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [very-RFC 5/8] Add TSN machinery to drive the traffic from a shim over the network
Date: Sun, 12 Jun 2016 10:34:32 +0200	[thread overview]
Message-ID: <20160612083432.GC32724@icarus.home.austad.us> (raw)
In-Reply-To: <1465716910.25087.88.camel@perches.com>

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

On Sun, Jun 12, 2016 at 12:35:10AM -0700, Joe Perches wrote:
> On Sun, 2016-06-12 at 00:22 +0200, Henrik Austad wrote:
> > From: Henrik Austad <haustad@cisco.com>
> > 
> > In short summary:
> > 
> > * tsn_core.c is the main driver of tsn, all new links go through
> >   here and all data to/form the shims are handled here
> >   core also manages the shim-interface.
> []
> > diff --git a/net/tsn/tsn_configfs.c b/net/tsn/tsn_configfs.c
> []
> > +static inline struct tsn_link *to_tsn_link(struct config_item *item)
> > +{
> > +	/* this line causes checkpatch to WARN. making checkpatch happy,
> > +	 * makes code messy..
> > +	 */
> > +	return item ? container_of(to_config_group(item), struct tsn_link, group) : NULL;
> > +}
> 
> How about
> 
> static inline struct tsn_link *to_tsn_link(struct config_item *item)
> {
> 	if (!item)
> 		return NULL;
> 	return container_of(to_config_group(item), struct tsn_link, group);
> }

Yes, I mulled over this for a while, but I got the impression that the 
ternary-approach was the way used in configfs, and I tried staying in line 
with that in tsn_configfs.

If you see other parts of the TSN-code, I tend to use the if (!item) ... 
approach. So, I don't have any technical preferences either way really

-- 
Henrik Austad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2016-06-12  8:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-11 22:22 [very-RFC 0/8] TSN driver for the kernel Henrik Austad
2016-06-11 22:22 ` [very-RFC 1/8] TSN: add documentation Henrik Austad
2016-06-11 22:35   ` David Miller
2016-06-11 22:47     ` Henrik Austad
2016-06-11 22:49       ` David Miller
2016-06-11 22:51         ` Henrik Austad
2016-06-11 22:50   ` Henrik Austad
2016-06-11 22:22 ` [very-RFC 2/8] TSN: Add the standard formerly known as AVB to the kernel Henrik Austad
2016-06-11 22:53   ` Henrik Austad
2016-06-11 22:54     ` David Miller
2016-06-11 22:22 ` [very-RFC 3/8] Adding TSN-driver to Intel I210 controller Henrik Austad
2016-06-11 22:53   ` Henrik Austad
2016-06-11 22:22 ` [very-RFC 4/8] Add TSN header for the driver Henrik Austad
2016-06-11 22:54   ` Henrik Austad
2016-06-11 22:55   ` Henrik Austad
2016-06-11 22:22 ` [very-RFC 5/8] Add TSN machinery to drive the traffic from a shim over the network Henrik Austad
2016-06-11 22:54   ` Henrik Austad
2016-06-12  7:35   ` Joe Perches
2016-06-12  8:34     ` Henrik Austad [this message]
2016-06-11 22:22 ` [very-RFC 6/8] Add TSN event-tracing Henrik Austad
2016-06-11 22:22 ` [very-RFC 7/8] AVB ALSA - Add ALSA shim for TSN Henrik Austad
2016-06-11 22:22 ` [very-RFC 8/8] MAINTAINERS: add TSN/AVB-entries Henrik Austad
2016-06-11 22:49 ` [very-RFC 0/8] TSN driver for the kernel Henrik Austad
2016-06-11 23:01 Henrik Austad
2016-06-11 23:01 ` [very-RFC 5/8] Add TSN machinery to drive the traffic from a shim over the network Henrik Austad

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=20160612083432.GC32724@icarus.home.austad.us \
    --to=henrik@austad.us \
    --cc=alsa-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=haustad@cisco.com \
    --cc=henrk@austad.us \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-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

all inboxes | Powered by JetHome®