diff options
author | Ioana Radulescu <ruxandra.radulescu@freescale.com> | 2013-10-03 12:42:56 (GMT) |
---|---|---|
committer | J. German Rivera <German.Rivera@freescale.com> | 2013-10-05 00:56:30 (GMT) |
commit | 9b8711e9d8c27b9fc99e552c0dea1d5cdc797557 (patch) | |
tree | 4a9471ec6a6b35bafdccc648dbfb89b41daf90e6 /drivers/net/ethernet/freescale/fman | |
parent | 3914c4dd5aa3ed90483b35ea097f43f2f63b1920 (diff) | |
download | linux-fsl-qoriq-9b8711e9d8c27b9fc99e552c0dea1d5cdc797557.tar.xz |
fmd: Enforce minimum value for fsl_fm_rx_extra_headroom
fsl_fm_rx_extra headroom must have a value of at least 16 bytes.
The Kconfig option has this lower limit, but when configuring the
parameter through bootargs no check was made.
So enforce the lower limit for all input methods, to avoid invalid
values.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Change-Id: Ibf6dfe82d7497745b04eb46e0e7b0a1497c3aa7f
Reviewed-on: http://git.am.freescale.net:8181/5172
Reviewed-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c index 333b20a..a95a603 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c @@ -105,7 +105,8 @@ extern struct device_node *GetFmPortAdvArgsDevTreeNode (struct device_node *fm_n /* Bootarg used to override FSL_FM_RX_EXTRA_HEADROOM Kconfig value */ #define FSL_FM_RX_EXTRA_HEADROOM_BOOTARG "fsl_fm_rx_extra_headroom" -/* Maximum value for the fsl_fm_rx_extra_headroom bootarg */ +/* Minimum and maximum value for the fsl_fm_rx_extra_headroom bootarg */ +#define FSL_FM_RX_EXTRA_HEADROOM_MIN 16 #define FSL_FM_RX_EXTRA_HEADROOM_MAX 384 #define TX_PAUSE_PRIO_DEFAULT 0xff @@ -204,12 +205,13 @@ static int __init fm_set_rx_extra_headroom(char *str) return 1; } - if (fsl_fm_rx_extra_headroom < 0 || + if (fsl_fm_rx_extra_headroom < FSL_FM_RX_EXTRA_HEADROOM_MIN || fsl_fm_rx_extra_headroom > FSL_FM_RX_EXTRA_HEADROOM_MAX) { - printk(KERN_WARNING "Invalid value for %s=<int> prop in " + printk(KERN_WARNING "Invalid value for %s=%d prop in " "bootargs; will use the default " "FSL_FM_RX_EXTRA_HEADROOM (%d) from Kconfig.\n", FSL_FM_RX_EXTRA_HEADROOM_BOOTARG, + fsl_fm_rx_extra_headroom, CONFIG_FSL_FM_RX_EXTRA_HEADROOM); fsl_fm_rx_extra_headroom = CONFIG_FSL_FM_RX_EXTRA_HEADROOM; } |