Re: [PATCH 18/25] staging: lustre: libcfs: clear up failure patch in cfs_cpt_*_print

2018-04-17 Thread Dan Carpenter
> -err: > - if (rc < 0) > - return rc; > - > return tmp - buf; > + > +err: > + return -E2BIG; We finally fixed this bug! Hooray! But it's like you guys are deliberately writing in terrible style. You can just return directly and then you would have avoided this bug

[PATCH 18/25] staging: lustre: libcfs: clear up failure patch in cfs_cpt_*_print

2018-04-15 Thread James Simmons
From: Dmitry Eremin Currently both cfs_cpt_table_print() and cfs_cpt_distance_print() handle the error path in a confusing way. Simplify it so it just returns E2BIG on failure instead of testing rc value before exiting. Signed-off-by: Dmitry Eremin