Commit 33957a10 authored by Jérémy Lefaure's avatar Jérémy Lefaure Committed by Jarkko Sakkinen

tpm, tpm_tis: use ARRAY_SIZE() to define TPM_HID_USR_IDX

Signed-off-by: default avatarJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
parent 2d56c718
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/kernel.h>
#include "tpm.h" #include "tpm.h"
#include "tpm_tis_core.h" #include "tpm_tis_core.h"
...@@ -365,7 +366,7 @@ static struct pnp_driver tis_pnp_driver = { ...@@ -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, module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment