lib/mpi: added comment on divide by 0 case
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Thu, 26 Jan 2012 17:13:20 +0000 (19:13 +0200)
committerJames Morris <jmorris@namei.org>
Wed, 1 Feb 2012 13:23:39 +0000 (00:23 +1100)
Comment explains that existing clients do not call this function
with dsize == 0, which means that 1/0 should not happen.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
lib/mpi/mpih-div.c

index 87ede16..cde1aae 100644 (file)
@@ -217,6 +217,10 @@ mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs,
        case 0:
                /* We are asked to divide by zero, so go ahead and do it!  (To make
                   the compiler not remove this statement, return the value.)  */
+               /*
+                * existing clients of this function have been modified
+                * not to call it with dsize == 0, so this should not happen
+                */
                return 1 / dsize;
 
        case 1: