diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-11-24 10:56:28 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-11-25 16:48:26 +0100 |
commit | 85810c1996db86451aa1d08c7de5c51cf8cf3aa3 (patch) | |
tree | ec661bf84868b2da06449645ee398c00509a75c6 /sound | |
parent | ACPI: watchdog: Replace open coded variant of resource_union() (diff) | |
download | linux-85810c1996db86451aa1d08c7de5c51cf8cf3aa3.tar.xz linux-85810c1996db86451aa1d08c7de5c51cf8cf3aa3.zip |
ASoC: Intel: catpt: Replace open coded variant of resource_intersection()
Since we have resource_intersection() helper, let's utilize it here.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/intel/catpt/core.h | 11 | ||||
-rw-r--r-- | sound/soc/intel/catpt/loader.c | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/sound/soc/intel/catpt/core.h b/sound/soc/intel/catpt/core.h index 88dc3fb6306f..174ee5ad138b 100644 --- a/sound/soc/intel/catpt/core.h +++ b/sound/soc/intel/catpt/core.h @@ -22,17 +22,6 @@ void catpt_sram_free(struct resource *sram); struct resource * 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 { union { u32 header; diff --git a/sound/soc/intel/catpt/loader.c b/sound/soc/intel/catpt/loader.c index 8a5f20abcadb..dbbbf15dded3 100644 --- a/sound/soc/intel/catpt/loader.c +++ b/sound/soc/intel/catpt/loader.c @@ -267,7 +267,7 @@ static int catpt_restore_fwimage(struct catpt_dev *cdev, r2.start = off; r2.end = r2.start + info->size - 1; - if (!catpt_resource_overlapping(&r2, &r1, &common)) + if (!resource_intersection(&r2, &r1, &common)) continue; /* calculate start offset of common data area */ off = common.start - r1.start; |