linux-4.13/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c:86: possible faulty logic ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello there,

[linux-4.13/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c:93]: (warning) Opposite inner 'if' condition leads to a dead code block.

Source code is

    if (target != duty) {
        u16 bump_period = fan->bios.bump_period;
        u16 slow_down_period = fan->bios.slow_down_period;
        u64 delay;

        if (duty > target)
            delay = slow_down_period;
        else if (duty == target)
            delay = min(bump_period, slow_down_period) ;

Last if can never be true, so call to min can never execute. Suggest code rework.

Regards

David Binderman
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux