Commit fa42410e authored by Riyan Dhiman's avatar Riyan Dhiman Committed by Greg Kroah-Hartman

staging: vme_user: changed geoid data type from int to u32

Geoid is a module parameter which is set by root user.
Its valid values are between 0 and VME_MAX_SLOTS. So, changing data type
of geoid from int to u32 since it will always be positive.
Signed-off-by: default avatarRiyan Dhiman <riyandhiman14@gmail.com>
Link: https://lore.kernel.org/r/20240903114849.4953-3-riyandhiman14@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 59e57414
...@@ -79,7 +79,7 @@ struct fake_driver { ...@@ -79,7 +79,7 @@ struct fake_driver {
}; };
/* Module parameter */ /* Module parameter */
static int geoid; static u32 geoid;
static const char driver_name[] = "vme_fake"; static const char driver_name[] = "vme_fake";
...@@ -1059,7 +1059,7 @@ static int __init fake_init(void) ...@@ -1059,7 +1059,7 @@ static int __init fake_init(void)
struct vme_slave_resource *slave_image; struct vme_slave_resource *slave_image;
struct vme_lm_resource *lm; struct vme_lm_resource *lm;
if (geoid < 0 || geoid >= VME_MAX_SLOTS) { if (geoid >= VME_MAX_SLOTS) {
pr_err("VME geographical address must be between 0 and %d (exclusive), but got %d\n", pr_err("VME geographical address must be between 0 and %d (exclusive), but got %d\n",
VME_MAX_SLOTS, geoid); VME_MAX_SLOTS, geoid);
return -EINVAL; return -EINVAL;
...@@ -1289,7 +1289,7 @@ static void __exit fake_exit(void) ...@@ -1289,7 +1289,7 @@ static void __exit fake_exit(void)
} }
MODULE_PARM_DESC(geoid, "Set geographical addressing"); MODULE_PARM_DESC(geoid, "Set geographical addressing");
module_param(geoid, int, 0); module_param(geoid, uint, 0);
MODULE_DESCRIPTION("Fake VME bridge driver"); MODULE_DESCRIPTION("Fake VME bridge driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -36,7 +36,7 @@ static void tsi148_remove(struct pci_dev *); ...@@ -36,7 +36,7 @@ static void tsi148_remove(struct pci_dev *);
/* Module parameter */ /* Module parameter */
static bool err_chk; static bool err_chk;
static int geoid; static u32 geoid;
static const char driver_name[] = "vme_tsi148"; static const char driver_name[] = "vme_tsi148";
...@@ -2252,7 +2252,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2252,7 +2252,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
struct vme_dma_resource *dma_ctrlr; struct vme_dma_resource *dma_ctrlr;
struct vme_lm_resource *lm; struct vme_lm_resource *lm;
if (geoid < 0 || geoid >= VME_MAX_SLOTS) { if (geoid >= VME_MAX_SLOTS) {
dev_err(&pdev->dev, "VME geographical address must be between 0 and %d (exclusive), but got %d\n", dev_err(&pdev->dev, "VME geographical address must be between 0 and %d (exclusive), but got %d\n",
VME_MAX_SLOTS, geoid); VME_MAX_SLOTS, geoid);
return -EINVAL; return -EINVAL;
...@@ -2631,7 +2631,7 @@ MODULE_PARM_DESC(err_chk, "Check for VME errors on reads and writes"); ...@@ -2631,7 +2631,7 @@ MODULE_PARM_DESC(err_chk, "Check for VME errors on reads and writes");
module_param(err_chk, bool, 0); module_param(err_chk, bool, 0);
MODULE_PARM_DESC(geoid, "Override geographical addressing"); MODULE_PARM_DESC(geoid, "Override geographical addressing");
module_param(geoid, int, 0); module_param(geoid, uint, 0);
MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge"); MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
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