[tip:irq/core 9/9] kernel/irq/irq_sim.c:173:12: error: expected expression

From: kernel test robot
Date: Sat Jan 27 2024 - 23:50:25 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
head: 590610d72a790458431cbbebc71ee24521533b5e
commit: 590610d72a790458431cbbebc71ee24521533b5e [9/9] genirq/irq_sim: Shrink code by using cleanup helpers
config: x86_64-rhel-8.3-bpf (https://download.01.org/0day-ci/archive/20240128/202401281222.T75XK3kV-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240128/202401281222.T75XK3kV-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401281222.T75XK3kV-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> kernel/irq/irq_sim.c:173:12: error: expected expression
173 | pending = __free(bitmap) = bitmap_zalloc(num_irqs, GFP_KERNEL);
| ^
include/linux/cleanup.h:64:23: note: expanded from macro '__free'
64 | #define __free(_name) __cleanup(__free_##_name)
| ^
include/linux/compiler-clang.h:15:25: note: expanded from macro '__cleanup'
15 | #define __cleanup(func) __maybe_unused __attribute__((__cleanup__(func)))
| ^
include/linux/compiler_attributes.h:344:41: note: expanded from macro '__maybe_unused'
344 | #define __maybe_unused __attribute__((__unused__))
| ^
1 error generated.


vim +173 kernel/irq/irq_sim.c

153
154 /**
155 * irq_domain_create_sim - Create a new interrupt simulator irq_domain and
156 * allocate a range of dummy interrupts.
157 *
158 * @fwnode: struct fwnode_handle to be associated with this domain.
159 * @num_irqs: Number of interrupts to allocate.
160 *
161 * On success: return a new irq_domain object.
162 * On failure: a negative errno wrapped with ERR_PTR().
163 */
164 struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode,
165 unsigned int num_irqs)
166 {
167 struct irq_sim_work_ctx *work_ctx __free(kfree) = kmalloc(sizeof(*work_ctx), GFP_KERNEL);
168 unsigned long *pending;
169
170 if (!work_ctx)
171 return ERR_PTR(-ENOMEM);
172
> 173 pending = __free(bitmap) = bitmap_zalloc(num_irqs, GFP_KERNEL);
174 if (!pending)
175 return ERR_PTR(-ENOMEM);
176
177 work_ctx->domain = irq_domain_create_linear(fwnode, num_irqs,
178 &irq_sim_domain_ops,
179 work_ctx);
180 if (!work_ctx->domain)
181 return ERR_PTR(-ENOMEM);
182
183 work_ctx->irq_count = num_irqs;
184 work_ctx->work = IRQ_WORK_INIT_HARD(irq_sim_handle_irq);
185 work_ctx->pending = no_free_ptr(pending);
186
187 return no_free_ptr(work_ctx)->domain;
188 }
189 EXPORT_SYMBOL_GPL(irq_domain_create_sim);
190

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki