opensm: removed unnecessary checks in main()
PATCH 1/1 opensm: removed unnecessary checks in main()
Variable temp is unsigned.
--- opensm/main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
opensm/main.c +2 -2
@@ -987,7 +987,7 @@ int main(int argc, char *argv[])break ;case 6 : temp =strtol (optarg,NULL ,0 ); -if (temp <0 || temp >=IB_MAX_NUM_VLS ) { +if (temp >=IB_MAX_NUM_VLS ) {fprintf (stderr,"ERROR: starting lash vl must be between 0 and 15\n" );return -1 ;
@@ -997,7 +997,7 @@ int main(int argc, char *argv[])break ;case 7 : temp =strtol (optarg,NULL ,0 ); -if (temp <0 || temp >15 ) { +if (temp >15 ) {fprintf (stderr,"ERROR: SM's SL must be between 0 and 15\n" );return -1 ;
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20110307100146.GI5577-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org
Quoted 33 lines · Alex Netes
Variable temp is unsigned.
--- opensm/main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)opensm/main.c +2
-2@@ -987,7 +987,7 @@ int main(int argc, char *argv[])break ;case 6 : temp =strtol (optarg,NULL ,0 ); -if (temp <0 || temp >=IB_MAX_NUM_VLS ) { +if (temp >=IB_MAX_NUM_VLS ) {fprintf (stderr,"ERROR: starting lash vl must be between 0 and 15\n" );return -1 ;@@ -997,7 +997,7 @@ int main(int argc, char *argv[])break ;case 7 : temp =strtol (optarg,NULL ,0 ); -if (temp <0 || temp >15 ) { +if (temp >15 ) {fprintf (stderr,"ERROR: SM's SL must be between 0 and 15\n" );return -1 ;Signature · 3 lines
1.7.3.4 --
strtol() returs a long, not unsigned, therefor either temp must be changed to match (and keep the < 0 tests) or a different function must be used (strtoul()?).
-- JF
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html