linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Jacob chen <jacob2.chen@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>, Antti Palosaari <crope@iki.fi>,
	Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH v2 0/8] use 64-bit arithmetic instead of 32-bit
Date: Mon, 5 Feb 2018 14:06:18 -0600	[thread overview]
Message-ID: <cover.1517856716.git.gustavo@embeddedor.com> (raw)

Add suffix LL and ULL to various constants in order to give the compiler
complete information about the proper arithmetic to use. Such constants
are used in contexts that expect expressions of type u64 (64 bits, unsigned)
and s64 (64 bits, signed).

The mentioned expressions are currently being evaluated using 32-bit
arithmetic, wich is some cases can lead to unintentional integer
overflows.

This patchset addresses the following Coverity IDs:
CIDs: 200604, 1056807, 1056808, 1271223, 1324146
CIDs: 1392628, 1392630, 1446589, 1454996, 1458347

Thank you

Changes in v2:
 - Update subject and changelog to better reflect the proposed code changes.
 - Add suffix ULL and LL to constants instead of casting variables.
 - Extend the proposed code changes to other similar cases that had not
   previously been considered in v1 of this patchset.

Gustavo A. R. Silva (8):
  rtl2832: use 64-bit arithmetic instead of 32-bit in
    rtl2832_set_frontend
  dvb-frontends: ves1820: use 64-bit arithmetic instead of 32-bit
  i2c: max2175: use 64-bit arithmetic instead of 32-bit
  i2c: ov9650: use 64-bit arithmetic instead of 32-bit
  pci: cx88-input: use 64-bit arithmetic instead of 32-bit
  rockchip/rga: use 64-bit arithmetic instead of 32-bit
  platform: sh_veu: use 64-bit arithmetic instead of 32-bit
  platform: vivid-cec: use 64-bit arithmetic instead of 32-bit

 drivers/media/dvb-frontends/rtl2832.c         |  4 ++--
 drivers/media/dvb-frontends/ves1820.c         |  2 +-
 drivers/media/i2c/max2175.c                   |  2 +-
 drivers/media/i2c/ov9650.c                    |  9 +++++----
 drivers/media/pci/cx88/cx88-input.c           |  4 ++--
 drivers/media/platform/rockchip/rga/rga-buf.c |  3 ++-
 drivers/media/platform/sh_veu.c               |  4 ++--
 drivers/media/platform/vivid/vivid-cec.c      | 11 +++++++++--
 8 files changed, 24 insertions(+), 15 deletions(-)

-- 
2.7.4

             reply	other threads:[~2018-02-05 20:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 20:06 Gustavo A. R. Silva [this message]
2018-02-05 20:06 ` [PATCH v2 1/8] rtl2832: use 64-bit arithmetic instead of 32-bit in rtl2832_set_frontend Gustavo A. R. Silva
2018-02-05 20:06 ` [PATCH v2 2/8] dvb-frontends: ves1820: use 64-bit arithmetic instead of 32-bit Gustavo A. R. Silva
2018-02-05 20:08 ` [PATCH v2 3/8] i2c: max2175: " Gustavo A. R. Silva
2018-02-05 20:08 ` [PATCH v2 4/8] i2c: ov9650: " Gustavo A. R. Silva
2018-02-05 20:27 ` [PATCH v2 5/8] pci: cx88-input: " Gustavo A. R. Silva
2018-02-05 20:27 ` [PATCH v2 6/8] rockchip/rga: " Gustavo A. R. Silva
2018-02-05 20:27 ` [PATCH v2 7/8] platform: sh_veu: " Gustavo A. R. Silva
2018-02-05 20:36 ` [PATCH v2 8/8] platform: vivid-cec: " Gustavo A. R. Silva
2018-02-05 21:29   ` Hans Verkuil
2018-02-05 21:54     ` Gustavo A. R. Silva
2018-02-06 10:41       ` Hans Verkuil
2018-02-06 16:35         ` Gustavo A. R. Silva
2018-02-13 20:59     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1517856716.git.gustavo@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=crope@iki.fi \
    --cc=garsilva@embeddedor.com \
    --cc=heiko@sntech.de \
    --cc=hverkuil@xs4all.nl \
    --cc=jacob2.chen@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).