* [PATCH] iio: frequency: admv1013: remove the always true condition
@ 2022-01-04 21:09 Muhammad Usama Anjum
2022-01-15 18:09 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Muhammad Usama Anjum @ 2022-01-04 21:09 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: usama.anjum
unsigned int variable is always greater than or equal to zero. Make the
if condition simple.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
drivers/iio/frequency/admv1013.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
index 6cdeb50143af..3f3c478e9baa 100644
--- a/drivers/iio/frequency/admv1013.c
+++ b/drivers/iio/frequency/admv1013.c
@@ -348,7 +348,7 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
vcm = regulator_get_voltage(st->reg);
- if (vcm >= 0 && vcm < 1800000)
+ if (vcm < 1800000)
mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
else if (vcm > 1800000 && vcm < 2600000)
mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: frequency: admv1013: remove the always true condition
2022-01-04 21:09 [PATCH] iio: frequency: admv1013: remove the always true condition Muhammad Usama Anjum
@ 2022-01-15 18:09 ` Jonathan Cameron
2022-01-17 8:34 ` Muhammad Usama Anjum
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2022-01-15 18:09 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Lars-Peter Clausen, Michael Hennerich,
open list:IIO SUBSYSTEM AND DRIVERS, open list, Antoniu Miclaus
On Wed, 5 Jan 2022 02:09:20 +0500
Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
> unsigned int variable is always greater than or equal to zero. Make the
> if condition simple.
>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Hi,
+ CC Antoniu and this should have a Fixes tag.
Thanks,
Jonathan
> ---
> drivers/iio/frequency/admv1013.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
> index 6cdeb50143af..3f3c478e9baa 100644
> --- a/drivers/iio/frequency/admv1013.c
> +++ b/drivers/iio/frequency/admv1013.c
> @@ -348,7 +348,7 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
>
> vcm = regulator_get_voltage(st->reg);
>
> - if (vcm >= 0 && vcm < 1800000)
> + if (vcm < 1800000)
> mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
> else if (vcm > 1800000 && vcm < 2600000)
> mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: frequency: admv1013: remove the always true condition
2022-01-15 18:09 ` Jonathan Cameron
@ 2022-01-17 8:34 ` Muhammad Usama Anjum
2022-01-30 11:51 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Muhammad Usama Anjum @ 2022-01-17 8:34 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Michael Hennerich,
open list:IIO SUBSYSTEM AND DRIVERS, open list, Antoniu Miclaus,
Muhammad Usama Anjum
On Sat, 2022-01-15 at 18:09 +0000, Jonathan Cameron wrote:
> On Wed, 5 Jan 2022 02:09:20 +0500
> Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
>
> > unsigned int variable is always greater than or equal to zero. Make the
> > if condition simple.
> >
> > Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> Hi,
>
> + CC Antoniu and this should have a Fixes tag.
>
> Thanks,
>
> Jonathan
>
Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013")
Please let me know if I should send a V2 with this tag included.
Thanks,
Usama
> > ---
> > drivers/iio/frequency/admv1013.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
> > index 6cdeb50143af..3f3c478e9baa 100644
> > --- a/drivers/iio/frequency/admv1013.c
> > +++ b/drivers/iio/frequency/admv1013.c
> > @@ -348,7 +348,7 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
> >
> >
> >
> >
> > vcm = regulator_get_voltage(st->reg);
> >
> >
> >
> >
> > - if (vcm >= 0 && vcm < 1800000)
> > + if (vcm < 1800000)
> > mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
> > else if (vcm > 1800000 && vcm < 2600000)
> > mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: frequency: admv1013: remove the always true condition
2022-01-17 8:34 ` Muhammad Usama Anjum
@ 2022-01-30 11:51 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2022-01-30 11:51 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Lars-Peter Clausen, Michael Hennerich,
open list:IIO SUBSYSTEM AND DRIVERS, open list, Antoniu Miclaus
On Mon, 17 Jan 2022 13:34:28 +0500
Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
> On Sat, 2022-01-15 at 18:09 +0000, Jonathan Cameron wrote:
> > On Wed, 5 Jan 2022 02:09:20 +0500
> > Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
> >
> > > unsigned int variable is always greater than or equal to zero. Make the
> > > if condition simple.
> > >
> > > Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> > Hi,
> >
> > + CC Antoniu and this should have a Fixes tag.
> >
> > Thanks,
> >
> > Jonathan
> >
> Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013")
>
> Please let me know if I should send a V2 with this tag included.
Great thanks an no need to resend.
Applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
>
> Thanks,
> Usama
> > > ---
> > > drivers/iio/frequency/admv1013.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
> > > index 6cdeb50143af..3f3c478e9baa 100644
> > > --- a/drivers/iio/frequency/admv1013.c
> > > +++ b/drivers/iio/frequency/admv1013.c
> > > @@ -348,7 +348,7 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
> > >
> > >
> > >
> > >
> > > vcm = regulator_get_voltage(st->reg);
> > >
> > >
> > >
> > >
> > > - if (vcm >= 0 && vcm < 1800000)
> > > + if (vcm < 1800000)
> > > mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
> > > else if (vcm > 1800000 && vcm < 2600000)
> > > mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-30 11:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 21:09 [PATCH] iio: frequency: admv1013: remove the always true condition Muhammad Usama Anjum
2022-01-15 18:09 ` Jonathan Cameron
2022-01-17 8:34 ` Muhammad Usama Anjum
2022-01-30 11:51 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.