lkml.org 
[lkml]   [2020]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 1/6] nvmem: add driver for JZ4780 efuse
From
Date

>>> + rd_adj = clk_rate / 153846154;
>>> + rd_strobe = clk_rate / 28571429 - 5 - rd_adj + 1;
>>> +
>>> + if (rd_adj > BIT(4) - 1 || rd_strobe > BIT(4) - 1) {
>>
>> Just use 0xF or GENMASK(3, 0) instead of BIT(4) - 1
>
> Or would rd_adj >= BIT(4) be better since this is not used as a mask?
> This would also correspond to that the register is 4 bits wide.

I just recognized that we already have these constants defined:

So I'll add

if (rd_adj > EFUCFG_RD_ADJ_MASK || rd_strobe > EFUCFG_RD_STR_MASK) {

to v7.

BR,
Nikolaus

\
 
 \ /
  Last update: 2020-02-28 13:18    [W:0.044 / U:3.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site