staging: bcm2835-camera: Remove 'ret' variable
Subsystems (3)
PATCH 1/1 staging: bcm2835-camera: Remove 'ret' variable
return value to be returned without using extra variable 'ret'. use coccinelli semantic patch ret.cocci
--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +1 -3
@@ -1510,7 +1510,6 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, struct vchiq_mmal_component *camera, struct bm2835_mmal_dev *dev) { - int ret; struct mmal_parameter_camera_config cam_config = { .max_stills_w = dev->max_width, .max_stills_h = dev->max_height,
@@ -1526,10 +1525,9 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, .use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC }; - ret =vchiq_mmal_port_parameter_set (instance, &camera->control, +return vchiq_mmal_port_parameter_set (instance, &camera->control,MMAL_PARAMETER_CAMERA_CONFIG , &cam_config,sizeof (cam_config)); -return ret; }#define MAX_SUPPORTED_ENCODINGS 20
Signature · 1 line
2.7.4
Quoted 1 line · Bhanusree Pola
return value to be returned without using extra variable 'ret'.
Please start sentences with a capital letter.
Quoted 1 line
use coccinelli semantic patch
ret.cocci
Thanks for trying Coccinelle :) coccinelli -> Coccinelle.
If you use a semantic patch that is not part of the kernel, it would be good to put it in the commit message, if it is not too complicated.
If you use a semantic patch that is part of the kernel, then you can use the tag Generated-by, as in:
Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
Quoted 19 lines
Signed-off-by Bhanusree Pola <[email protected]>--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +0
-1@@ -1510,7 +1510,6 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, struct vchiq_mmal_component *camera, struct bm2835_mmal_dev *dev) { - int ret; struct mmal_parameter_camera_config cam_config = { .max_stills_w = dev->max_width, .max_stills_h = dev->max_height,
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c static int set_camera_parameters(struct vchiq_mmal_instance *instance, · line 1530
Quoted 7 lines
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +1
-1@@ -1526,10 +1525,9 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, .use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC }; - ret =vchiq_mmal_port_parameter_set (instance, &camera->control, +return vchiq_mmal_port_parameter_set (instance, &camera->control,MMAL_PARAMETER_CAMERA_CONFIG , &cam_config,sizeof (cam_config));
You should move the arguments over by one space so that they are on the right side of the (. Coccinelle doesn't always get the spacing quite right...
julia
Quoted 17 lines
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +0
-1-return ret;}
#define
MAX_SUPPORTED_ENCODINGS20
--
2.7.4--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181015072653.GA14133%40aakashd-VirtualBox.
For more options, visit https://groups.google.com/d/optout.