public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Brian T" <btuch@usa.net>
To: <linux-mtd@lists.infradead.org>
Subject: Re: undefined reference to `__ffs'
Date: Mon, 30 Aug 2004 11:36:35 -0500	[thread overview]
Message-ID: <068701c48eaf$845dfe70$fd0ba8c0@briantpc> (raw)
In-Reply-To: 1093631103.16320.14.camel@thomas.tec.linutronix.de

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




> On Fri, 2004-08-27 at 20:04, Brian T wrote:
> > So MTD is no longer compatable with the current 2.4 tree?  I just
unpacked
> > it and didn't see it in linux/asm-i386/bitops.h .  Am I looking in the
wrong
> > place?
>
> __ffs was never in 2.4. Move to 2.6 or add it to compatmac.h and provide
> a nice patch, if you really want to hang on with 2.4
>
> tglx

compatmac.h patch attached for __ffs() .

Compiles against 2.4.27 now.  Hope I didn't break anything.

-Brian

[-- Attachment #2: compatmac.diff --]
[-- Type: application/octet-stream, Size: 674 bytes --]

--- include/linux/mtd/compatmac.h.orig	Mon Aug 30 09:17:28 2004
+++ include/linux/mtd/compatmac.h	Mon Aug 30 11:22:18 2004
@@ -64,6 +64,22 @@
 
 #include <linux/sched.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+/**
+ *   * __ffs - find first bit in word.
+ *     * @word: The word to search
+ *       *
+ *         * Undefined if no bit exists, so code should check against 0 first.
+ *           */
+static inline unsigned long __ffs(unsigned long word)
+{
+	__asm__("bsfl %1,%0"
+	:"=r" (word)
+	:"rm" (word));
+	return word;
+}
+#endif /* < 2.5.0 */
+
 #ifdef __rh_config_h__
 #define sigmask_lock sighand->siglock
 #define sig sighand

  parent reply	other threads:[~2004-08-30 16:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 14:28 undefined reference to `__ffs' Brian T
2004-08-27 15:35 ` Brian T
2004-08-27 16:05   ` Nicolas Pitre
2004-08-27 18:04     ` Brian T
2004-08-27 18:10       ` Josh Boyer
2004-08-27 18:26         ` David Woodhouse
2004-08-27 18:25       ` Thomas Gleixner
2004-08-27 19:22         ` Brian T
2004-08-30 16:36         ` Brian T [this message]
2004-08-30 17:52           ` Josh Boyer
2004-08-30 18:20             ` Brian T
2004-08-30 18:35               ` Josh Boyer
2004-08-30 18:53                 ` Nicolas Pitre
2004-08-30 19:04                   ` Josh Boyer
2004-08-30 20:03                     ` Nicolas Pitre
2004-08-30 20:20                       ` Josh Boyer

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='068701c48eaf$845dfe70$fd0ba8c0@briantpc' \
    --to=btuch@usa.net \
    --cc=linux-mtd@lists.infradead.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