linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator
@ 2012-06-07 12:12 Dan Carpenter
  2012-06-08  7:25 ` Michael Hennerich
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-06-07 12:12 UTC (permalink / raw)
  To: michael.hennerich; +Cc: linux-iio

Hello Michael Hennerich,

The patch cd1678f96329: "iio: frequency: New driver for AD9523 SPI
Low Jitter Clock Generator" from May 29, 2012, leads to the following
warning:

drivers/iio/frequency/ad9523.c:378 ad9523_vco_out_map()
	 warn: value 2 can't fit into 1 'out'


   363  static int ad9523_vco_out_map(struct iio_dev *indio_dev,
   364                                unsigned ch, bool out)
                                                   ^^^^^^^^
Bool.

   365  {
   366          struct ad9523_state *st = iio_priv(indio_dev);
   367          int ret;
   368          unsigned mask;
   369  
   370          switch (ch) {
   371          case 0 ... 3:
   372                  ret = ad9523_read(indio_dev, AD9523_PLL1_OUTPUT_CHANNEL_CTRL);
   373                  if (ret < 0)
   374                          break;
   375                  mask = AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH0 << ch;
   376                  if (out) {
   377                          ret |= mask;
   378                          out = 2;
                                ^^^^^^^
Should be either true or false.  Two implies FileNotFound.
http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

   379                  } else {
   380                          ret &= ~mask;
   381                  }

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator
  2012-06-07 12:12 iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator Dan Carpenter
@ 2012-06-08  7:25 ` Michael Hennerich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Hennerich @ 2012-06-08  7:25 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-iio@vger.kernel.org

On 06/07/2012 02:12 PM, Dan Carpenter wrote:
> Hello Michael Hennerich,
>
> The patch cd1678f96329: "iio: frequency: New driver for AD9523 SPI
> Low Jitter Clock Generator" from May 29, 2012, leads to the following
> warning:
>
> drivers/iio/frequency/ad9523.c:378 ad9523_vco_out_map()
> 	 warn: value 2 can't fit into 1 'out'
Ups - good catch - I'll submit a patch shortly.

>
>
>     363  static int ad9523_vco_out_map(struct iio_dev *indio_dev,
>     364                                unsigned ch, bool out)
>                                                     ^^^^^^^^
> Bool.
>
>     365  {
>     366          struct ad9523_state *st = iio_priv(indio_dev);
>     367          int ret;
>     368          unsigned mask;
>     369
>     370          switch (ch) {
>     371          case 0 ... 3:
>     372                  ret = ad9523_read(indio_dev, AD9523_PLL1_OUTPUT_CHANNEL_CTRL);
>     373                  if (ret<  0)
>     374                          break;
>     375                  mask = AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH0<<  ch;
>     376                  if (out) {
>     377                          ret |= mask;
>     378                          out = 2;
>                                  ^^^^^^^
> Should be either true or false.  Two implies FileNotFound.
> http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx
>
>     379                  } else {
>     380                          ret&= ~mask;
>     381                  }
>
> regards,
> dan carpenter
>
>


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-08  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07 12:12 iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator Dan Carpenter
2012-06-08  7:25 ` Michael Hennerich

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).