lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110123130636.GA23058@www.tglx.de>
Date:	Sun, 23 Jan 2011 18:36:36 +0530
From:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:	Grant Likely <grant.likely@...retlab.ca>
Cc:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	linux-kernel@...r.kernel.org, sodaville@...utronix.de,
	x86@...nel.org, devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH 04/15] x86/dtb: add irq domain abstraction

* Grant Likely | 2011-01-11 15:03:17 [-0700]:

>>  unsigned int irq_create_of_mapping(struct device_node *controller,
>>  		const u32 *intspec, unsigned int intsize)
>>  {
>> -	return intspec[0];
>> +	struct irq_domain *ih;
>> +	u32 virq;
>> +	u32 type;
>> +	int ret;
>>  
>> +	ih = get_ih_from_node(controller);
>> +	if (!ih)
>> +		return -ENODEV;
>
>Return value is an unsigned int.  0 or NO_IRQ is the correct thing to
>return if an IRQ cannot be mapped.
fixed.

>> +	ret = ih->xlate(ih, intspec, intsize, &virq, &type);
>> +	if (ret)
>> +		return ret;
>
>Ditto here.  xlate is also supposed to return a virq number, not an
>error code, so the failure condition must be "if (!ret)" or
are you sure on that? The relevant part of powerpc's
irq_create_of_mapping() looks like:

| if (host->ops->xlate(host, controller, intspec, intsize,
|                           &hwirq, &type))
|       return NO_IRQ;

so xlate here returns 0 on success and hwirq via a pointer. I do the
same thing here except I return directly virq instead of
irq_hw_number_t. I add powerpc's irq_create_mapping() including virq <->
hwirq mapping once it is generic. I shouldn't need unless we use
non-ioapics are irq controllers.

>"if (reg == NO_IRQ)".  The former is preferred since we're trying to
>eliminate references to NO_IRQ, not add more of them.
Okay. So try to get rid of NO_IRQ in my series.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ