Re: [PATCH v1 2/7] resource: Group resource_overlaps() with other inline helpers

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

 



On Thu, Aug 13, 2020 at 7:57 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> For better maintenance group resource_overlaps() with other inline helpers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
>  include/linux/ioport.h | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index 6c2b06fe8beb..0193987b9968 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -226,6 +226,11 @@ static inline bool resource_contains(struct resource *r1, struct resource *r2)
>         return r1->start <= r2->start && r1->end >= r2->end;
>  }
>
> +/* True if any part of r1 overlaps r2 */
> +static inline bool resource_overlaps(struct resource *r1, struct resource *r2)
> +{
> +       return (r1->start <= r2->end && r1->end >= r2->start);

The redundant parens can be dropped while at it.

> +}
>
>  /* Convenience shorthand with allocation */
>  #define request_region(start,n,name)           __request_region(&ioport_resource, (start), (n), (name), 0)
> @@ -291,12 +296,6 @@ extern int
>  walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end,
>                     void *arg, int (*func)(struct resource *, void *));
>
> -/* True if any part of r1 overlaps r2 */
> -static inline bool resource_overlaps(struct resource *r1, struct resource *r2)
> -{
> -       return (r1->start <= r2->end && r1->end >= r2->start);
> -}
> -
>  struct resource *devm_request_free_mem_region(struct device *dev,
>                 struct resource *base, unsigned long size);
>  struct resource *request_free_mem_region(struct resource *base,
> --
> 2.28.0
>



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux