On 26.04.2024 17:26, Marek Marczykowski-Górecki wrote: > On Thu, Apr 25, 2024 at 01:15:34PM +0200, Jan Beulich wrote: >> On 13.03.2024 16:16, Marek Marczykowski-Górecki wrote: >>> + hwaddr = fix_to_virt(fixmap_idx) + PAGE_OFFSET(address); >>> + >>> + switch ( len ) >>> + { >>> + case 1: >>> + *pval = readb(hwaddr); >>> + break; >>> + >>> + case 2: >>> + *pval = readw(hwaddr); >>> + break; >>> + >>> + case 4: >>> + *pval = readl(hwaddr); >>> + break; >>> + >>> + case 8: >>> + *pval = readq(hwaddr); >>> + break; >>> + >>> + default: >>> + ASSERT_UNREACHABLE(); >> >> Misra demands "break;" to be here for release builds. In fact I wonder >> why "*pval = ~0UL;" isn't put here, too. Question of course is whether >> in such a case a true error indicator wouldn't be yet better. > > I don't think it possible for the msixtbl_read() (that calls > adjacent_read()) to be called with other sizes.
I agree, but scanners won't know. Jan > The default label is here exactly to make it obvious for the reader. >