diff mbox series

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

Message ID 20201124095628.54373-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit 85810c1996db86451aa1d08c7de5c51cf8cf3aa3
Headers show
Series [v1] ASoC: Intel: catpt: Replace open coded variant of resource_intersection() | expand

Commit Message

Andy Shevchenko Nov. 24, 2020, 9:56 a.m. UTC
Since we have resource_intersection() helper, let's utilize it here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

Promised clean up for recently introduced helper.

This has dependency to the patches currently in linux-pm tree. Other than that
everything else is already in upstream. Hence, logically it's better to push
thru Rafael's tree than wait one more cycle.

 sound/soc/intel/catpt/core.h   | 11 -----------
 sound/soc/intel/catpt/loader.c |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)

Comments

Cezary Rojewski Nov. 24, 2020, 12:13 p.m. UTC | #1
On 2020-11-24 10:56 AM, Andy Shevchenko wrote:
> Since we have resource_intersection() helper, let's utilize it here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> 
> Promised clean up for recently introduced helper.
> 
> This has dependency to the patches currently in linux-pm tree. Other than that
> everything else is already in upstream. Hence, logically it's better to push
> thru Rafael's tree than wait one more cycle.
> 
>   sound/soc/intel/catpt/core.h   | 11 -----------
>   sound/soc/intel/catpt/loader.c |  2 +-
>   2 files changed, 1 insertion(+), 12 deletions(-)
> 

Thanks for the patch, Andy.

I hope you didn't get the impression I somehow forgotten about this : )
Wanted to make it part of "cleanup/code reduction" after addition of
last two missing features (fw traces + external module support).

Fixes and removal of lpt-specific code were the priority though.
As change is already here, I don't see any reason for delaying its
merge:

Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>

Regards,
Czarek
Rafael J. Wysocki Nov. 25, 2020, 3:49 p.m. UTC | #2
On Tue, Nov 24, 2020 at 1:13 PM Rojewski, Cezary
<cezary.rojewski@intel.com> wrote:
>

> On 2020-11-24 10:56 AM, Andy Shevchenko wrote:

> > Since we have resource_intersection() helper, let's utilize it here.

> >

> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> > ---

> >

> > Promised clean up for recently introduced helper.

> >

> > This has dependency to the patches currently in linux-pm tree. Other than that

> > everything else is already in upstream. Hence, logically it's better to push

> > thru Rafael's tree than wait one more cycle.

> >

> >   sound/soc/intel/catpt/core.h   | 11 -----------

> >   sound/soc/intel/catpt/loader.c |  2 +-

> >   2 files changed, 1 insertion(+), 12 deletions(-)

> >

>

> Thanks for the patch, Andy.

>

> I hope you didn't get the impression I somehow forgotten about this : )

> Wanted to make it part of "cleanup/code reduction" after addition of

> last two missing features (fw traces + external module support).

>

> Fixes and removal of lpt-specific code were the priority though.

> As change is already here, I don't see any reason for delaying its

> merge:

>

> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>


Applied as 5.11 material, thanks!
Andy Shevchenko Nov. 25, 2020, 4:10 p.m. UTC | #3
On Wed, Nov 25, 2020 at 04:49:39PM +0100, Rafael J. Wysocki wrote:
> On Tue, Nov 24, 2020 at 1:13 PM Rojewski, Cezary

> <cezary.rojewski@intel.com> wrote:


...

> Applied as 5.11 material, thanks!


Thanks!

There is one fix to the series [1]. But now I realized that I forgot to Cc
linux-acpi@. Do you want me resend it?


[1]: https://lore.kernel.org/lkml/20201119105327.89917-1-andriy.shevchenko@linux.intel.com/

-- 
With Best Regards,
Andy Shevchenko
Rafael J. Wysocki Nov. 25, 2020, 4:10 p.m. UTC | #4
On Wed, Nov 25, 2020 at 5:09 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>

> On Wed, Nov 25, 2020 at 04:49:39PM +0100, Rafael J. Wysocki wrote:

> > On Tue, Nov 24, 2020 at 1:13 PM Rojewski, Cezary

> > <cezary.rojewski@intel.com> wrote:

>

> ...

>

> > Applied as 5.11 material, thanks!

>

> Thanks!

>

> There is one fix to the series [1]. But now I realized that I forgot to Cc

> linux-acpi@. Do you want me resend it?


Yes, please!
Andy Shevchenko Nov. 25, 2020, 4:18 p.m. UTC | #5
On Wed, Nov 25, 2020 at 05:10:50PM +0100, Rafael J. Wysocki wrote:
> On Wed, Nov 25, 2020 at 5:09 PM Andy Shevchenko

> <andriy.shevchenko@linux.intel.com> wrote:

> > On Wed, Nov 25, 2020 at 04:49:39PM +0100, Rafael J. Wysocki wrote:


...

> > There is one fix to the series [1]. But now I realized that I forgot to Cc

> > linux-acpi@. Do you want me resend it?

> 

> Yes, please!


Done! Sent as v2.

-- 
With Best Regards,
Andy Shevchenko
Mark Brown Dec. 1, 2020, 1:57 p.m. UTC | #6
On Tue, 24 Nov 2020 11:56:28 +0200, Andy Shevchenko wrote:
> Since we have resource_intersection() helper, let's utilize it here.


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Intel: catpt: Replace open coded variant of resource_intersection()
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Andy Shevchenko Dec. 1, 2020, 6:33 p.m. UTC | #7
On Tue, Dec 01, 2020 at 01:57:56PM +0000, Mark Brown wrote:
> On Tue, 24 Nov 2020 11:56:28 +0200, Andy Shevchenko wrote:

> > Since we have resource_intersection() helper, let's utilize it here.

> 

> Applied to

> 

>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

> 

> Thanks!

> 

> [1/1] ASoC: Intel: catpt: Replace open coded variant of resource_intersection()

>       (no commit info)


As I mentioned in the comment (after --- line) the patch relies on the stuff in
linux-pm tree. Do you have any immutable branch pulled? Otherwise Rafael
already took it where it won't break compilation.

-- 
With Best Regards,
Andy Shevchenko
Mark Brown Dec. 2, 2020, 12:28 p.m. UTC | #8
On Tue, Dec 01, 2020 at 08:33:29PM +0200, Andy Shevchenko wrote:

> As I mentioned in the comment (after --- line) the patch relies on the stuff in

> linux-pm tree. Do you have any immutable branch pulled? Otherwise Rafael

> already took it where it won't break compilation.


b4 had a bug which caused it to send thanks for every patch I'd ever
downloaded but not applied, the "no commit info" means there wasn't an
actual matching commit.  I'd been going to review it but then it got
applied anyway.
diff mbox series

Patch

diff --git a/sound/soc/intel/catpt/core.h b/sound/soc/intel/catpt/core.h
index 0f53a0d43254..a64a0a77dcb7 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 40c22e4bb263..ff7b8f0d34ac 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;