linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Fariya Fatima <fariya.f@redpinesignals.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3.14.0-rc5 v3 2/10] rsi: Adding remaining header files
Date: Wed, 05 Mar 2014 11:50:54 +0100	[thread overview]
Message-ID: <1394016654.5275.7.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <531435FE.1000006@redpinesignals.com> (sfid-20140303_085923_497682_26845ACC)

On Mon, 2014-03-03 at 13:27 +0530, Fariya Fatima wrote:

> +static inline int rsi_init_event(struct rsi_event *pevent)
> +{
> +	atomic_set(&pevent->event_condition, 1);
> +	init_waitqueue_head(&pevent->event_queue);
> +	return 0;
> +}
> +
> +static inline int rsi_wait_event(struct rsi_event *event, u32 timeout)
> +{
> +	int status = 0;
> +
> +	if (!timeout)
> +		status = wait_event_interruptible(event->event_queue,
> +				(atomic_read(&event->event_condition) == 0));
> +	else
> +		status = wait_event_interruptible_timeout(event->event_queue,
> +				(atomic_read(&event->event_condition) == 0),
> +				timeout);
> +	return status;
> +}

I think you should inline that, the extra code here is pretty pointless.

> +static inline int rsi_create_kthread(struct rsi_common *common,
> +				     struct rsi_thread *thread,
> +				     void *func_ptr,
> +				     u8 *name)
> +{
> +	init_completion(&thread->completion);
> +	thread->task = kthread_run(func_ptr, common, name);
> +	if (!IS_ERR(thread->task))
> +		return 0;
> +
> +	return -1;
> +}

-1 is -EPERM, that's likely not a good idea.

johannes


      reply	other threads:[~2014-03-05 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03  7:57 [PATCH 3.14.0-rc5 v3 2/10] rsi: Adding remaining header files Fariya Fatima
2014-03-05 10:50 ` Johannes Berg [this message]

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=1394016654.5275.7.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=fariya.f@redpinesignals.com \
    --cc=linux-wireless@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).