Hi Michal, >> >>> + if ( shm_id_match ) >>> { >>> - if ( strncmp(shm_id, shmem_extra[i].shm_id, >>> - MAX_SHM_ID_LENGTH) == 0 ) >>> + /* >>> + * Regions have same shm_id (cases): >>> + * 1) physical host address is supplied: >>> + * - OK: paddr is equal and size is equal (same region) >>> + * - Fail: paddr doesn't match or size doesn't match (there >>> + * cannot exists two shmem regions with same shm_id) >>> + * 2) physical host address is NOT supplied: >>> + * - OK: size is equal (same region) >>> + * - Fail: size is not equal (same shm_id must identify >>> only one >>> + * region, there can't be two different regions >>> with same >>> + * shm_id) >>> + */ >>> + bool start_match = paddr_assigned ? (paddr == >>> mem->bank[i].start) : >>> + true; >>> + >>> + if ( start_match && size == mem->bank[i].size ) >>> break; >>> else >>> { >>> - printk("fdt: xen,shm-id %s does not match for all the >>> nodes using the same region.\n", >>> + printk("fdt: different shared memory region could not >>> share the same shm ID %s\n", >>> shm_id); >>> return -EINVAL; >>> } >>> } >>> - else if ( strncmp(shm_id, shmem_extra[i].shm_id, >>> - MAX_SHM_ID_LENGTH) != 0 ) >>> - continue; >>> else >>> { >> There is no need for this else and entire block given that the block within >> if either calls break or return > > There was a MISRA discussion about else at the end of if ... else if ... > (R15.7) and I don’t remember > the outcome
Sorry I was misreading the code here, sure I’ll remove the else. Cheers, Luca