Skip to content

Commit 4a0e286

Browse files
committed
fix issues after CR
1 parent efe3719 commit 4a0e286

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

random/imx6ull-rngb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ static int hardwareInit(void)
154154
/* Reset and wait until rngb is sleeping */
155155
*(common_rngb.base + rng_cmd) = 0x40;
156156
do {
157-
err = *(common_rngb.base + rng_sr) & 0x04;
157+
err = *(common_rngb.base + rng_sr) & 0x4;
158158
} while (err == 0);
159159

160160
interrupt(RNGB_IRQ, rngb_intr, NULL, common_rngb.cond, NULL);
161161

162162
/* Run self test */
163-
*(common_rngb.base + rng_cmd) = 0x01;
163+
*(common_rngb.base + rng_cmd) = 0x1;
164164
mutexLock(common_rngb.lock);
165165
while (common_rngb.intr_st == 0) {
166166
condWait(common_rngb.cond, common_rngb.lock, 3000);
@@ -177,7 +177,7 @@ static int hardwareInit(void)
177177
common_rngb.intr_st = 0;
178178

179179
/* Run seeding */
180-
*(common_rngb.base + rng_cmd) = 0x02;
180+
*(common_rngb.base + rng_cmd) = 0x2;
181181
mutexLock(common_rngb.lock);
182182
while (common_rngb.intr_st == 0) {
183183
condWait(common_rngb.cond, common_rngb.lock, 3000);
@@ -196,7 +196,7 @@ static int hardwareInit(void)
196196
/* Enable automatic seeding */
197197
*(common_rngb.base + rng_cr) = 0x10;
198198

199-
printf("imx6ull-rngb: initialized\n");
199+
printf("imx6ull-rngb: initialized\n");
200200

201201
return 0;
202202
}
@@ -220,7 +220,7 @@ static int readRandoms(char *buff, size_t size, unsigned mode)
220220
while (i < size) {
221221
if ((i % sizeof(uint32_t)) == 0) {
222222
status = *(common_rngb.base + rng_sr);
223-
if ((status & (1 << 16)) == 1) {
223+
if (((status >> 16) & 1U) == 1) {
224224
mutexUnlock(common_rngb.lock);
225225
return -EIO;
226226
}

0 commit comments

Comments
 (0)