Re: [PATCH net-next 2/6] tools: ynl-gen: refactor render-max enum generation
From: Asbjørn Sloth Tønnesen
Date: Tue Oct 14 2025 - 13:29:49 EST
On 10/14/25 12:58 AM, Jakub Kicinski wrote:
On Mon, 13 Oct 2025 16:49:59 +0000 Asbjørn Sloth Tønnesen wrote:
+ suffix = yaml['type'] == 'flags' and 'mask' or 'max'
This construct looks highly non-pythonic to me
I don't mind changing it to it's multi-line form, but this line might go
away (see below).
+ self.enum_max_name = f'{self.value_pfx}{suffix}'
sometimes its max sometimes is mask, so we shouldn't call it max always
I'm fine with splitting them to render-max, enum-max-name, render-mask and
enum-mask-name. I was just following along the current lines in the code,
as started in commit 96a611b6b60c.