X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=kvmfornfv.git;a=blobdiff_plain;f=kernel%2Fdrivers%2Frtc%2Frtc-rp5c01.c;h=026035373ae65a446122c6ebf39df9364b58718a;hp=b548551f385ccd170a8dd507496c052dc8d1e4ef;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hpb=f93b97fd65072de626c074dbe099a1fff05ce060 diff --git a/kernel/drivers/rtc/rtc-rp5c01.c b/kernel/drivers/rtc/rtc-rp5c01.c index b548551f3..026035373 100644 --- a/kernel/drivers/rtc/rtc-rp5c01.c +++ b/kernel/drivers/rtc/rtc-rp5c01.c @@ -170,7 +170,7 @@ static ssize_t rp5c01_nvram_read(struct file *filp, struct kobject *kobj, spin_lock_irq(&priv->lock); - for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) { + for (count = 0; count < size; count++) { u8 data; rp5c01_write(priv, @@ -200,7 +200,7 @@ static ssize_t rp5c01_nvram_write(struct file *filp, struct kobject *kobj, spin_lock_irq(&priv->lock); - for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) { + for (count = 0; count < size; count++) { u8 data = *buf++; rp5c01_write(priv,