From: Dmitry Kasatkin Date: Thu, 26 Jan 2012 17:13:20 +0000 (+0200) Subject: lib/mpi: added comment on divide by 0 case X-Git-Tag: v3.3-rc3~39^2~4 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a6d68ecc56ed182644c81ef6917ce1f5404db7dd;p=~emulex%2Finfiniband.git lib/mpi: added comment on divide by 0 case 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 Reviewed-by: Tetsuo Handa Signed-off-by: James Morris --- diff --git a/lib/mpi/mpih-div.c b/lib/mpi/mpih-div.c index 87ede162dfa..cde1aaec18d 100644 --- a/lib/mpi/mpih-div.c +++ b/lib/mpi/mpih-div.c @@ -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: