From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 626F7C433F5 for ; Sun, 13 Feb 2022 21:33:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A18A83504; Sun, 13 Feb 2022 22:33:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="tMUhf7de"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8ABFE83059; Sun, 13 Feb 2022 22:33:24 +0100 (CET) Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B246A83B9C for ; Sun, 13 Feb 2022 22:33:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 392F31409CF; Sun, 13 Feb 2022 22:33:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1644788001; bh=tA68Mq4NBl/gkmpMoW9aii/uDnZDf97xqFm4H1KlMxw=; h=Date:From:To; b=tMUhf7des68YDLvqmfDYgruA7rEwZuvKLRgDa0v+6QauKw5sjqPbMI8y+2gC5ZsIU P9IKqheYLvIWoc9qI+l5UbInfNzPsdj67s569nMxGg6/1XbNjZmBdYnPfrf0S6COtB d4WO2la6s0nw4c19jfc60nP63FKS/M/ygz3hWKeE= Date: Sun, 13 Feb 2022 22:33:20 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Tony Dinh , U-Boot Mailing List , Stefan Roese , Tom Rini Subject: Re: kwboot: Marvell Dove UART booting Message-ID: <20220213223320.762bc6c4@thinkpad> In-Reply-To: <20220213212310.ugq7uye4rhnhak5z@pali> References: <20220213161642.ez37c3csppqvh7ca@pali> <20220213194108.g6dwbbrwdsg2xa5d@pali> <20220213221509.70e93cfd@thinkpad> <20220213212310.ugq7uye4rhnhak5z@pali> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Sun, 13 Feb 2022 22:23:10 +0100 Pali Roh=C3=A1r wrote: > > In that case the whole ternary operator can be dropped, i.e. instead of > > ((hdr->ext > 1) ? (hdr->ext * 0x20) : 0) > > you can have > > ((hdr->ext - 1) * 0x20) > > if I interpret this correctly. =20 >=20 > No, it cannot be dropped, with correction it is: >=20 > ((hdr->ext > 1) ? ((hdr->ext - 1) * 0x20) : 0) >=20 > When hdr->ext is zero, result must be also 0, not (uint8_t)-1 * 0x20. Oh, so hdr->ext can be zero. OK. So you can drop at least the "> 1": hdr->ext ? ((hdr->ext - 1) * 0x20) : 0 but that is almost as horrible as with "> 1", so you can keep it if you want :) Marek