tpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit)
Move static variable definition (cdevsw) to a more conventional location (the C file it is used in), rather than a header. This fixes the GCC warning, -Wunused-variable ("defined but not used") when the tpm20.h header is included in files other than tpm20.c (e.g., tpm_tis.c). X-MFC-with: r342084 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
9877f73541
commit
0c3bbec309
@ -36,6 +36,22 @@ MALLOC_DEFINE(M_TPM20, "tpm_buffer", "buffer for tpm 2.0 driver");
|
||||
static void tpm20_discard_buffer(void *arg);
|
||||
static int tpm20_save_state(device_t dev, bool suspend);
|
||||
|
||||
static d_open_t tpm20_open;
|
||||
static d_close_t tpm20_close;
|
||||
static d_read_t tpm20_read;
|
||||
static d_write_t tpm20_write;
|
||||
static d_ioctl_t tpm20_ioctl;
|
||||
|
||||
static struct cdevsw tpm20_cdevsw = {
|
||||
.d_version = D_VERSION,
|
||||
.d_open = tpm20_open,
|
||||
.d_close = tpm20_close,
|
||||
.d_read = tpm20_read,
|
||||
.d_write = tpm20_write,
|
||||
.d_ioctl = tpm20_ioctl,
|
||||
.d_name = "tpm20",
|
||||
};
|
||||
|
||||
int
|
||||
tpm20_read(struct cdev *dev, struct uio *uio, int flags)
|
||||
{
|
||||
@ -162,7 +178,7 @@ tpm20_init(struct tpm_sc *sc)
|
||||
sc->pending_data_length = 0;
|
||||
|
||||
make_dev_args_init(&args);
|
||||
args.mda_devsw = &tpm_cdevsw;
|
||||
args.mda_devsw = &tpm20_cdevsw;
|
||||
args.mda_uid = UID_ROOT;
|
||||
args.mda_gid = GID_WHEEL;
|
||||
args.mda_mode = TPM_CDEV_PERM_FLAG;
|
||||
|
@ -124,22 +124,6 @@ int32_t tpm20_get_timeout(uint32_t command);
|
||||
int tpm20_init(struct tpm_sc *sc);
|
||||
void tpm20_release(struct tpm_sc *sc);
|
||||
|
||||
d_open_t tpm20_open;
|
||||
d_close_t tpm20_close;
|
||||
d_read_t tpm20_read;
|
||||
d_write_t tpm20_write;
|
||||
d_ioctl_t tpm20_ioctl;
|
||||
|
||||
static struct cdevsw tpm_cdevsw = {
|
||||
.d_version = D_VERSION,
|
||||
.d_open = tpm20_open,
|
||||
.d_close = tpm20_close,
|
||||
.d_read = tpm20_read,
|
||||
.d_write = tpm20_write,
|
||||
.d_ioctl = tpm20_ioctl,
|
||||
.d_name = "tpm20",
|
||||
};
|
||||
|
||||
/* Small helper routines for io ops */
|
||||
static inline uint8_t
|
||||
RD1(struct tpm_sc *sc, bus_size_t off)
|
||||
|
Loading…
x
Reference in New Issue
Block a user