support for VGA devices on I/O hoses other than 0 in the Alpha archit… #1148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Null Pointer Checks:
Added checks to ensure that critical pointers, such as hwrpb and pu64, are not null, preventing runtime failures.
Use of Macros for Constants:
Replaced hardcoded values (such as 0x3C0 and 0x3DF) with macros (VGA_IO_START and VGA_IO_END), improving readability and facilitating future changes.
Simplification of the default_vga_hose_select Function:
The function was simplified to a single line, making it more concise and easier to understand.
Error Checking in request_resource:
Added a check to ensure that the I/O resource is successfully allocated. If not, an error message is displayed, and the function returns early.
Use of Appropriate Log Levels:
Log messages were updated to use appropriate levels (KERN_ERR for errors and KERN_INFO for informational messages), facilitating debugging and monitoring.
Structuring the for Loop in locate_and_init_vga:
The loop that iterates over PCI devices was simplified, improving readability and reducing code complexity.
Addition of const for Function Pointers:
The function pointer sel_func was marked as const to indicate that it does not modify the pointed data, increasing code safety.
Resource Verification and Error Handling:
Added additional checks to ensure that necessary resources are available before proceeding with VGA initialization.
OBS: I unfortunately could not test at the moment