Commit c2ca27f
committed
Don't use a mask when not needed
When the mask has the same size as the parent register of a field, then
a mask is not required. This removes the clippy warnings/errors where
for example an operation of inverting a mask results in zero
```
error: this operation will always return zero. This is likely not the intended outcome
|
61 | self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
```
or when the operation of using a mask is ineffective.
```
warning: the operation is ineffective. Consider reducing it to `value as u32`
|
61 | self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
```1 parent d6afbf9 commit c2ca27f
2 files changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
305 | 311 | | |
306 | 312 | | |
307 | 313 | | |
| |||
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
377 | | - | |
| 383 | + | |
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
381 | 391 | | |
382 | 392 | | |
383 | 393 | | |
| |||
398 | 408 | | |
399 | 409 | | |
400 | 410 | | |
401 | | - | |
| 411 | + | |
402 | 412 | | |
403 | 413 | | |
404 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
405 | 419 | | |
406 | 420 | | |
407 | 421 | | |
| |||
679 | 693 | | |
680 | 694 | | |
681 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
682 | 702 | | |
683 | 703 | | |
684 | 704 | | |
685 | 705 | | |
686 | | - | |
| 706 | + | |
687 | 707 | | |
688 | 708 | | |
689 | 709 | | |
| |||
0 commit comments