Skip to content

Conversation

@nunojsa
Copy link
Collaborator

@nunojsa nunojsa commented Aug 4, 2025

PR Description

Some 32bits architectures (like those in RPIs) support LPAE (Large Physical Address Extension) which means phys_addr_t will be of 'u64' type. Therefore we can have some int-to-pointer-cast warnings if not properly casting (in calls like virt_to_page()). Hence, first cast to uintptr_t before doing (void *).

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 tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly (if there is the case)

Some 32bits architectures (like those in RPIs) support
LPAE (Large Physical Address Extension) which means phys_addr_t will
be of 'u64' type. Therefore we can have some int-to-pointer-cast warnings
if not properly casting (in calls like virt_to_page()). Hence, first cast
to uintptr_t before doing (void *).

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

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

This warning is funny :)

    if (inode == NULL)
    {
        MW_DBG_text("INODE is NULL\n"); // hum something is not right...
    }
    // ... proceeds to immediately de-reference it
    mw_ip_info = container_of(inode->i_cdev, struct mathworks_ip_info, cdev);

https://github.com/analogdevicesinc/linux/pull/2874/files#diff-fbbc158191c1d5a1487f42bad262c84a0b52271f6f0715f74344bd2793e59a6bR58-R62

@nunojsa nunojsa merged commit 8134300 into main Aug 5, 2025
19 checks passed
@nunojsa nunojsa deleted the staging/mathworks-fix branch August 5, 2025 07:49
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.

4 participants