Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1037208rwr; Thu, 20 Apr 2023 09:10:12 -0700 (PDT) X-Google-Smtp-Source: AKy350ZjigRypCJ/+D4SkI8pIxi2oPl6hHjZ3c1Pucl+TDCDuIfnG/4MeR95vETNRz4pSeXgdHYT X-Received: by 2002:a05:6a00:24c6:b0:5a8:b2bf:26ac with SMTP id d6-20020a056a0024c600b005a8b2bf26acmr2246417pfv.20.1682007011884; Thu, 20 Apr 2023 09:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682007011; cv=none; d=google.com; s=arc-20160816; b=sVIkpSG5SK4O/43BI1atZwPsKD/PpeouCwNeISAlZrZFA/Tv5s9yWTHVMChOv517qC uq7ia8Gt1JFlik3r6hrkcONM/hC4EM94I14uYNmHprRVgrdbbddw3hXVWhhBqwPL+2Q0 8ykX+w8h0m0qslCxBMzNIuUjTEikd1ck8bbH1sUumgk/jY5bwTesUbYsNkR56+4vj7xr 6HutVqRMFNKOB72U27zJbSwW5UA81ykVKNphlZwTLl7VW+BEfrKDQGWg+9aV5ir8TZSo gwq8ZEtN39JiYWOZHd8S6WU6UYQ4y4qWgW9c2X3DgpjAt79o2oJpLfEUBtAVOhU96us6 rcxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:importance:content-transfer-encoding :mime-version:user-agent:cc:to:from:subject:date:references :in-reply-to:message-id:dkim-signature; bh=bN5ETqCZo/MCyKzP+lGWtahmDUBGMed3dw/aq/PvXz4=; b=0gDOoi/ezNfSCmieW57TDqqaNL1em3WD+C5bsE55KY5J+aVCyYa2ktNgOfNyQmSyRB wGeyKRzp20hwBb6UlOA+dRdoEOImqmqOv3Icq2C0X2/h7hx9UBEK8Ipq0ZXIQ6RdgG1p FfdOb1Ubx9auRwUxQyG5Qru7MH9Qhm661bQla2N4OgzfE+siuA4uBoxbHFnS51MADc6n qBjNA1EjMMlGahiZbusn9DxCU6Sycz2x+AAghkz0W+mw75RMWxjMgLhGGR7rWcjBA68w awvA00iB7PiU0VdwsrkW70nEsPsrUQH60qQk89LX/3ObBVJXY7E7a9Jj9XWQr/2kB+Bp CuQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@panix.com header.s=panix header.b="i+IL9/4W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=panix.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i19-20020aa796f3000000b0063b1739532esi1945002pfq.139.2023.04.20.09.09.57; Thu, 20 Apr 2023 09:10:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@panix.com header.s=panix header.b="i+IL9/4W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=panix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234459AbjDTQFe (ORCPT + 99 others); Thu, 20 Apr 2023 12:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234321AbjDTQFb (ORCPT ); Thu, 20 Apr 2023 12:05:31 -0400 Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4626422A for ; Thu, 20 Apr 2023 09:05:29 -0700 (PDT) Received: from mail.panix.com (localhost [127.0.0.1]) by mailbackend.panix.com (Postfix) with ESMTPA id 4Q2MvD2jWzz4Fxv; Thu, 20 Apr 2023 12:05:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1682006728; bh=EKV0LEfOfid5iH2xb19C4EKN8EQAQyvXH2/h/3MLTF4=; h=In-Reply-To:References:Date:Subject:From:To:Cc; b=i+IL9/4WQSGafLFxLiTR2M+bo95QoJhM4Og4otnXuaWjJWZfbU++6l6QUh75Gdq4B XD7IS0GIbVOPwSUfitDzrX5u7kofffpXjEyXgLqQJeNHI6TbajyER09A8DHCH5lg56 KtvmHfvkUvtEPvk2DdAxXFxhyB+CFAunSTJxCC5I= X-Panix-Received: from 166.84.1.2 (SquirrelMail authenticated user pa@panix.com) by mail.panix.com with HTTP; Thu, 20 Apr 2023 12:05:28 -0400 Message-ID: <29c370c79a9775398bcd0f111196f677.squirrel@mail.panix.com> In-Reply-To: <20230420155705.21463-1-pa@panix.com> References: <20230420155705.21463-1-pa@panix.com> Date: Thu, 20 Apr 2023 12:05:28 -0400 Subject: Re: [PATCH v3] firmware/sysfb: Fix VESA format selection From: "Pierre Asselin" To: "Pierre Asselin" Cc: dri-devel@lists.freedesktop.org, "Pierre Asselin" , "Javier Martinez Canillas" , "Thomas Zimmermann" , "Daniel Vetter" , "Ard Biesheuvel" , "Hans de Goede" , linux-kernel@vger.kernel.org User-Agent: SquirrelMail/1.4.23-p1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I went back to nested max3() after all as Thomas asked. My first cut had casts in the innermost max3() and the code looked truly awful. I decided that two casts are tolerable. I added a comment to explain the casts. Against clamp_t(u8,lfb_depth,1,32): the clamp_t() macro does no typechecking; might as well just cast lfb_depth to u8, but that assumes the value would fit (positively crazy if it doesn't, but still.) Instead, I widen the other two args of the outer max3(). --PA