Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Riyan Dhiman <riyandhiman14@gmail.com>
Link: https://lore.kernel.org/r/20240903114849.4953-3-riyandhiman14@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Riyan Dhiman and committed by
Greg Kroah-Hartman
fa42410e 59e57414

+6 -6
+3 -3
drivers/staging/vme_user/vme_fake.c
··· 79 79 }; 80 80 81 81 /* Module parameter */ 82 - static int geoid; 82 + static u32 geoid; 83 83 84 84 static const char driver_name[] = "vme_fake"; 85 85 ··· 1059 1059 struct vme_slave_resource *slave_image; 1060 1060 struct vme_lm_resource *lm; 1061 1061 1062 - if (geoid < 0 || geoid >= VME_MAX_SLOTS) { 1062 + if (geoid >= VME_MAX_SLOTS) { 1063 1063 pr_err("VME geographical address must be between 0 and %d (exclusive), but got %d\n", 1064 1064 VME_MAX_SLOTS, geoid); 1065 1065 return -EINVAL; ··· 1289 1289 } 1290 1290 1291 1291 MODULE_PARM_DESC(geoid, "Set geographical addressing"); 1292 - module_param(geoid, int, 0); 1292 + module_param(geoid, uint, 0); 1293 1293 1294 1294 MODULE_DESCRIPTION("Fake VME bridge driver"); 1295 1295 MODULE_LICENSE("GPL");
+3 -3
drivers/staging/vme_user/vme_tsi148.c
··· 36 36 37 37 /* Module parameter */ 38 38 static bool err_chk; 39 - static int geoid; 39 + static u32 geoid; 40 40 41 41 static const char driver_name[] = "vme_tsi148"; 42 42 ··· 2252 2252 struct vme_dma_resource *dma_ctrlr; 2253 2253 struct vme_lm_resource *lm; 2254 2254 2255 - if (geoid < 0 || geoid >= VME_MAX_SLOTS) { 2255 + if (geoid >= VME_MAX_SLOTS) { 2256 2256 dev_err(&pdev->dev, "VME geographical address must be between 0 and %d (exclusive), but got %d\n", 2257 2257 VME_MAX_SLOTS, geoid); 2258 2258 return -EINVAL; ··· 2631 2631 module_param(err_chk, bool, 0); 2632 2632 2633 2633 MODULE_PARM_DESC(geoid, "Override geographical addressing"); 2634 - module_param(geoid, int, 0); 2634 + module_param(geoid, uint, 0); 2635 2635 2636 2636 MODULE_DESCRIPTION("VME driver for the Tundra Tempe VME bridge"); 2637 2637 MODULE_LICENSE("GPL");