Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/mpi: replaced MPI_NULL with normal NULL

MPI_NULL is replaced with normal NULL.

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>

authored by

Dmitry Kasatkin and committed by
James Morris
3cccd154 c70c471c

+5 -7
-2
include/linux/mpi.h
··· 57 57 58 58 typedef struct gcry_mpi *MPI; 59 59 60 - #define MPI_NULL NULL 61 - 62 60 #define mpi_get_nlimbs(a) ((a)->nlimbs) 63 61 #define mpi_is_neg(a) ((a)->sign) 64 62
+4 -4
lib/mpi/mpicoder.c
··· 34 34 uint8_t *frame, *fr_pt; 35 35 int i = 0, n; 36 36 size_t asnlen = DIM(asn); 37 - MPI a = MPI_NULL; 37 + MPI a = NULL; 38 38 39 39 if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe) 40 40 pr_info("MPI: can't encode a %d bit MD into a %d bits frame\n", ··· 48 48 */ 49 49 frame = kmalloc(nframe, GFP_KERNEL); 50 50 if (!frame) 51 - return MPI_NULL; 51 + return NULL; 52 52 n = 0; 53 53 frame[n++] = 0; 54 54 frame[n++] = 1; /* block type */ ··· 92 92 int i, j; 93 93 unsigned nbits, nbytes, nlimbs, nread = 0; 94 94 mpi_limb_t a; 95 - MPI val = MPI_NULL; 95 + MPI val = NULL; 96 96 97 97 if (*ret_nread < 2) 98 98 goto leave; ··· 109 109 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB; 110 110 val = mpi_alloc(nlimbs); 111 111 if (!val) 112 - return MPI_NULL; 112 + return NULL; 113 113 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; 114 114 i %= BYTES_PER_MPI_LIMB; 115 115 val->nbits = nbits;
+1 -1
lib/mpi/mpiutil.c
··· 135 135 size_t i; 136 136 MPI b; 137 137 138 - *copied = MPI_NULL; 138 + *copied = NULL; 139 139 140 140 if (a) { 141 141 b = mpi_alloc(a->nlimbs);