From nobody Sat Apr 27 20:21:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1529354968857419.94704989097306; Mon, 18 Jun 2018 13:49:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3F25721103DCD; Mon, 18 Jun 2018 13:49:25 -0700 (PDT) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A6A82210FC361 for ; Mon, 18 Jun 2018 13:49:23 -0700 (PDT) Received: by mail-wr0-x242.google.com with SMTP id e18-v6so18236111wrs.5 for ; Mon, 18 Jun 2018 13:49:23 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:50d8:cb10:b6d:abf0]) by smtp.gmail.com with ESMTPSA id t10-v6sm15130164wrq.74.2018.06.18.13.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 13:49:20 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=M+yksFsRvSv6WIoSuWp7TArclNAyv1Op3UW0ccwIdqs=; b=eU1q3iPl83xuhZ9ipukfxkwRGylUpih0wF3kHD2ztIXlZzgSkB1QHoInieoNPaMBG/ 1NX1Oxy1OK2nyiZ5boqtVXkkaPrD+3cDfSm7PU3qPm44meHWjhp5MgOpldlodqfFV/g3 P6bSid57Ix4Bz0eeN7kk0+nd5FLi2w9a+eugk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M+yksFsRvSv6WIoSuWp7TArclNAyv1Op3UW0ccwIdqs=; b=oQYMrXzE0JhNyMF439EiD8XrfJMxp7AlehTyCriWN0LgMcpBYIEm3oaRI2BKYKWJGe EWzbFUnX5zsS7SEyvr2O9W+i6HP5skZAdH9x6xyOmpLxABcXdM1sG0vN8c1q+tbQxZNR H5t44zc1L0CNuU7T54rD6NNp0BCEUvA5zhSYv7vgTMcZlOr6rV46wnxaO+ChHOFpk12Z XG89TR6rKsKSnS2nStmnO9/MncmQVtNBXOrR7fsNI2EmYu3Cd63zdo1fsRNDL/JPigY9 lJ7mDj5a2jnjVbJKiG4KGVjC20LoQfzZNORvtb4/gfaA4SnJ6naRzc3YMn6PGZtb4Sjv 8jug== X-Gm-Message-State: APt69E1ooJx8R1aQzaT62HgGWRLIx6FwG0GVs5i+FwSqA6sNFoueDBhc XXSmbLJquYcXBH21Zx6c8G5LeGpc4ns= X-Google-Smtp-Source: ADUXVKLZrZWEySpI6sohgUd9mTk/mvhX4kz+8TWxI/FNII867WQxXiugkpdwyZaSza9df064RFqHFQ== X-Received: by 2002:adf:ba8f:: with SMTP id p15-v6mr12381751wrg.139.1529354961762; Mon, 18 Jun 2018 13:49:21 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 18 Jun 2018 22:49:18 +0200 Message-Id: <20180618204918.31835-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [edk2] [PATCH] EmbeddedPkg/GdbSerialLib: avoid left shift of negative quantity X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Clang complains about left shifting a negative value being undefined. EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c:151:30: error: shifting a negative signed value is undefined [-Werror,-Wshift-neg= ative-value] OutputData =3D (UINT8)((~DLAB<<7)|((BreakSet<<6)|((Parity<<3)|((StopBits<= <2)| Data)))); Redefine all bit pattern constants as unsigned to work around this. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c b/EmbeddedPkg/= Library/GdbSerialLib/GdbSerialLib.c index 069d87ca780d..7931d1ac4e2b 100644 --- a/EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c +++ b/EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c @@ -40,11 +40,11 @@ //--------------------------------------------- // UART Register Bit Defines //--------------------------------------------- -#define LSR_TXRDY 0x20 -#define LSR_RXDA 0x01 -#define DLAB 0x01 -#define ENABLE_FIFO 0x01 -#define CLEAR_FIFOS 0x06 +#define LSR_TXRDY 0x20U +#define LSR_RXDA 0x01U +#define DLAB 0x01U +#define ENABLE_FIFO 0x01U +#define CLEAR_FIFOS 0x06U =20 =20 =20 --=20 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel