From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2621C15ADBF; Wed, 10 Apr 2024 16:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766565; cv=none; b=o7a9b2h1vww+M5ZUttEXH7O00dDKPabwg660/D43XZQqPjcPJ2u+KJufugeBW11+Lwe92WOQHy7mW3srXUBehoX9fnWu3lx2pqduvpv0neR3a3zH/RvXprud9p/TWKDY5oo9GNzXCllHCUhTD1Fy5LCYScVurE7ATRLhQt5ga6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766565; c=relaxed/simple; bh=YSAPIOtYNplSycjf3v7XSTEn1r+NDjIrTJDrbvJR6wQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DSwwGr6g8CXPJmYzVSmFJA7IgeUryVwdMnkqGtw88RdTA/io4qVlbMzLdV6XZ+Sfz9saRakrra90f5tPe/YM9ps2nH1w5RID5kpQIl6xRCE/8wlDQmVfvghdFE2FkFgkNquy2InEO/ZTMM0JeQvq5iS9NuXBNzQ496jwRJTCr/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hfoDkDZm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hfoDkDZm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5E97C433F1; Wed, 10 Apr 2024 16:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712766564; bh=YSAPIOtYNplSycjf3v7XSTEn1r+NDjIrTJDrbvJR6wQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hfoDkDZmkfM1oz64jIu5UjxX41RaJQV5t+KnioNgququptp/uL1Ngg3yuFw1jrM/Y Avy/wg6bFnwXimgGm2fPCTdKORiXvuF0RWNGJpH7/YgrC40a9EBz0Xs9rieevLBPMt bma23ZzR1JhK3g7R4/R7mMGL+wxGQLxJi8gjMnNQUoXxG/jNS4IWef++uCTdR6yZDo gUchAkh8ExprvWjL093grl2C0CGwdLVq5zlN4LWAxGkyJqKPKaHzA4mUkFeDkTUMJn BooX7ewcIzpZI91f2IykdEFzrSV9im+noRy4iUgJCnXr0dJ62xpQ84nyIc7gkUpzpU XPDKOkCeDKp6A== Date: Wed, 10 Apr 2024 18:29:19 +0200 From: Alexey Gladkov To: Jiri Slaby Cc: Greg Kroah-Hartman , LKML , kbd@lists.linux.dev, linux-api@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-serial@vger.kernel.org, Helge Deller Subject: Re: [RESEND PATCH v3 1/2] VT: Add KDFONTINFO ioctl Message-ID: References: <74ca50e0-61b1-4d4c-85dd-a5d920548c04@kernel.org> <6bb4f4fb-573c-4f63-967c-2cb08514fc91@kernel.org> Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6bb4f4fb-573c-4f63-967c-2cb08514fc91@kernel.org> On Wed, Apr 03, 2024 at 07:27:55AM +0200, Jiri Slaby wrote: > On 02. 04. 24, 15:19, Alexey Gladkov wrote: > >>> --- a/include/uapi/linux/kd.h > >>> +++ b/include/uapi/linux/kd.h > ... > >>> +struct console_font_info { > >>> + unsigned int min_width, min_height; /* minimal font size */ > >>> + unsigned int max_width, max_height; /* maximum font size */ > >>> + unsigned int flags; /* KD_FONT_INFO_FLAG_* */ > >> > >> This does not look like a well-defined™ and extendable uapi structure. > >> While it won't change anything here, still use fixed-length __u32. > >> > >> And you should perhaps add some reserved fields. Do not repeat the same > >> mistakes as your predecessors with the current kd uapi. > > > > I thought about it, but I thought it would be overengineering. > > It would not. UAPI structs are set in stone once released. > > And in this case, it's likely you would want to know more info about > fonts in the future. > > > Can you suggest how best to do this? > > Given you have flags in there already (to state that the structure > contains more), just add an array of u32 reserved[] space. 3 or 5, I > would say (to align the struct to 64bit). struct console_font_info { __u32 min_width, min_height; /* minimal font size */ __u32 max_width, max_height; /* maximum font size */ __u32 flags; /* KD_FONT_INFO_FLAG_* */ __u32 reserved[5]; /* This field is reserved forfuture use. Must be 0. */ }; So, struct should be like this ? I wouldn't add the version to the flags. Maybe it would be better to add a separate field with the version? -- Rgrds, legion