aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/mpi.h2
-rw-r--r--lib/mpi/mpicoder.c8
-rw-r--r--lib/mpi/mpiutil.c2
3 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/mpi.h b/include/linux/mpi.h
index 06f88994ccaa..d02cca6cc8ce 100644
--- a/include/linux/mpi.h
+++ b/include/linux/mpi.h
@@ -57,8 +57,6 @@ struct gcry_mpi {
57 57
58typedef struct gcry_mpi *MPI; 58typedef struct gcry_mpi *MPI;
59 59
60#define MPI_NULL NULL
61
62#define mpi_get_nlimbs(a) ((a)->nlimbs) 60#define mpi_get_nlimbs(a) ((a)->nlimbs)
63#define mpi_is_neg(a) ((a)->sign) 61#define mpi_is_neg(a) ((a)->sign)
64 62
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
index 6116fc4990da..d7684aa7f65c 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -34,7 +34,7 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
34 uint8_t *frame, *fr_pt; 34 uint8_t *frame, *fr_pt;
35 int i = 0, n; 35 int i = 0, n;
36 size_t asnlen = DIM(asn); 36 size_t asnlen = DIM(asn);
37 MPI a = MPI_NULL; 37 MPI a = NULL;
38 38
39 if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe) 39 if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe)
40 pr_info("MPI: can't encode a %d bit MD into a %d bits frame\n", 40 pr_info("MPI: can't encode a %d bit MD into a %d bits frame\n",
@@ -48,7 +48,7 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
48 */ 48 */
49 frame = kmalloc(nframe, GFP_KERNEL); 49 frame = kmalloc(nframe, GFP_KERNEL);
50 if (!frame) 50 if (!frame)
51 return MPI_NULL; 51 return NULL;
52 n = 0; 52 n = 0;
53 frame[n++] = 0; 53 frame[n++] = 0;
54 frame[n++] = 1; /* block type */ 54 frame[n++] = 1; /* block type */
@@ -92,7 +92,7 @@ MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
92 int i, j; 92 int i, j;
93 unsigned nbits, nbytes, nlimbs, nread = 0; 93 unsigned nbits, nbytes, nlimbs, nread = 0;
94 mpi_limb_t a; 94 mpi_limb_t a;
95 MPI val = MPI_NULL; 95 MPI val = NULL;
96 96
97 if (*ret_nread < 2) 97 if (*ret_nread < 2)
98 goto leave; 98 goto leave;
@@ -109,7 +109,7 @@ MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
109 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB; 109 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
110 val = mpi_alloc(nlimbs); 110 val = mpi_alloc(nlimbs);
111 if (!val) 111 if (!val)
112 return MPI_NULL; 112 return NULL;
113 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; 113 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
114 i %= BYTES_PER_MPI_LIMB; 114 i %= BYTES_PER_MPI_LIMB;
115 val->nbits = nbits; 115 val->nbits = nbits;
diff --git a/lib/mpi/mpiutil.c b/lib/mpi/mpiutil.c
index eefc55d6b7f5..6bfc41f62b8f 100644
--- a/lib/mpi/mpiutil.c
+++ b/lib/mpi/mpiutil.c
@@ -135,7 +135,7 @@ int mpi_copy(MPI *copied, const MPI a)
135 size_t i; 135 size_t i;
136 MPI b; 136 MPI b;
137 137
138 *copied = MPI_NULL; 138 *copied = NULL;
139 139
140 if (a) { 140 if (a) {
141 b = mpi_alloc(a->nlimbs); 141 b = mpi_alloc(a->nlimbs);