Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp935500ybi; Wed, 17 Jul 2019 07:10:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLLKtLb+DhvU0GvearKXO256OPwspQUo8Rsca0ylleryHf1JSXLtFsIgmGfxJFt5jGpSD6 X-Received: by 2002:a17:902:3103:: with SMTP id w3mr44154678plb.84.1563372629594; Wed, 17 Jul 2019 07:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563372629; cv=none; d=google.com; s=arc-20160816; b=vm8qLzjhIEDf81N7V9JjwOC8un+TClZflsuGeX0DQr4XD9f7rlmLcaPnIjy7TR4X+P NNIp2PdUAX1GTkkQ9TTDbU0H2uQe7b+a9eGOt5KhmqzinVB/7NPGSN42rGr1xpFuDVIL YNzOUhawkgnlG4U7VEgF5QFGq8aWbgQ/Pdr3xt62CmNIQvGDWGtYpHgumXzItF0zxBSl L6DIwgia4Z/zFlKdQ7izmP0raU5TWI0uSOyaj1wwLXmMKCr4KKR500O6In7vwP2iHHtj xrKemCFqfcsJ5stf5/8grouog5biuTMwbBzNaL4lJi9EAAoM3IPDVS4lTcJYx0NxC/so pWzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:dkim-signature; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=0WX6lx/+BAcx5FX4R5rE0fPbrtclrJ8h+U0+It3QQKBplLB8UPz8MOdpOZERH9gxZw vBvoJJ99F/v3wo8MDqw+W6JSokWsy9ZpqPrfEXqJz9l827A/Wl3pWoP3n9EQrcjdcndj am/XJ5KBDKUZ1JagfJCLJum/jIKKGskUmP1mw/Po/ifLRpxZBTP1YyEdJGDRZ/oDp8c6 OJxbvkm+yd59lLCycOhrJYfrvgDWibWAjoxkGQ/JgkPS9qJjGUkbAilwIcJmbYcxfs0i 9jV2CcoegCWTuxMqW5hHRQSCYwZe1qcWjNYsYZO1AmizDZH09wBEZ2otn1nKEU6FcX0/ bZqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=dL4SEpTG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucsd.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si11127011pgi.116.2019.07.17.07.10.11; Wed, 17 Jul 2019 07:10:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=dL4SEpTG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucsd.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727507AbfGQOJh (ORCPT + 99 others); Wed, 17 Jul 2019 10:09:37 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:46297 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfGQOJh (ORCPT ); Wed, 17 Jul 2019 10:09:37 -0400 Received: by mail-lf1-f67.google.com with SMTP id z15so12303976lfh.13 for ; Wed, 17 Jul 2019 07:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eng.ucsd.edu; s=google; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=dL4SEpTGX/ngKWygtGkODclXiRzKgEWqnKQck8BeSRpLX8Fn6KUIfOiVffCGxmmswf Uxr1m/YoRjp+Xr1MOUM6Z2opsKK89UPwN+QgIOH3BgI/ZLYT2HZleUtgQtE33kmej2jh pAueIU+HMvy5AoCSMpL2koGDMdLXV1fLIuccM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=o6sLEWy5OzEbGHssuNByaT9brq5ratKygZ8f/Rz+VKblGtMCXBmvC5dqnhmfZuk6Ev k3GgczwV7VaPSK1mctyfaUuBeMQdtpI2MeoJ/LvAPAMYs1SVil2S/KrDI8gJa5q96Rhs 9+KJid6jPhcnVHm4izXnhpjoOXKVZhL2qek9jh2ERu+Pc2860oll0GpQNUHAvLL2bnei Jv3Mg3MkrOVQgh9PzDvYN9uvD+iLOujuGKJzIGciYoSGD2A0iHQMNxkhW9TqpTUqXB1u kDgUUZBlznlbQHGWsLjb0LbF35GGdaoqu4e82zS8hfOlqtaie23798uBAoa7sChSoOlH IFvA== X-Gm-Message-State: APjAAAUblaGUbB6oDY2dr1PA9jQn5qCxu/u/PQ+a0ZQBC2wxkDAcJ7BH Nr1FPyYVN49OYYNGSfKwF+TVGg== X-Received: by 2002:ac2:5bc7:: with SMTP id u7mr18342073lfn.167.1563372575327; Wed, 17 Jul 2019 07:09:35 -0700 (PDT) Received: from [192.168.1.2] (178-37-168-43.adsl.inetia.pl. [178.37.168.43]) by smtp.gmail.com with ESMTPSA id j3sm3485074lfp.34.2019.07.17.07.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jul 2019 07:09:34 -0700 (PDT) To: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org From: Luke Nowakowski-Krijger Subject: [PATCH v2 RESEND] media: dvb_frontend.h: Fix shifting signed 32-bit value problem Message-ID: <0d5dae7b-e6e5-27ea-ba6d-59065f0c6edf@eng.ucsd.edu> Date: Wed, 17 Jul 2019 07:09:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix DVBFE_ALGO_RECOVERY and DVBFE_ALGO_SEARCH_ERROR use BIT macro which fixes undefined behavior error by certain compilers. Also changed all other bit shifted definitions to use macro for better readability. Signed-off-by: Luke Nowakowski-Krijger --- Changes in V2: + Added BIT macro to all bit shifted definitions - Removed U cast on 31 bit shifted definition Changes in V1: + Added U cast to shifting 31 bits include/media/dvb_frontend.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/media/dvb_frontend.h b/include/media/dvb_frontend.h index f05cd7b94a2c..0d76fa4551b3 100644 --- a/include/media/dvb_frontend.h +++ b/include/media/dvb_frontend.h @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -141,10 +142,10 @@ struct analog_parameters { * These devices have AUTO recovery capabilities from LOCK failure */ enum dvbfe_algo { - DVBFE_ALGO_HW = (1 << 0), - DVBFE_ALGO_SW = (1 << 1), - DVBFE_ALGO_CUSTOM = (1 << 2), - DVBFE_ALGO_RECOVERY = (1 << 31) + DVBFE_ALGO_HW = BIT(0), + DVBFE_ALGO_SW = BIT(1), + DVBFE_ALGO_CUSTOM = BIT(2), + DVBFE_ALGO_RECOVERY = BIT(31), }; /** @@ -170,12 +171,12 @@ enum dvbfe_algo { * The frontend search algorithm was requested to search again */ enum dvbfe_search { - DVBFE_ALGO_SEARCH_SUCCESS = (1 << 0), - DVBFE_ALGO_SEARCH_ASLEEP = (1 << 1), - DVBFE_ALGO_SEARCH_FAILED = (1 << 2), - DVBFE_ALGO_SEARCH_INVALID = (1 << 3), - DVBFE_ALGO_SEARCH_AGAIN = (1 << 4), - DVBFE_ALGO_SEARCH_ERROR = (1 << 31), + DVBFE_ALGO_SEARCH_SUCCESS = BIT(0), + DVBFE_ALGO_SEARCH_ASLEEP = BIT(1), + DVBFE_ALGO_SEARCH_FAILED = BIT(2), + DVBFE_ALGO_SEARCH_INVALID = BIT(3), + DVBFE_ALGO_SEARCH_AGAIN = BIT(4), + DVBFE_ALGO_SEARCH_ERROR = BIT(31), }; /** -- 2.20.1