diff mbox series

[2/5] drm/i915/bios: Round PCI ROM VBT allocation to multiple of 4

Message ID 20240910134219.28479-3-ville.syrjala@linux.intel.com (mailing list archive)
State New
Headers show
Series drm/i915/bios: Refactor ROM access | expand

Commit Message

Ville Syrjälä Sept. 10, 2024, 1:42 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The SPI code rounds the VBT allocation to a multiple of four bytes
(presumably because it reads the VBT 4 bytes at a time). Do the
same for the PCI ROM side to eliminate pointless differences between
the two codepaths. This will make no functional difference.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula Sept. 12, 2024, 11:57 a.m. UTC | #1
On Tue, 10 Sep 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The SPI code rounds the VBT allocation to a multiple of four bytes
> (presumably because it reads the VBT 4 bytes at a time). Do the
> same for the PCI ROM side to eliminate pointless differences between
> the two codepaths. This will make no functional difference.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 86b81fd23f58..cc4a4cc2bf3e 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -3166,7 +3166,7 @@ static struct vbt_header *oprom_get_vbt(struct intel_display *display,
>  	}
>  
>  	/* The rest will be validated by intel_bios_is_valid_vbt() */
> -	vbt = kmalloc(vbt_size, GFP_KERNEL);
> +	vbt = kmalloc(round_up(vbt_size, 4), GFP_KERNEL);
>  	if (!vbt)
>  		goto err_unmap_oprom;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 86b81fd23f58..cc4a4cc2bf3e 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -3166,7 +3166,7 @@  static struct vbt_header *oprom_get_vbt(struct intel_display *display,
 	}
 
 	/* The rest will be validated by intel_bios_is_valid_vbt() */
-	vbt = kmalloc(vbt_size, GFP_KERNEL);
+	vbt = kmalloc(round_up(vbt_size, 4), GFP_KERNEL);
 	if (!vbt)
 		goto err_unmap_oprom;