Linux PARISC architecture development
 help / color / mirror / Atom feed
From: "Joel Soete" <jsoe0708@tiscali.be>
To: parisc-linux@parisc-linux.org
Subject: RE: [parisc-linux] backport bitops.h stuff
Date: Fri, 1 Aug 2003 17:35:43 +0200	[thread overview]
Message-ID: <3F29178A000004CB@ocpmta7.freegates.net> (raw)
In-Reply-To: <3F29178A000004C6@ocpmta7.freegates.net>

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

 
Hi pa,

>Can somebody help me to ci inot 2.4 this patch which backport ffs() needed
>for new devmapper ;)

Again I forget to attach the patch file, sorry.

    Joel

PS: Now I have an ADSL connection at home, may be could I now ask an account
to ci those kind of armless stuff

------------------------------------------------------
Soldes Tiscali ADSL : 27,50 euros/mois jusque fin 2003.
On s'habitue vite à payer son ADSL moins cher!
Plus d'info? Cliquez ici... http://reg.tiscali.be/default.asp?lg=fr 



[-- Attachment #2: bitops.h-patch --]
[-- Type: application/octet-stream, Size: 844 bytes --]

--- bitops.h.orig	2003-08-01 15:25:02.000000000 +0200
+++ bitops.h	2003-08-01 15:27:38.000000000 +0200
@@ -208,13 +208,34 @@
 
 #ifdef __KERNEL__
 
+/**
+ * __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)
+{
+	unsigned long result = 0;
+
+	while (!(word & 1UL)) {
+		result++;
+		word >>= 1;
+	}
+	return result;
+}
+
 /*
  * ffs: find first bit set. This is defined the same way as
  * the libc and compiler builtin ffs routines, therefore
  * differs in spirit from the above ffz (man ffs).
  */
-
-#define ffs(x) generic_ffs(x)
+static __inline__ int ffs(int x)
+{
+	if (!x)
+		return 0;
+	return __ffs((unsigned long)x);
+}
 
 /*
  * hweightN: returns the hamming weight (i.e. the number

  reply	other threads:[~2003-08-01 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-01 15:28 [parisc-linux] backport bitops.h stuff Joel Soete
2003-08-01 15:35 ` Joel Soete [this message]
2003-08-01 15:59 ` James Bottomley
2003-08-01 17:09   ` Joel Soete
2003-08-01 17:14     ` LaMont Jones
2003-08-01 17:25       ` Joel Soete
2003-08-01 17:33       ` James Bottomley
2003-08-04 10:43       ` Joel Soete
2003-08-04 15:14         ` LaMont Jones
2003-08-04 16:08           ` James Bottomley
2003-08-04 17:04             ` Joel Soete
2003-08-04 16:53           ` Joel Soete

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=3F29178A000004CB@ocpmta7.freegates.net \
    --to=jsoe0708@tiscali.be \
    --cc=parisc-linux@parisc-linux.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