Re: [PATCH] serial: 8250: Optimize port function assignment with generic macro

From: Greg KH
Date: Thu Mar 06 2025 - 02:07:07 EST


On Thu, Mar 06, 2025 at 11:00:32AM +0800, xiaopeitux@xxxxxxxxxxx wrote:
> From: xiaopei01 <xiaopei01@xxxxxxxxxx>

Sorry, as per the documentation we need a name, not just an email alias.

> Refactor repetitive conditional function pointer assignments using a
> generic macro ASSIGN_IF_EXIST. This consolidates 15+ conditional
> checks into a consistent pattern while maintaining type safety.

But why? Macros are a pain and hide what is happening here. Do you
think this makes the code more maintainable over time? Does it fix any
existing bugs?

thanks,

greg k-h