Commit 8d4eba1d authored by Federico Vaga's avatar Federico Vaga

kernel: do not use statement-scope variable

When possible, avoid statement-scope variable for a better maintanability
of the code.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 588b7781
......@@ -150,11 +150,11 @@ static int spec_irq_request(struct fmc_device *fmc, irq_handler_t handler,
char *name, int flags)
{
struct spec_dev *spec = fmc->carrier_data;
int rv;
int rv, first_time;
/* VIC mode interrupt */
if (!(flags & IRQF_SHARED)) {
int first_time = !spec->vic;
first_time = !spec->vic;
/* configure the VIC */
rv = spec_vic_irq_request(spec, fmc, fmc->irq, handler);
......@@ -207,13 +207,12 @@ static void spec_irq_ack(struct fmc_device *fmc)
/* Nothing for VIC here, all irqs are acked by master VIC handler */
}
static int spec_shared_irq_free(struct fmc_device *fmc)
static void spec_shared_irq_free(struct fmc_device *fmc)
{
struct spec_dev *spec = fmc->carrier_data;
gennum_writel(spec, 0xffff, GNGPIO_INT_MASK_SET); /* disable */
free_irq(spec->pdev->irq, fmc);
return 0;
}
static int spec_irq_free(struct fmc_device *fmc)
......@@ -228,7 +227,7 @@ static int spec_irq_free(struct fmc_device *fmc)
* release the PCI IRQ handler
*/
if (!spec->vic)
return spec_shared_irq_free(fmc);
spec_shared_irq_free(fmc);
return 0;
}
......
......@@ -196,12 +196,11 @@ void spec_vic_irq_free(struct spec_dev *spec, unsigned long id)
int i;
for (i = 0; i < VIC_MAX_VECTORS; i++) {
uint32_t vec = spec->vic->vectors[i].saved_id;
if (vec == id) {
if (spec->vic->vectors[i].saved_id == id) {
spin_lock(&spec->vic->vec_lock);
vic_writel(spec->vic, 1 << i, VIC_REG_IDR);
vic_writel(spec->vic, vec, VIC_IVT_RAM_BASE + 4 * i);
vic_writel(spec->vic, id, VIC_IVT_RAM_BASE + 4 * i);
spec->vic->vectors[i].handler = NULL;
spin_unlock(&spec->vic->vec_lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment