Re: [PATCH v2] staging: sm750fb: Remove redundant NULL and zero assignments in probe

From: Greg KH

Date: Fri Nov 20 2026 - 02:12:00 EST


On Mon, Oct 19, 2026 at 11:20:15PM +0300, Temitope obabi wrote:
> The sm750_dev structure is allocated with devm_kzalloc() just above,
> so its memory is already zeroed. Remove the explicit NULL assignments
> to fbinfo[0] and fbinfo[1] and the zero assignment to mtrr.vram, which
> only set fields that are already zero.
>
> Signed-off-by: Temitope obabi <obabitemitope765@xxxxxxxxx>
>
> ---
> Changes in v2:
> - Remove an accidental duplicate of the note at the end of the patch.
> No code changes.
>
> Note: Greg replied to my earlier sm750fb patch that keeping the
> explicit zero assignments is good because it is clear what is
> happening. In that patch the allocation was in a different function.
> Here the assignments are in lynxfb_pci_probe(), just after the
> devm_kzalloc() call and its NULL check, so I think removing them may
> still be useful.

Let's leave them as-is, it's nice to be explicit at times.

thanks,

greg k-h