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: <1301006945.29444.15.camel@Joe-Laptop>
Date:	Thu, 24 Mar 2011 15:49:05 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jiri Kosina <trivial@...nel.org>
Cc:	linux-arm-kernel@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org, linux-watchdog@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
	linux-fbdev@...r.kernel.org
Subject: Re: [PATCH 0/2] Fix resource size miscalculations

On Wed, 2011-03-23 at 12:55 -0700, Joe Perches wrote:
> Use resource_size a few places

Perhaps this relatively common error is too common.
It seems to be poor style.  A possible better style for
struct resource uses could be inline function(s) like:

static inline void __iomem *resource_ioremap(struct resource *r)
{
	return ioremap(r->start, resource_size(r));
}

and maybe

static inline struct resource *
resource_request_region(struct resource *r, const char *name)
{
	return __request_region(&ioport_resource, r->start, resource_size(r), name, 0);
}


--
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