• M
    [media] drxj: don't do math if not needed · b6554ea5
    Mauro Carvalho Chehab 提交于
    While there's no risk of divison by zero, the logic there is akward, as it
    does the calculus for the numerator and denominator before checking
    if this will be used.
    
    Change the order to check first if the denominator is zero, and only
    calculating the numerator/denominator if not.
    
    This should also avoid those smatch errors:
    	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
    	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
    	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
    	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
    	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
    Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
    b6554ea5
drxj.c 350.5 KB