All of lore.kernel.org
 help / color / mirror / Atom feed
* re: [media] tw9910: init priv->scale and update standard
@ 2016-03-24 18:37 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-03-24 18:37 UTC (permalink / raw)
  To: hans.verkuil; +Cc: linux-media

Hello Hans Verkuil,

The patch 1f3375e0b257: "[media] tw9910: init priv->scale and update
standard" from Jun 15, 2015, leads to the following static checker
warning:

	drivers/media/i2c/soc_camera/tw9910.c:536 tw9910_s_std()
	warn: odd binop '0x0 & 0xc'

drivers/media/i2c/soc_camera/tw9910.c
   509  static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
   510  {
   511          struct i2c_client *client = v4l2_get_subdevdata(sd);
   512          struct tw9910_priv *priv = to_tw9910(client);
   513          const unsigned hact = 720;
   514          const unsigned hdelay = 15;
                               ^^^^^^^^^^^
   515          unsigned vact;
   516          unsigned vdelay;
   517          int ret;
   518  
   519          if (!(norm & (V4L2_STD_NTSC | V4L2_STD_PAL)))
   520                  return -EINVAL;
   521  
   522          priv->norm = norm;
   523          if (norm & V4L2_STD_525_60) {
   524                  vact = 240;
   525                  vdelay = 18;
   526                  ret = tw9910_mask_set(client, VVBI, 0x10, 0x10);
   527          } else {
   528                  vact = 288;
   529                  vdelay = 24;
   530                  ret = tw9910_mask_set(client, VVBI, 0x10, 0x00);
   531          }
   532          if (!ret)
   533                  ret = i2c_smbus_write_byte_data(client, CROP_HI,
   534                          ((vdelay >> 2) & 0xc0) |
   535                          ((vact >> 4) & 0x30) |
   536                          ((hdelay >> 6) & 0x0c) |

15 >> 6 is zero.  It's not clear what was intended or why I'm only
seeing this warning now.

   537                          ((hact >> 8) & 0x03));
   538          if (!ret)
   539                  ret = i2c_smbus_write_byte_data(client, VDELAY_LO,
   540                          vdelay & 0xff);
   541          if (!ret)
   542                  ret = i2c_smbus_write_byte_data(client, VACTIVE_LO,
   543                          vact & 0xff);
   544  
   545          return ret;
   546  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-24 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 18:37 [media] tw9910: init priv->scale and update standard Dan Carpenter

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.