diff options
| author | Kukjin Kim <kgene.kim@samsung.com> | 2012-05-12 18:53:34 -0400 |
|---|---|---|
| committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-05-12 18:53:34 -0400 |
| commit | 163ec0369be4c26e68385f6cec88d0ee38c8d8e5 (patch) | |
| tree | f3e441866f8bc1b0548e7d8eddd9548b6aedef5e /lib/mpi/mpi-bit.c | |
| parent | 199642bfe107c411f25fbfc16c9fd49cfef9785d (diff) | |
| parent | 99dbdd98f271899e023d52b3f4c2bf67cdd7eb56 (diff) | |
Merge branch 'next/cleanup-plat-s3c24xx' into next/cleanup-plat-s3c24xx-s5p
Diffstat (limited to 'lib/mpi/mpi-bit.c')
| -rw-r--r-- | lib/mpi/mpi-bit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mpi/mpi-bit.c b/lib/mpi/mpi-bit.c index 2f526627e4f5..0c505361da19 100644 --- a/lib/mpi/mpi-bit.c +++ b/lib/mpi/mpi-bit.c | |||
| @@ -177,8 +177,8 @@ int mpi_rshift(MPI x, MPI a, unsigned n) | |||
| 177 | */ | 177 | */ |
| 178 | int mpi_lshift_limbs(MPI a, unsigned int count) | 178 | int mpi_lshift_limbs(MPI a, unsigned int count) |
| 179 | { | 179 | { |
| 180 | mpi_ptr_t ap = a->d; | 180 | const int n = a->nlimbs; |
| 181 | int n = a->nlimbs; | 181 | mpi_ptr_t ap; |
| 182 | int i; | 182 | int i; |
| 183 | 183 | ||
| 184 | if (!count || !n) | 184 | if (!count || !n) |
| @@ -187,6 +187,7 @@ int mpi_lshift_limbs(MPI a, unsigned int count) | |||
| 187 | if (RESIZE_IF_NEEDED(a, n + count) < 0) | 187 | if (RESIZE_IF_NEEDED(a, n + count) < 0) |
| 188 | return -ENOMEM; | 188 | return -ENOMEM; |
| 189 | 189 | ||
| 190 | ap = a->d; | ||
| 190 | for (i = n - 1; i >= 0; i--) | 191 | for (i = n - 1; i >= 0; i--) |
| 191 | ap[i + count] = ap[i]; | 192 | ap[i + count] = ap[i]; |
| 192 | for (i = 0; i < count; i++) | 193 | for (i = 0; i < count; i++) |
