Commit 85810c19 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rafael J. Wysocki

ASoC: Intel: catpt: Replace open coded variant of resource_intersection()

Since we have resource_intersection() helper, let's utilize it here.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f7499785
...@@ -22,17 +22,6 @@ void catpt_sram_free(struct resource *sram); ...@@ -22,17 +22,6 @@ void catpt_sram_free(struct resource *sram);
struct resource * struct resource *
catpt_request_region(struct resource *root, resource_size_t size); catpt_request_region(struct resource *root, resource_size_t size);
static inline bool catpt_resource_overlapping(struct resource *r1,
struct resource *r2,
struct resource *ret)
{
if (!resource_overlaps(r1, r2))
return false;
ret->start = max(r1->start, r2->start);
ret->end = min(r1->end, r2->end);
return true;
}
struct catpt_ipc_msg { struct catpt_ipc_msg {
union { union {
u32 header; u32 header;
......
...@@ -267,7 +267,7 @@ static int catpt_restore_fwimage(struct catpt_dev *cdev, ...@@ -267,7 +267,7 @@ static int catpt_restore_fwimage(struct catpt_dev *cdev,
r2.start = off; r2.start = off;
r2.end = r2.start + info->size - 1; r2.end = r2.start + info->size - 1;
if (!catpt_resource_overlapping(&r2, &r1, &common)) if (!resource_intersection(&r2, &r1, &common))
continue; continue;
/* calculate start offset of common data area */ /* calculate start offset of common data area */
off = common.start - r1.start; off = common.start - r1.start;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment