forked from Minki/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>
This commit is contained in:
parent
c70c471c58
commit
3cccd1543a
|
@ -57,8 +57,6 @@ struct gcry_mpi {
|
||||||
|
|
||||||
typedef struct gcry_mpi *MPI;
|
typedef struct gcry_mpi *MPI;
|
||||||
|
|
||||||
#define MPI_NULL NULL
|
|
||||||
|
|
||||||
#define mpi_get_nlimbs(a) ((a)->nlimbs)
|
#define mpi_get_nlimbs(a) ((a)->nlimbs)
|
||||||
#define mpi_is_neg(a) ((a)->sign)
|
#define mpi_is_neg(a) ((a)->sign)
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
|
||||||
uint8_t *frame, *fr_pt;
|
uint8_t *frame, *fr_pt;
|
||||||
int i = 0, n;
|
int i = 0, n;
|
||||||
size_t asnlen = DIM(asn);
|
size_t asnlen = DIM(asn);
|
||||||
MPI a = MPI_NULL;
|
MPI a = NULL;
|
||||||
|
|
||||||
if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe)
|
if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe)
|
||||||
pr_info("MPI: can't encode a %d bit MD into a %d bits frame\n",
|
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)
|
||||||
*/
|
*/
|
||||||
frame = kmalloc(nframe, GFP_KERNEL);
|
frame = kmalloc(nframe, GFP_KERNEL);
|
||||||
if (!frame)
|
if (!frame)
|
||||||
return MPI_NULL;
|
return NULL;
|
||||||
n = 0;
|
n = 0;
|
||||||
frame[n++] = 0;
|
frame[n++] = 0;
|
||||||
frame[n++] = 1; /* block type */
|
frame[n++] = 1; /* block type */
|
||||||
|
@ -92,7 +92,7 @@ MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
|
||||||
int i, j;
|
int i, j;
|
||||||
unsigned nbits, nbytes, nlimbs, nread = 0;
|
unsigned nbits, nbytes, nlimbs, nread = 0;
|
||||||
mpi_limb_t a;
|
mpi_limb_t a;
|
||||||
MPI val = MPI_NULL;
|
MPI val = NULL;
|
||||||
|
|
||||||
if (*ret_nread < 2)
|
if (*ret_nread < 2)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -109,7 +109,7 @@ MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
|
||||||
nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
|
nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
|
||||||
val = mpi_alloc(nlimbs);
|
val = mpi_alloc(nlimbs);
|
||||||
if (!val)
|
if (!val)
|
||||||
return MPI_NULL;
|
return NULL;
|
||||||
i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
|
i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
|
||||||
i %= BYTES_PER_MPI_LIMB;
|
i %= BYTES_PER_MPI_LIMB;
|
||||||
val->nbits = nbits;
|
val->nbits = nbits;
|
||||||
|
|
|
@ -135,7 +135,7 @@ int mpi_copy(MPI *copied, const MPI a)
|
||||||
size_t i;
|
size_t i;
|
||||||
MPI b;
|
MPI b;
|
||||||
|
|
||||||
*copied = MPI_NULL;
|
*copied = NULL;
|
||||||
|
|
||||||
if (a) {
|
if (a) {
|
||||||
b = mpi_alloc(a->nlimbs);
|
b = mpi_alloc(a->nlimbs);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user