All of lore.kernel.org
 help / color / mirror / Atom feed
* [media-s3c-camif] question about arguments position
@ 2017-05-04 19:05 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 11+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-04 19:05 UTC (permalink / raw)
  To: Sylwester Nawrocki, Mauro Carvalho Chehab
  Cc: linux-media, linux-samsung-soc, linux-kernel


Hello everybody,

While looking into Coverity ID 1248800 I ran into the following piece  
of code at drivers/media/platform/s3c-camif/camif-capture.c:67:

/* Locking: called with camif->slock spinlock held */
static int s3c_camif_hw_init(struct camif_dev *camif, struct camif_vp *vp)
{
         const struct s3c_camif_variant *variant = camif->variant;

         if (camif->sensor.sd == NULL || vp->out_fmt == NULL)
                 return -EINVAL;

         if (variant->ip_revision == S3C244X_CAMIF_IP_REV)
                 camif_hw_clear_fifo_overflow(vp);
         camif_hw_set_camera_bus(camif);
         camif_hw_set_source_format(camif);
         camif_hw_set_camera_crop(camif);
         camif_hw_set_test_pattern(camif, camif->test_pattern);
         if (variant->has_img_effect)
                 camif_hw_set_effect(camif, camif->colorfx,
                                 camif->colorfx_cb, camif->colorfx_cr);
         if (variant->ip_revision == S3C6410_CAMIF_IP_REV)
                 camif_hw_set_input_path(vp);
         camif_cfg_video_path(vp);
         vp->state &= ~ST_VP_CONFIG;

         return 0;
}


The issue here is that the position of arguments in the call to  
camif_hw_set_effect() function do not match the order of the parameters:

camif->colorfx_cb is passed to cr
camif->colorfx_cr is passed to cb

This is the function prototype:

void camif_hw_set_effect(struct camif_dev *camif, unsigned int effect,
			unsigned int cr, unsigned int cb)

My question here is if this is intentional?

In case it is not, I will send a patch to fix it. But first it would  
be great to hear any comment about it.

By the way... the same is happening at  
drivers/media/platform/s3c-camif/camif-capture.c:366

Thank you

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

end of thread, other threads:[~2017-06-05 15:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-04 19:05 [media-s3c-camif] question about arguments position Gustavo A. R. Silva
2017-05-04 19:05 ` Gustavo A. R. Silva
2017-05-04 19:34 ` Sylwester Nawrocki
2017-05-04 19:50   ` Gustavo A. R. Silva
2017-05-04 21:42     ` [PATCH] media: platform: s3c-camif: fix function prototype Gustavo A. R. Silva
2017-05-22  9:02       ` Hans Verkuil
2017-06-01 21:37         ` Sylwester Nawrocki
2017-06-02  3:43           ` [PATCH] media: platform: s3c-camif: fix arguments position in function call Gustavo A. R. Silva
2017-06-05 10:07             ` Sylwester Nawrocki
2017-06-05 15:52               ` Gustavo A. R. Silva
2017-06-05 15:52                 ` Gustavo A. R. Silva

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.