Commit cd078cb6 authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: cavium/nitrox - Fix sparse warnings



This patch fixes all the sparse warnings in cavium/nitrox:

- Fix endianness warnings by adding the correct markers to unions.
- Add missing header inclusions for prototypes.
- Move nitrox_sriov_configure prototype into the isr header file.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 802c6c3e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -45,9 +45,9 @@ static int nitrox_aes_gcm_setkey(struct crypto_aead *aead, const u8 *key,

	/* fill crypto context */
	fctx = nctx->u.fctx;
	flags.f = be64_to_cpu(fctx->flags.f);
	flags.fu = be64_to_cpu(fctx->flags.f);
	flags.w0.aes_keylen = aes_keylen;
	fctx->flags.f = cpu_to_be64(flags.f);
	fctx->flags.f = cpu_to_be64(flags.fu);

	/* copy enc key to context */
	memset(&fctx->crypto, 0, sizeof(fctx->crypto));
@@ -63,9 +63,9 @@ static int nitrox_aead_setauthsize(struct crypto_aead *aead,
	struct flexi_crypto_context *fctx = nctx->u.fctx;
	union fc_ctx_flags flags;

	flags.f = be64_to_cpu(fctx->flags.f);
	flags.fu = be64_to_cpu(fctx->flags.f);
	flags.w0.mac_len = authsize;
	fctx->flags.f = cpu_to_be64(flags.f);
	fctx->flags.f = cpu_to_be64(flags.fu);

	aead->authsize = authsize;

@@ -319,7 +319,7 @@ static int nitrox_gcm_common_init(struct crypto_aead *aead)
	flags->w0.iv_source = IV_FROM_DPTR;
	/* ask microcode to calculate ipad/opad */
	flags->w0.auth_input_type = 1;
	flags->f = be64_to_cpu(flags->f);
	flags->f = cpu_to_be64(flags->fu);

	return 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
#include <linux/debugfs.h>

#include "nitrox_csr.h"
#include "nitrox_debugfs.h"
#include "nitrox_dev.h"

static int firmware_show(struct seq_file *s, void *v)
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@

#include "nitrox_dev.h"
#include "nitrox_csr.h"
#include "nitrox_hal.h"

#define PLL_REF_CLK 50
#define MAX_CSR_RETRIES 10
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include "nitrox_csr.h"
#include "nitrox_common.h"
#include "nitrox_hal.h"
#include "nitrox_isr.h"
#include "nitrox_mbx.h"

/**
+9 −0
Original line number Diff line number Diff line
@@ -9,4 +9,13 @@ void nitrox_unregister_interrupts(struct nitrox_device *ndev);
int nitrox_sriov_register_interupts(struct nitrox_device *ndev);
void nitrox_sriov_unregister_interrupts(struct nitrox_device *ndev);

#ifdef CONFIG_PCI_IOV
int nitrox_sriov_configure(struct pci_dev *pdev, int num_vfs);
#else
static inline int nitrox_sriov_configure(struct pci_dev *pdev, int num_vfs)
{
	return 0;
}
#endif

#endif /* __NITROX_ISR_H */
Loading