Skip to contentSkip to conversation

use the macro ISOLATE_LSB where appropriate

PATCH In review Nicola Vetrini 2 participants 5 messages Nov 23, 2023

lore
Share & tools
lore
#2 lore raw

PATCH v3 2/2 xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1

In reply to Nicola Vetrini

No functional change.

---
Changes in v2:
- Changed macro name
Changes in v3:
- Changed macro name

---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/passthrough/iommu.c +1 -1
index f9a9f53dbd44..996c31be1284 100644
@@ -560,7 +560,7 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         if ( !rc )
             ops = iommu_get_ops();
-        if ( ops && (ops->page_sizes & -ops->page_sizes) != PAGE_SIZE )
+        if ( ops && (ISOLATE_LSB(ops->page_sizes)) != PAGE_SIZE )
         {
             printk(XENLOG_ERR "IOMMU: page size mask %lx unsupported\n",
                    ops->page_sizes);
Signature · 1 line
2.34.1
#0 lore raw

v3 cover use the macro ISOLATE_LSB where appropriate

This series replaces two instances of the pattern (x & -x) with the macro ISOLATE_LSB.

Nicola Vetrini (2):
xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1 xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1

 xen/common/vmap.c               | 2 +-
 xen/drivers/passthrough/iommu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/2 xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1

No functional change.

---
Changes in v2:
- Changed macro name
Changes in v3:
- Changed macro name

---
 xen/common/vmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/vmap.c +1 -1
index 4fd6b3067ec1..330e2ba897d7 100644
@@ -53,7 +53,7 @@ static void *vm_alloc(unsigned int nr, unsigned int align,
     if ( !align )
         align = 1;
     else if ( align & (align - 1) )
-        align &= -align;
+        align = ISOLATE_LSB(align);
 
     ASSERT((t >= VMAP_DEFAULT) && (t < VMAP_REGION_NR));
     if ( !vm_base[t] )
Signature · 1 line
2.34.1
#3 lore raw
In reply to Nicola Vetrini
Quoted 10 lines · Nicola Vetrini

This series replaces two instances of the pattern (x & -x) with the macro ISOLATE_LSB.

Nicola Vetrini (2):
xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1 xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1

 xen/common/vmap.c               | 2 +-
 xen/drivers/passthrough/iommu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Just to mention it: This is an example of where tracking the various pieces of Misra work is artificially made difficult (see e.g. earlier respective remarks by Julien). Why wasn't this combined into a single series together with the 3-patch one sent the same minute?

Jan

#4 lore raw
Quoted 12 lines · Jan Beulich
Quoted 10 lines · Nicola Vetrini

This series replaces two instances of the pattern (x & -x) with the macro ISOLATE_LSB.

Nicola Vetrini (2):
xen/vmap: use ISOLATE_LSB to wrap a violation of Rule 10.1 xen/iommu: use ISOLATE_LSB to wrap a violation of Rule 10.1

 xen/common/vmap.c               | 2 +-
 xen/drivers/passthrough/iommu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines

Just to mention it: This is an example of where tracking the various pieces of Misra work is artificially made difficult (see e.g. earlier respective remarks by Julien). Why wasn't this combined into a single series together with the 3-patch one sent the same minute?

Jan

I didn't think of collapsing them

Signature · 2 lines
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)