From: Marcus Wolf <marcus.wolf@wolf-entwicklungen.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Greg KH <gregkh@linuxfoundation.org>
Cc: "kbuild-all@01.org" <kbuild-all@01.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
driverdevel <devel@driverdev.osuosl.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Grant Likely <grant.likely@linaro.org>
Subject: [PATCH 1/1] staging: pi433: fix problem with division in rf69_set_deviation
Date: Thu, 20 Jul 2017 17:56:36 +0200 (CEST) [thread overview]
Message-ID: <255867683.7064.1500566196444@ox.hosteurope.de> (raw)
In-Reply-To: <CAMuHMdVgw=V6f8wzcXvS3gk8GK0bOpdgs_jxL6Y_X9idJD_x3Q@mail.gmail.com>
Fixes problem with division in rf69_set_deviation
Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de>
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -221,7 +221,7 @@ int rf69_set_frequency(struct spi_device *spi, u32
frequency)
int rf69_set_frequency(struct spi_device *spi, u32 frequency)
{
int retval;
- u32 f_max;
+ u64 f_max;
u64 f_reg;
u64 f_step;
u8 msb;
@@ -238,7 +238,8 @@ int rf69_set_frequency(struct spi_device *spi, u32
frequency)
do_div(f_step, 524288); // 524288 = 2^19
// check input value
- f_max = f_step * 8388608 / factor;
+ f_max = f_step * 8388608;
+ do_div(f_max, factor);
if (frequency > f_max)
{
dev_dbg(&spi->dev, "setFrequency: illegal input param");
next prev parent reply other threads:[~2017-07-20 15:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <281067739.16216.1499788929736@ox.hosteurope.de>
2017-07-12 7:43 ` Submit of a driver for Pi433 - a radio module for Raspberry Pi Greg KH
[not found] ` <197075499.65628.1500117344413@ox.hosteurope.de>
2017-07-15 11:24 ` Greg KH
2017-07-15 12:59 ` Marcus Wolf
2017-07-15 13:02 ` Greg KH
2017-07-15 13:10 ` Marcus Wolf
2017-07-15 13:16 ` Greg KH
[not found] ` <1152815224.66246.1500126030682@ox.hosteurope.de>
2017-07-15 13:47 ` Greg KH
2017-07-15 17:05 ` Wolf Entwicklungen
2017-07-16 6:45 ` Greg KH
2017-07-16 9:52 ` [PATCH 1/1] drivers/staging/pi433: New driver Wolf Entwicklungen
2017-07-16 10:15 ` Greg KH
2017-07-16 13:53 ` Marcus Wolf
2017-07-16 14:47 ` Greg KH
2017-07-17 6:18 ` kbuild test robot
2017-07-17 13:26 ` kbuild test robot
2017-07-20 11:23 ` Marcus Wolf
2017-07-20 11:31 ` Greg KH
2017-07-20 11:37 ` Dan Carpenter
2017-07-20 12:27 ` Geert Uytterhoeven
2017-07-20 15:56 ` Marcus Wolf [this message]
2017-07-29 0:01 ` [PATCH 1/1] staging: pi433: fix problem with division in rf69_set_deviation Greg KH
2017-07-29 8:51 ` Marcus Wolf
2017-07-29 22:21 ` Greg KH
2017-07-30 15:21 ` Marcus Wolf
2017-07-20 15:57 ` Test of " Marcus Wolf
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=255867683.7064.1500566196444@ox.hosteurope.de \
--to=marcus.wolf@wolf-entwicklungen.de \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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
all inboxes | Powered by JetHome®