lkml.org 
[lkml]   [2008]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 38/54] PNP: remove PNP_MAX_* uses
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.


\
 
 \ /
  Last update: 2008-04-27 00:13    [W:0.227 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site