Skip to content

Commit

Permalink
Linux 3.13 compat: Remove unused flags variable from __cv_init()
Browse files Browse the repository at this point in the history
GCC 4.8.1 complained about an unused flags variable when building
against Linux 2.6.26.8:

/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-condvar.c:
In function ‘__cv_init’:
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-condvar.c:39:6:
error: variable ‘flags’ set but not used
[-Werror=unused-but-set-variable]
  int flags = KM_SLEEP;
        ^
	cc1: all warnings being treated as errors

Additionally, the superfluous code uses a preempt_count variable that is
no longer available on Linux 3.13. Deleting the unnecessary code fixes a
Linux 3.13 compatibility issue.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #312
  • Loading branch information
ryao authored and behlendorf committed Dec 2, 2013
1 parent 30607d9 commit 3e96de1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions module/spl/spl-condvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
void
__cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
{
int flags = KM_SLEEP;

SENTRY;
ASSERT(cvp);
ASSERT(name == NULL);
Expand All @@ -51,12 +49,6 @@ __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
atomic_set(&cvp->cv_refs, 1);
cvp->cv_mutex = NULL;

/* We may be called when there is a non-zero preempt_count or
* interrupts are disabled is which case we must not sleep.
*/
if (current_thread_info()->preempt_count || irqs_disabled())
flags = KM_NOSLEEP;

SEXIT;
}
EXPORT_SYMBOL(__cv_init);
Expand Down

0 comments on commit 3e96de1

Please sign in to comment.