From: Longfang Liu <liulongfang@huawei.com> The HPRE driver must store and process data in big-endian (MSB) format as specified by the chip design. Therefore, the comparison logic for this data should also be described and implemented following the big-endian convention. Signed-off-by: Longfang Liu <liulongfang@huawei.com> --- drv/hisi_hpre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drv/hisi_hpre.c b/drv/hisi_hpre.c index 07ebe92..e114da3 100644 --- a/drv/hisi_hpre.c +++ b/drv/hisi_hpre.c @@ -1169,7 +1169,7 @@ static bool big_than_one(const char *data, __u32 data_sz) static bool less_than_latter(struct wd_dtb *d, struct wd_dtb *n) { unsigned char *d_data, *n_data; - int shift, i; + __u32 shift, i; if (d->dsize > n->dsize) return false; @@ -1180,7 +1180,8 @@ static bool less_than_latter(struct wd_dtb *d, struct wd_dtb *n) shift = n->bsize - n->dsize; d_data = d->data + shift; n_data = n->data + shift; - for (i = d->dsize - 1; i >= 0; i--) { + /* Task parameter data must be stored in big-endian format in DDR */ + for (i = 0; i < d->dsize; i++) { if (d_data[i] < n_data[i]) return true; else if (d_data[i] > n_data[i]) -- 2.33.0