Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
correct. Acked-by: Dmitry Kasatkin Dmitry On 12 January 2015 at 13:43, David Howells wrote: > Dmitry Kasatkin wrote: > >> Ack. > > To what email address do I translate that now? > > Acked-by: Dmitry Kasatkin > > perchance? > > David -- Thanks, Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
Dmitry Kasatkin wrote: > Ack. To what email address do I translate that now? Acked-by: Dmitry Kasatkin perchance? David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
Dmitry Kasatkin dmitry.kasat...@gmail.com wrote: Ack. To what email address do I translate that now? Acked-by: Dmitry Kasatkin dmitry.kasat...@gmail.com perchance? David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
correct. Acked-by: Dmitry Kasatkin dmitry.kasat...@gmail.com Dmitry On 12 January 2015 at 13:43, David Howells dhowe...@redhat.com wrote: Dmitry Kasatkin dmitry.kasat...@gmail.com wrote: Ack. To what email address do I translate that now? Acked-by: Dmitry Kasatkin dmitry.kasat...@gmail.com perchance? David -- Thanks, Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
Hi, Thank you. Indeed '-cmp' is much more clear. Ack. - Dmitry On 9 January 2015 at 13:00, David Howells wrote: > This looks very reasonable. cc'ing Dmitry for his check. > > David > --- > Rasmus Villemoes wrote: > >> The condition preceding 'return 1;' makes my head hurt. At this point, >> we know that u and v have the same sign; if they are negative, they >> compare opposite to how their absolute values compare (which >> mpihelp_cmp found for us), otherwise cmp itself is the >> answer. Negating cmp is ok since mpihelp_cmp returns {-1,0,1}; >> -INT_MIN==INT_MIN won't bite us. >> >> Signed-off-by: Rasmus Villemoes >> --- >> lib/mpi/mpi-cmp.c | 8 +++- >> 1 file changed, 3 insertions(+), 5 deletions(-) >> >> diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c >> index 3801694240d8..d25e9e96c310 100644 >> --- a/lib/mpi/mpi-cmp.c >> +++ b/lib/mpi/mpi-cmp.c >> @@ -61,10 +61,8 @@ int mpi_cmp(MPI u, MPI v) >> if (!usize) >> return 0; >> cmp = mpihelp_cmp(u->d, v->d, usize); >> - if (!cmp) >> - return 0; >> - if ((cmp < 0 ? 1 : 0) == (u->sign ? 1 : 0)) >> - return 1; >> - return -1; >> + if (u->sign) >> + return -cmp; >> + return cmp; >> } >> EXPORT_SYMBOL_GPL(mpi_cmp); >> -- >> 2.1.3 > ___ > Keyrings mailing list > keyri...@linux-nfs.org > To change your subscription to this list, please see > http://linux-nfs.org/cgi-bin/mailman/listinfo/keyrings -- Thanks, Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Keyrings] [PATCH 2/2] MPILIB: Deobfuscate mpi_cmp
Hi, Thank you. Indeed '-cmp' is much more clear. Ack. - Dmitry On 9 January 2015 at 13:00, David Howells dhowe...@redhat.com wrote: This looks very reasonable. cc'ing Dmitry for his check. David --- Rasmus Villemoes li...@rasmusvillemoes.dk wrote: The condition preceding 'return 1;' makes my head hurt. At this point, we know that u and v have the same sign; if they are negative, they compare opposite to how their absolute values compare (which mpihelp_cmp found for us), otherwise cmp itself is the answer. Negating cmp is ok since mpihelp_cmp returns {-1,0,1}; -INT_MIN==INT_MIN won't bite us. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- lib/mpi/mpi-cmp.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c index 3801694240d8..d25e9e96c310 100644 --- a/lib/mpi/mpi-cmp.c +++ b/lib/mpi/mpi-cmp.c @@ -61,10 +61,8 @@ int mpi_cmp(MPI u, MPI v) if (!usize) return 0; cmp = mpihelp_cmp(u-d, v-d, usize); - if (!cmp) - return 0; - if ((cmp 0 ? 1 : 0) == (u-sign ? 1 : 0)) - return 1; - return -1; + if (u-sign) + return -cmp; + return cmp; } EXPORT_SYMBOL_GPL(mpi_cmp); -- 2.1.3 ___ Keyrings mailing list keyri...@linux-nfs.org To change your subscription to this list, please see http://linux-nfs.org/cgi-bin/mailman/listinfo/keyrings -- Thanks, Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/