+ lib-lcmc-lcmn0=lcm0n-is-0-not-n.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not n
has been added to the -mm tree.  Its filename is
     lib-lcmc-lcmn0=lcm0n-is-0-not-n.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-lcmc-lcmn0%3Dlcm0n-is-0-not-n.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-lcmc-lcmn0%3Dlcm0n-is-0-not-n.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Subject: lib/lcm.c: lcm(n,0)=lcm(0,n) is 0, not n

Return the mathematically correct answer when an argument is 0.

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Cc: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/lcm.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff -puN lib/lcm.c~lib-lcmc-lcmn0=lcm0n-is-0-not-n lib/lcm.c
--- a/lib/lcm.c~lib-lcmc-lcmn0=lcm0n-is-0-not-n
+++ a/lib/lcm.c
@@ -8,9 +8,7 @@ unsigned long lcm(unsigned long a, unsig
 {
 	if (a && b)
 		return (a / gcd(a, b)) * b;
-	else if (b)
-		return b;
-
-	return a;
+	else
+		return 0;
 }
 EXPORT_SYMBOL_GPL(lcm);
_

Patches currently in -mm which might be from linux@xxxxxxxxxxxxxxxxxx are

lib-lcmc-ensure-correct-result-whenever-it-fits.patch
lib-lcmc-lcmn0=lcm0n-is-0-not-n.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux