Skip to content

Commit

Permalink
tpm, tpm_tis: use ARRAY_SIZE() to define TPM_HID_USR_IDX
Browse files Browse the repository at this point in the history
Signed-off-by: Jérémy Lefaure <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
Jérémy Lefaure authored and Jarkko Sakkinen committed Oct 18, 2017
1 parent 2d56c71 commit 33957a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/freezer.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/kernel.h>
#include "tpm.h"
#include "tpm_tis_core.h"

Expand Down Expand Up @@ -365,7 +366,7 @@ static struct pnp_driver tis_pnp_driver = {
},
};

#define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2
#define TIS_HID_USR_IDX (ARRAY_SIZE(tpm_pnp_tbl) - 2)
module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
Expand Down

0 comments on commit 33957a1

Please sign in to comment.