Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Linux uses inclusive sta...



details:   https://anonhg.NetBSD.org/src/rev/972ebf5cee2d
branches:  trunk
changeset: 1028012:972ebf5cee2d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:38:58 2021 +0000

description:
Linux uses inclusive start/end, not start/size. Match.

diffstat:

 sys/external/bsd/drm2/include/linux/ioport.h |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 840e0c8b1af3 -r 972ebf5cee2d sys/external/bsd/drm2/include/linux/ioport.h
--- a/sys/external/bsd/drm2/include/linux/ioport.h      Sun Dec 19 01:38:51 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/ioport.h      Sun Dec 19 01:38:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioport.h,v 1.3 2021/12/19 01:35:04 riastradh Exp $     */
+/*     $NetBSD: ioport.h,v 1.4 2021/12/19 01:38:58 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 struct resource {
        bus_addr_t start;
-       bus_size_t size;
+       bus_addr_t end;         /* WARNING: Inclusive! */
        const char *name;
        unsigned int flags;
        bus_space_tag_t r_bst;  /* This milk is not organic.  */
@@ -50,13 +50,14 @@
 static inline bus_size_t
 resource_size(struct resource *resource)
 {
-       return resource->size;
+       return resource->end - resource->start + 1;
 }
 
 static inline void
 release_resource(struct resource *resource)
 {
-       bus_space_free(resource->r_bst, resource->r_bsh, resource->size);
+       bus_space_free(resource->r_bst, resource->r_bsh,
+           resource_size(resource));
 }
 
 #endif  /* _LINUX_IOPORT_H_ */



Home | Main Index | Thread Index | Old Index