Skip to content

Remove superfluous check from null_ptr_check#9

Open
niederha wants to merge 1 commit intoboschsensortec:masterfrom
niederha:fix_null_ptr_check
Open

Remove superfluous check from null_ptr_check#9
niederha wants to merge 1 commit intoboschsensortec:masterfrom
niederha:fix_null_ptr_check

Conversation

@niederha
Copy link
Copy Markdown

The null_ptr_check() function checks that dev.inft_ptr is not NULL, however, nowhere in the code it this pointer used.
Indeed dev.inf_ptr is only used in user defined functions: read, write and delay_us... hence if it is up to the user to use the pointer it should be up to the user to check it.

In the current state of things if the user doesn't want to use the pointer he would still have to assign it a value in order to pass the init, which is, imo, a bad practice.

Thus removing the check makes sense.

@niederha niederha changed the title Remove superfluous check form null_ptr_check Remove superfluous check from null_ptr_check Jun 10, 2021
@niederha
Copy link
Copy Markdown
Author

@boschsensortec Any update? I know this is but a detail, but it would help me clean some code to get this mr passer. And if it doesn't work for semantic reasons, I'd be curious to know why

@niederha niederha closed this Sep 16, 2021
@niederha niederha reopened this Sep 16, 2021
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.

1 participant