]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ptp: clockmatrix: remove unnecessary comparison
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 24 Apr 2020 12:52:26 +0000 (20:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Apr 2020 03:41:42 +0000 (20:41 -0700)
The type of loaddr is u8 which is always '<=' 0xff, so the
loaddr <= 0xff is always true, we can remove this comparison.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_clockmatrix.c

index 032e112c3dd99f1acc7c18864f74816729763c62..a3f6088326604efbcbbd4dc3534a480ec58249e5 100644 (file)
@@ -780,7 +780,7 @@ static int idtcm_load_firmware(struct idtcm *idtcm,
 
                        /* Page size 128, last 4 bytes of page skipped */
                        if (((loaddr > 0x7b) && (loaddr <= 0x7f))
-                            || ((loaddr > 0xfb) && (loaddr <= 0xff)))
+                            || loaddr > 0xfb)
                                continue;
 
                        err = idtcm_write(idtcm, regaddr, 0, &val, sizeof(val));