Skip to content

Useless owner assignment - #3548

Open
ukleinek wants to merge 3 commits into
analogdevicesinc:adsp-6.18.31-yfrom
ukleinek:useless-owner-assignment
Open

ukleinek wants to merge 3 commits into
analogdevicesinc:adsp-6.18.31-yfrom
ukleinek:useless-owner-assignment

Conversation

@ukleinek

Copy link
Copy Markdown
Collaborator

PR Description

This is just a drive-by cleanup that I noticed while working on the rpmsg driver.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

The two affected driver structs are passed to register_rpmsg_driver()
which takes care for assigning drv.owner. So the explicit assignment in
the driver is useless boilerplate and can be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
adi_rpmsg_driver is passed to module_platform_driver() which copes for
assigning .driver.owner overwriting the explicit initialisation.

So drop this useless assignment und thus reduce boilerplate.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
adi_wdt_driver is passed to module_platform_driver() which copes for
assigning .driver.owner overwriting the explicit initialisation.

So drop this useless assignment und thus reduce boilerplate.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty straight!

.owner = THIS_MODULE,
#if defined(CONFIG_OF)
.of_match_table = of_match_ptr(adi_wdt_dt_ids),
#endif

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While at it, I guess we could also drop the useless #if defined(CONFIG_OF). Or one step further, of_match_ptr().

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I spotted that one, too, but it was shortly before the lunch break ... :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants