Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2562938ybi; Thu, 4 Jul 2019 13:59:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2O0yhtk6rQBK6V8pvO2nw4ispT+07PxAI6NAoQ12zumz4ZtlxK61IYsvnVRSVFLGGJKp3 X-Received: by 2002:a63:ed06:: with SMTP id d6mr434873pgi.267.1562273969343; Thu, 04 Jul 2019 13:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562273969; cv=none; d=google.com; s=arc-20160816; b=Z9kz/HbeMhjW3E8IljEYoHB3fMbXwh2MQ5PNSXz9dsGbHq5ZNs7bBvxfgeLieF+xG2 9lMo2RjAveq9DO4lQccgYZUGGM3qwp31jxc0b7hmQXFcocDXWyhHtCzCt/ECNlvq23fa BoLXB7+SLW3NSPmZ0MjdkiyK+fE8VEvJwLii2XuofP6VHwbZYGc0r9vPbYG6S3/0nABL FfnwPY6J8s2MEXhzXgfFru7kDXRmdD25QFyjgXo7IO2D9LrWgBNpIphKJPWZypRMlYeN YJZlMyNk0Mq++O35qbLWBjN0jIzMcV2/d1jf93xOjtyzO5Km77yddz/OLSB/NlgGU0x2 mDBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=grCDCl+v3cOndoVVgZ+GKtPkCznFNSwS4pwEXpmJPptqu/o9R8QEzBwZBU4HESmBtp 2QaN1bOvVwMk/L31Fyw1dsU5UPFSKO1KWQ2KhhzKNmjLDjxIlMoaqXOrePT1FtgrCqLW 3R3KeAZ+0sE3EsUzAKiBOF68HkRkxdV3+ZRBr2SH4AtSfvWe3+OkgiihwYrluxp6HuyE yAbn5sQA1QCQfS0b3EsdENpgQoelxPbdWk0fzYux0JfJP4ZoOshmklIrUoaPyHz2QU/s BQ6BI3/ovLuKQCtF91XMexpyYvNIynZTlsvibMGRwvhsrenLcYm5kC2njxx+ervlPCFW pFkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=KZG459qz; 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 d136si6331274pga.41.2019.07.04.13.59.14; Thu, 04 Jul 2019 13:59: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=KZG459qz; 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 S1727473AbfGDU6T (ORCPT + 99 others); Thu, 4 Jul 2019 16:58:19 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:47039 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727091AbfGDU6T (ORCPT ); Thu, 4 Jul 2019 16:58:19 -0400 Received: by mail-lj1-f196.google.com with SMTP id v24so7213076ljg.13 for ; Thu, 04 Jul 2019 13:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eng.ucsd.edu; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=KZG459qzCfFpjjcyPjltODY9KHxY7Ksf3ptXJGrrwixRi+P2LVc37qpMlLZWYYpAyl HdVyPmC4A/wFQlJSm3pIFCKwL2Ey2C4sgyVR5llRL35ZyWXhY2SE60INjRNsd3lZ5utm sW7palrxgQB+BbEsFzHlr/Rj0hWd4+xYFWkj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=kaWcOT8T+KSXDRlP7d1Sy+89HMvlHdNWlBmmeaX1Ra8=; b=DHAYyrX4sYXNsF2nJ5IKQ/T9iVUrxJX6OLVR69y7HuFLJKDHhtX8wJsV689ephDWHL Ramongy8U5qHifXENBcjRTtMNySdk0IE7G4QZHlfS3eNQlATKk1UTWi7I/PTRvM5jzv5 80iXc1jp7hY2KhevBG+K5RUmQdHRaUw19FEW5mshnUAZyvH6wrcKx4vzhUHsIXO5UUOl 7hPRSOkQzWYaVwhagx3JQKGWxt59L8A7Ws9jPocFduTkxY8U+8BbEfmsFCv3Uy90Uo4L M5wDVqKGM6cgNGEzU9rWIifTyxy0+a3cfGsH+dZpYwaPlcMy48ui54XZa/E+uFzxwmUn cH4Q== X-Gm-Message-State: APjAAAUOUVHnASffGNHDr1ftgSQ0Er069SgFxVNN+a+jJgasnz/MQvrQ KUcJk152H6mWhP2NR1lLz+5UqA== X-Received: by 2002:a2e:b0f0:: with SMTP id h16mr78772ljl.21.1562273897101; Thu, 04 Jul 2019 13:58:17 -0700 (PDT) Received: from luke-XPS-13 (77-255-206-190.adsl.inetia.pl. [77.255.206.190]) by smtp.gmail.com with ESMTPSA id f10sm1044907lfh.82.2019.07.04.13.58.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jul 2019 13:58:16 -0700 (PDT) Date: Thu, 4 Jul 2019 13:58:12 -0700 From: Luke Nowakowski-Krijger To: mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH v2] media: dvb_frontend.h: Fix shifting signed 32-bit value problem Message-ID: <20190704205812.GA28496@luke-XPS-13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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