mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen: Bracket uses of macro parameters
Fixing Rule 20.7 violations. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
This commit is contained in:
1 parent
f03a9e3bd9
commit
2429e82c71
7 files changed
+22
-20
No files matched your search
@@ -16,7 +16,7 @@
|
||||
#include <asm/io.h>
|
||||
|
||||
#define INVALID_VALUE (~0U)
|
||||
#define PCI_ERR_VALUE(len) GENMASK(0, len * 8)
|
||||
#define PCI_ERR_VALUE(len) GENMASK(0, (len) * 8)
|
||||
|
||||
static const struct pci_ops *get_ops(struct pci_host_bridge *bridge,
|
||||
pci_sbdf_t sbdf)
|
||||
@@ -139,14 +139,14 @@ static void pci_config_write(pci_sbdf_t sbdf, unsigned int reg,
|
||||
void pci_conf_write##size(pci_sbdf_t sbdf, \
|
||||
unsigned int reg, type data) \
|
||||
{ \
|
||||
pci_config_write(sbdf, reg, size / 8, data); \
|
||||
pci_config_write(sbdf, reg, (size) / 8, data); \
|
||||
}
|
||||
|
||||
#define PCI_OP_READ(size, type) \
|
||||
type pci_conf_read##size(pci_sbdf_t sbdf, \
|
||||
unsigned int reg) \
|
||||
{ \
|
||||
return pci_config_read(sbdf, reg, size / 8); \
|
||||
return pci_config_read(sbdf, reg, (size) / 8); \
|
||||
}
|
||||
|
||||
PCI_OP_READ(8, uint8_t)
|
||||
|
||||
@@ -75,7 +75,7 @@ static inline unsigned int __init next_boot_module_index(
|
||||
#define for_each_boot_module_by_type(i, b, t) \
|
||||
for ( (i) = first_boot_module_index(b, t); \
|
||||
(i) <= (b)->nr_modules; \
|
||||
(i) = next_boot_module_index(b, t, i + 1) )
|
||||
(i) = next_boot_module_index(b, t, (i) + 1) )
|
||||
|
||||
#endif /* X86_BOOTINFO_H */
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ do { \
|
||||
do { \
|
||||
int __done = 0; \
|
||||
_FOREACH_PRESENT_L1E(_sl1mfn, _sl1e, _gl1p, \
|
||||
({ (__done = _done); }), _code); \
|
||||
({ __done = (_done); }), _code); \
|
||||
_sl1mfn = sh_next_page(_sl1mfn); \
|
||||
if ( !__done ) \
|
||||
_FOREACH_PRESENT_L1E(_sl1mfn, _sl1e, _gl1p, _done, _code); \
|
||||
|
||||
+6
-5
@@ -491,11 +491,12 @@ static void kimage_terminate(struct kexec_image *image)
|
||||
* Call unmap_domain_page(ptr) after the loop exits.
|
||||
*/
|
||||
#define for_each_kimage_entry(image, ptr, entry) \
|
||||
for ( ptr = map_domain_page(_mfn(paddr_to_pfn(image->head))); \
|
||||
(entry = *ptr) && !(entry & IND_DONE); \
|
||||
ptr = (entry & IND_INDIRECTION) ? \
|
||||
(unmap_domain_page(ptr), map_domain_page(_mfn(paddr_to_pfn(entry)))) \
|
||||
: ptr + 1 )
|
||||
for ( (ptr) = map_domain_page(_mfn(paddr_to_pfn((image)->head))); \
|
||||
(entry = *(ptr)) && !((entry) & IND_DONE); \
|
||||
(ptr) = (((entry) & IND_INDIRECTION) \
|
||||
? (unmap_domain_page(ptr), \
|
||||
map_domain_page(_mfn(paddr_to_pfn(entry)))) \
|
||||
: (ptr) + 1) )
|
||||
|
||||
static void kimage_free_entry(kimage_entry_t entry)
|
||||
{
|
||||
|
||||
@@ -664,7 +664,8 @@ static inline int livepatch_check_expectations(const struct payload *payload)
|
||||
const struct livepatch_elf_sec *__sec = livepatch_elf_sec_by_name(elf, section_name); \
|
||||
if ( !__sec ) \
|
||||
break; \
|
||||
if ( !section_ok(elf, __sec, sizeof(*hook)) || __sec->sec->sh_size != sizeof(*hook) ) \
|
||||
if ( !section_ok(elf, __sec, sizeof(*(hook))) || \
|
||||
__sec->sec->sh_size != sizeof(*(hook)) ) \
|
||||
return -EINVAL; \
|
||||
hook = __sec->addr; \
|
||||
} while (0)
|
||||
@@ -678,10 +679,10 @@ static inline int livepatch_check_expectations(const struct payload *payload)
|
||||
const struct livepatch_elf_sec *__sec = livepatch_elf_sec_by_name(elf, section_name); \
|
||||
if ( !__sec ) \
|
||||
break; \
|
||||
if ( !section_ok(elf, __sec, sizeof(*hook)) ) \
|
||||
if ( !section_ok(elf, __sec, sizeof(*(hook))) ) \
|
||||
return -EINVAL; \
|
||||
hook = __sec->addr; \
|
||||
nhooks = __sec->sec->sh_size / sizeof(*hook); \
|
||||
nhooks = __sec->sec->sh_size / sizeof(*(hook)); \
|
||||
} while (0)
|
||||
|
||||
static int prepare_payload(struct payload *payload,
|
||||
|
||||
+4
-4
@@ -203,7 +203,7 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */
|
||||
#define nh_16(mp, kp, nw, rh, rl) \
|
||||
{ int i; uint64_t th, tl; \
|
||||
rh = rl = 0; \
|
||||
for (i = 0; i < nw; i+= 2) { \
|
||||
for (i = 0; i < (nw); i+= 2) { \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i ],get64PE((mp)+i+1)+(kp)[i+1]);\
|
||||
ADD128(rh,rl,th,tl); \
|
||||
} \
|
||||
@@ -211,7 +211,7 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */
|
||||
#define nh_16_2(mp, kp, nw, rh, rl, rh1, rl1) \
|
||||
{ int i; uint64_t th, tl; \
|
||||
rh1 = rl1 = rh = rl = 0; \
|
||||
for (i = 0; i < nw; i+= 2) { \
|
||||
for (i = 0; i < (nw); i+= 2) { \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i ],get64PE((mp)+i+1)+(kp)[i+1]);\
|
||||
ADD128(rh,rl,th,tl); \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i+2],get64PE((mp)+i+1)+(kp)[i+3]);\
|
||||
@@ -223,7 +223,7 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */
|
||||
#define nh_vmac_nhbytes(mp, kp, nw, rh, rl) \
|
||||
{ int i; uint64_t th, tl; \
|
||||
rh = rl = 0; \
|
||||
for (i = 0; i < nw; i+= 8) { \
|
||||
for (i = 0; i < (nw); i+= 8) { \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i ],get64PE((mp)+i+1)+(kp)[i+1]);\
|
||||
ADD128(rh,rl,th,tl); \
|
||||
MUL64(th,tl,get64PE((mp)+i+2)+(kp)[i+2],get64PE((mp)+i+3)+(kp)[i+3]);\
|
||||
@@ -237,7 +237,7 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */
|
||||
#define nh_vmac_nhbytes_2(mp, kp, nw, rh, rl, rh1, rl1) \
|
||||
{ int i; uint64_t th, tl; \
|
||||
rh1 = rl1 = rh = rl = 0; \
|
||||
for (i = 0; i < nw; i+= 8) { \
|
||||
for (i = 0; i < (nw); i+= 8) { \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i ],get64PE((mp)+i+1)+(kp)[i+1]);\
|
||||
ADD128(rh,rl,th,tl); \
|
||||
MUL64(th,tl,get64PE((mp)+i )+(kp)[i+2],get64PE((mp)+i+1)+(kp)[i+3]);\
|
||||
|
||||
@@ -230,9 +230,9 @@ int fdt_next_subnode(const void *fdt, int offset);
|
||||
* literal.
|
||||
*/
|
||||
#define fdt_for_each_subnode(node, fdt, parent) \
|
||||
for (node = fdt_first_subnode(fdt, parent); \
|
||||
node >= 0; \
|
||||
node = fdt_next_subnode(fdt, node))
|
||||
for ((node) = fdt_first_subnode(fdt, parent); \
|
||||
(node) >= 0; \
|
||||
(node) = fdt_next_subnode(fdt, node))
|
||||
|
||||
/**********************************************************************/
|
||||
/* General functions */
|
||||
|
||||