Re: [patch 38/54] PNP: remove PNP_MAX_* uses

From: Rene Herman
Date: Sat Apr 26 2008 - 18:10:29 EST


On 25-04-08 20:38, Bjorn Helgaas wrote:

+#define set(flags) ((flags & IORESOURCE_UNSET) == 0)
+
static ssize_t pnp_show_current_resources(struct device *dmdev,
struct device_attribute *attr,
char *buf)
{
struct pnp_dev *dev = to_pnp_dev(dmdev);
+ struct resource *res;
int i, ret;
pnp_info_buffer_t *buffer;
@@ -267,50 +270,46 @@
else
pnp_printf(buffer, "disabled\n");
- for (i = 0; i < PNP_MAX_PORT; i++) {
- if (pnp_port_valid(dev, i)) {
+ for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) {
+ if (set(res->flags)) {


You've at this point already introduced the pnp_resource_valid() inline. Use here maybe? (also other locations here)

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