staging: greybus: Correct code style issues
Subsystems (5)
cover staging: greybus: Correct code style issues
This patchset address code style issues with blank lines, aligment, spacing. Beside it change 'var_name == NULL' by '!var_name' and use kernel type instead of C99 types.
Frank A. Cancio Bello (6):
staging: greybus: Remove unnecessary blank lines
staging: greybus: Fix alignment issues
staging: greybus: Use u32 instead of uint32_t
staging: greybus: Add space around ternary operator
staging: greybus: Move logical operator in previous line
staging: greybus: Rewrite NULL comparisons
drivers/staging/greybus/arche-apb-ctrl.c | 37 +++++++++++---------- drivers/staging/greybus/arche-platform.c | 10 +++--- drivers/staging/greybus/audio_codec.c | 23 ++++++------- drivers/staging/greybus/audio_codec.h | 2 +- drivers/staging/greybus/audio_module.c | 4 +-- drivers/staging/greybus/audio_topology.c | 55 ++++++++++++++++---------------- drivers/staging/greybus/authentication.c | 2 +- drivers/staging/greybus/bootrom.c | 20 ++++++------ drivers/staging/greybus/bundle.c | 2 +- drivers/staging/greybus/camera.c | 16 +++++----- drivers/staging/greybus/connection.c | 4 --- drivers/staging/greybus/control.c | 1 - drivers/staging/greybus/core.c | 2 +- 13 files changed, 84 insertions(+), 94 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/6 staging: greybus: Remove unnecessary blank lines
Remove unnecessary blank lines to reduce file length and address checkpatch messages:
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary before a close brace '}'
--- drivers/staging/greybus/arche-apb-ctrl.c | 1 - drivers/staging/greybus/audio_codec.c | 3 --- drivers/staging/greybus/audio_topology.c | 1 - drivers/staging/greybus/connection.c | 4 ---- drivers/staging/greybus/control.c | 1 - 5 files changed, 10 deletions(-)
drivers/staging/greybus/arche-apb-ctrl.c +0 -1
@@ -21,7 +21,6 @@#include <linux/spinlock.h> #include "arche_platform.h" -static void apb_bootret_deassert (struct device *dev);struct arche_apb_ctrl_drvdata {
drivers/staging/greybus/audio_codec.c +0 -3
@@ -588,7 +588,6 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream)struct gbaudio_codec_info *codec =dev_get_drvdata (dai->dev);struct gbaudio_stream_params *params; -dev_dbg (dai->dev,"Mute:%d, Direction:%s\n" , mute, stream ?"CAPTURE" :"PLAYBACK" );
@@ -908,7 +907,6 @@ static void gbaudio_codec_clean_data_rx(struct gbaudio_data_connection *data) data->state[1 ] =GBAUDIO_CODEC_SHUTDOWN ; } -static void gbaudio_codec_cleanup (struct gbaudio_module_info *module) {struct gbaudio_data_connection *data;
@@ -924,7 +922,6 @@ static void gbaudio_codec_cleanup(struct gbaudio_module_info *module)if (cap_state >GBAUDIO_CODEC_SHUTDOWN )gbaudio_codec_clean_data_rx (data); - } }
drivers/staging/greybus/audio_topology.c +0 -1
@@ -924,7 +924,6 @@ static int gbaudio_tplg_create_wcontrol(struct gbaudio_module_info *gb,break ;default :return -EINVAL ; - } dev_dbg(gb->dev, "%s:%d DAPM control created, ret:%d\n", ctl->name,
drivers/staging/greybus/connection.c +0 -4
@@ -12,17 +12,13 @@#include "greybus.h" #include "greybus_trace.h" -#define GB_CONNECTION_CPORT_QUIESCE_TIMEOUT 1000 -static void gb_connection_kref_release (struct kref *kref); -static DEFINE_SPINLOCK (gb_connections_lock);static DEFINE_MUTEX (gb_connection_mutex); -/* Caller holds gb_connection_mutex. */ static bool gb_connection_cport_in_use (struct gb_interface *intf,u16 cport_id) {
drivers/staging/greybus/control.c +0 -1
@@ -16,7 +16,6 @@#define GB_CONTROL_VERSION_MAJOR 0#define GB_CONTROL_VERSION_MINOR 1 -static int gb_control_get_version (struct gb_control *control) {struct gb_interface *intf = control->connection->intf;
Signature · 1 line
2.7.4
PATCH 2/6 staging: greybus: Fix alignment issues
In reply to Frank A. Cancio BelloFix alignment to match open parenthesis and comply in with the preferred coding style for the linux kernel.
The 'checkpatch' message was:
'CHECK: Alignment should match open parenthesis'
--- drivers/staging/greybus/arche-apb-ctrl.c | 36 ++++++++++----------- drivers/staging/greybus/arche-platform.c | 10 +++--- drivers/staging/greybus/audio_codec.c | 6 ++-- drivers/staging/greybus/audio_codec.h | 2 +- drivers/staging/greybus/audio_module.c | 4 +-- drivers/staging/greybus/audio_topology.c | 54 ++++++++++++++++---------------- drivers/staging/greybus/authentication.c | 2 +- drivers/staging/greybus/bootrom.c | 20 ++++++------ 8 files changed, 67 insertions(+), 67 deletions(-)
drivers/staging/greybus/arche-apb-ctrl.c +18 -18
@@ -72,14 +72,14 @@ static int coldboot_seq(struct platform_device *pdev)int ret;if (apb->init_disabled || - apb->state ==ARCHE_PLATFORM_STATE_ACTIVE ) + apb->state ==ARCHE_PLATFORM_STATE_ACTIVE )return 0 ;/* Hold APB in reset state */ assert_reset (apb->resetn_gpio);if (apb->state ==ARCHE_PLATFORM_STATE_FW_FLASHING && -gpio_is_valid (apb->spi_en_gpio)) +gpio_is_valid (apb->spi_en_gpio))devm_gpio_free (dev, apb->spi_en_gpio);/* Enable power to APB */
@@ -122,7 +122,7 @@ static int fw_flashing_seq(struct platform_device *pdev)int ret;if (apb->init_disabled || - apb->state ==ARCHE_PLATFORM_STATE_FW_FLASHING ) + apb->state ==ARCHE_PLATFORM_STATE_FW_FLASHING )return 0 ; ret =regulator_enable (apb->vcore);
@@ -146,7 +146,7 @@ static int fw_flashing_seq(struct platform_device *pdev) flags =GPIOF_OUT_INIT_LOW ; ret =devm_gpio_request_one (dev, apb->spi_en_gpio, - flags,"apb_spi_en" ); + flags,"apb_spi_en" );if (ret) {dev_err (dev,"Failed requesting SPI bus en gpio %d\n" , apb->spi_en_gpio);
@@ -174,11 +174,11 @@ static int standby_boot_seq(struct platform_device *pdev)* then we do not want to change the state */ if (apb->state ==ARCHE_PLATFORM_STATE_STANDBY || - apb->state ==ARCHE_PLATFORM_STATE_OFF ) + apb->state ==ARCHE_PLATFORM_STATE_OFF )return 0 ;if (apb->state ==ARCHE_PLATFORM_STATE_FW_FLASHING && -gpio_is_valid (apb->spi_en_gpio)) +gpio_is_valid (apb->spi_en_gpio))devm_gpio_free (dev, apb->spi_en_gpio);/*
@@ -203,7 +203,7 @@ static void poweroff_seq(struct platform_device *pdev)return ;if (apb->state ==ARCHE_PLATFORM_STATE_FW_FLASHING && -gpio_is_valid (apb->spi_en_gpio)) +gpio_is_valid (apb->spi_en_gpio))devm_gpio_free (dev, apb->spi_en_gpio);/* disable the clock */
@@ -297,7 +297,7 @@ static ssize_t state_store(struct device *dev, }static ssize_t state_show (struct device *dev, -struct device_attribute *attr,char *buf) +struct device_attribute *attr,char *buf) {struct arche_apb_ctrl_drvdata *apb =dev_get_drvdata (dev);
@@ -319,7 +319,7 @@ static ssize_t state_show(struct device *dev,static DEVICE_ATTR_RW (state);static int apb_ctrl_get_devtree_data (struct platform_device *pdev, -struct arche_apb_ctrl_drvdata *apb) +struct arche_apb_ctrl_drvdata *apb) {struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;
@@ -331,10 +331,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,return apb->resetn_gpio; } ret =devm_gpio_request_one (dev, apb->resetn_gpio, -GPIOF_OUT_INIT_LOW ,"apb-reset" ); +GPIOF_OUT_INIT_LOW ,"apb-reset" );if (ret) {dev_err (dev,"Failed requesting reset gpio %d\n" , - apb->resetn_gpio); + apb->resetn_gpio);return ret; }
@@ -344,10 +344,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,return apb->boot_ret_gpio; } ret =devm_gpio_request_one (dev, apb->boot_ret_gpio, -GPIOF_OUT_INIT_LOW ,"boot retention" ); +GPIOF_OUT_INIT_LOW ,"boot retention" );if (ret) {dev_err (dev,"Failed requesting bootret gpio %d\n" , - apb->boot_ret_gpio); + apb->boot_ret_gpio);return ret; }
@@ -358,10 +358,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,return apb->pwroff_gpio; } ret =devm_gpio_request_one (dev, apb->pwroff_gpio, -GPIOF_IN ,"pwroff_n" ); +GPIOF_IN ,"pwroff_n" );if (ret) {dev_err (dev,"Failed requesting pwroff_n gpio %d\n" , - apb->pwroff_gpio); + apb->pwroff_gpio);return ret; }
@@ -371,10 +371,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,dev_warn (dev,"failed to get clock en gpio\n" ); }else if (gpio_is_valid (apb->clk_en_gpio)) { ret =devm_gpio_request_one (dev, apb->clk_en_gpio, -GPIOF_OUT_INIT_LOW ,"apb_clk_en" ); +GPIOF_OUT_INIT_LOW ,"apb_clk_en" );if (ret) {dev_warn (dev,"Failed requesting APB clock en gpio %d\n" , - apb->clk_en_gpio); + apb->clk_en_gpio);return ret; } }
@@ -407,7 +407,7 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev, apb->spi_en_gpio =of_get_named_gpio (np,"spi-en-gpio" ,0 );if (apb->spi_en_gpio >=0 ) {if (of_property_read_bool (pdev->dev.of_node, -"spi-en-active-high" )) +"spi-en-active-high" )) apb->spi_en_polarity_high = true; }
drivers/staging/greybus/arche-platform.c +5 -5
@@ -234,7 +234,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdata) ret =clk_prepare_enable (arche_pdata->svc_ref_clk);if (ret) {dev_err (arche_pdata->dev,"failed to enable svc_ref_clk: %d\n" , - ret); + ret);return ret; }
@@ -270,7 +270,7 @@ arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_pdata) ret =clk_prepare_enable (arche_pdata->svc_ref_clk);if (ret) {dev_err (arche_pdata->dev,"failed to enable svc_ref_clk: %d\n" , - ret); + ret);return ret; }
@@ -377,7 +377,7 @@ static ssize_t state_store(struct device *dev, }static ssize_t state_show (struct device *dev, -struct device_attribute *attr,char *buf) +struct device_attribute *attr,char *buf) {struct arche_platform_drvdata *arche_pdata =dev_get_drvdata (dev);
@@ -458,7 +458,7 @@ static int arche_platform_probe(struct platform_device *pdev)return ret; } ret =gpio_direction_output (arche_pdata->svc_reset_gpio, - arche_pdata->is_reset_act_hi); + arche_pdata->is_reset_act_hi);if (ret) {dev_err (dev,"failed to set svc-reset gpio dir:%d\n" , ret);return ret;
@@ -526,7 +526,7 @@ static int arche_platform_probe(struct platform_device *pdev) "wake detect");if (ret) {dev_err (dev,"Failed requesting wake_detect gpio %d\n" , - arche_pdata->wake_detect_gpio); + arche_pdata->wake_detect_gpio);return ret; }
drivers/staging/greybus/audio_codec.c +3 -3
@@ -568,7 +568,7 @@ static int gbcodec_prepare(struct snd_pcm_substream *substream,if (ret) {mutex_unlock (&codec->lock);dev_err_ratelimited (dai->dev,"set_data_size failed:%d\n" , - ret); + ret);return ret; }
@@ -827,7 +827,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module) module->num_dapm_widgets);if (module->controls)snd_soc_add_codec_controls (codec, module->controls, - module->num_controls); + module->num_controls);if (module->dapm_routes)snd_soc_dapm_add_routes (&codec->dapm, module->dapm_routes, module->num_dapm_routes);
@@ -970,7 +970,7 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module)dev_dbg (codec->dev,"Removing %d controls\n" , module->num_controls);snd_soc_remove_codec_controls (codec, module->controls, - module->num_controls); + module->num_controls); }if (module->dapm_widgets) { dev_dbg(codec->dev, "Removing %d widgets\n",
drivers/staging/greybus/audio_codec.h +1 -1
@@ -160,7 +160,7 @@ struct gbaudio_module_info { };int gbaudio_tplg_parse_data (struct gbaudio_module_info *module, -struct gb_audio_topology *tplg_data); +struct gb_audio_topology *tplg_data);void gbaudio_tplg_release (struct gbaudio_module_info *module); int gbaudio_module_update(struct gbaudio_codec_info *codec,
drivers/staging/greybus/audio_module.c +2 -2
@@ -19,7 +19,7 @@*/ static int gbaudio_request_jack (struct gbaudio_module_info *module, -struct gb_audio_jack_event_request *req) +struct gb_audio_jack_event_request *req) {int report;struct snd_jack *jack = module->headset_jack.jack;
@@ -318,7 +318,7 @@ static int gb_audio_probe(struct gb_bundle *bundle, ret =gbaudio_tplg_parse_data (gbmodule, topology);if (ret) {dev_err (dev,"%d:Error while parsing topology data\n" , - ret); + ret); goto free_topology; } gbmodule->topology = topology;
drivers/staging/greybus/audio_topology.c +27 -27
172 lines not on this page · raw message
drivers/staging/greybus/authentication.c +1 -1
@@ -203,7 +203,7 @@ static int cap_release(struct inode *inode, struct file *file) }static int cap_ioctl (struct gb_cap *cap,unsigned int cmd, -void __user *buf) +void __user *buf) {struct cap_ioc_get_endpoint_uid endpoint_uid;struct cap_ioc_get_ims_certificate *ims_cert;
drivers/staging/greybus/bootrom.c +10 -10
@@ -176,7 +176,7 @@ static int find_firmware(struct gb_bootrom *bootrom, u8 stage) firmware_name); rc =request_firmware (&bootrom->fw, firmware_name, - &connection->bundle->dev); + &connection->bundle->dev);if (rc) {dev_err (&connection->bundle->dev,"failed to find %s firmware (%d)\n" , firmware_name, rc);
@@ -275,7 +275,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op)if (offset >= fw->size || size > fw->size - offset) {dev_warn (dev,"bad firmware request (offs = %u, size = %u)\n" , - offset, size); + offset, size); ret = -EINVAL ; goto unlock; }
@@ -388,15 +388,15 @@ static int gb_bootrom_get_version(struct gb_bootrom *bootrom) sizeof(response));if (ret) {dev_err (&bundle->dev, -"failed to get protocol version: %d\n" , - ret); +"failed to get protocol version: %d\n" , + ret);return ret; }if (response.major > request.major) {dev_err (&bundle->dev, -"unsupported major protocol version (%u > %u)\n" , - response.major, request.major); +"unsupported major protocol version (%u > %u)\n" , + response.major, request.major);return -ENOTSUPP ; }
@@ -404,13 +404,13 @@ static int gb_bootrom_get_version(struct gb_bootrom *bootrom) bootrom->protocol_minor = response.minor;dev_dbg (&bundle->dev,"%s - %u.%u\n" , __func__, response.major, - response.minor); + response.minor);return 0 ; }static int gb_bootrom_probe (struct gb_bundle *bundle, -const struct greybus_bundle_id *id) +const struct greybus_bundle_id *id) {struct greybus_descriptor_cport *cport_desc;struct gb_connection *connection;
@@ -429,7 +429,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle,return -ENOMEM ; connection =gb_connection_create (bundle, -le16_to_cpu (cport_desc->id), +le16_to_cpu (cport_desc->id), gb_bootrom_request_handler);if (IS_ERR (connection)) { ret =PTR_ERR (connection);
@@ -467,7 +467,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, NULL, 0);if (ret) {dev_err (&connection->bundle->dev, -"failed to send AP READY: %d\n" , ret); +"failed to send AP READY: %d\n" , ret); goto err_cancel_timeout; }
Signature · 1 line
2.7.4
PATCH 3/6 staging: greybus: Use u32 instead of uint32_t
In reply to Frank A. Cancio BelloUse 'u32' kernel types instead of 'uint32_t'.
Detected by checkpatch with the message:
CHECK: Prefer kernel type 'u32' over 'uint32_t'
--- drivers/staging/greybus/audio_codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/audio_codec.c +3 -3
@@ -48,7 +48,7 @@ static int gbaudio_module_enable_tx(struct gbaudio_codec_info *codec,int module_state, ret =0 ;u16 data_cport, i2s_port, cportid;u8 sig_bits, channels; -uint32_t format, rate; +u32 format, rate;struct gbaudio_data_connection *data;struct gbaudio_stream_params *params;
@@ -183,7 +183,7 @@ static int gbaudio_module_enable_rx(struct gbaudio_codec_info *codec,int module_state, ret =0 ;u16 data_cport, i2s_port, cportid;u8 sig_bits, channels; -uint32_t format, rate; +u32 format, rate;struct gbaudio_data_connection *data;struct gbaudio_stream_params *params;
@@ -413,7 +413,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream, {int ret;u8 sig_bits, channels; -uint32_t format, rate; +u32 format, rate;struct gbaudio_module_info *module;struct gbaudio_data_connection *data;struct gb_bundle *bundle;
Signature · 1 line
2.7.4
PATCH 4/6 staging: greybus: Add space around ternary operator
In reply to Frank A. Cancio BelloUse one space around ternary operator to comply in with the preferred coding style for the linux kernel. Detected by checkpatch with message:
CHECK: spaces required around that ':' (ctx:VxV)
--- drivers/staging/greybus/audio_codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/audio_codec.c +2 -2
@@ -320,7 +320,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,char intf_name[NAME_SIZE ], dir[NAME_SIZE ];dev_dbg (module->dev,"%s:Module update %s sequence\n" , w->name, - enable ?"Enable" :"Disable" ); + enable ?"Enable" :"Disable" );if ((w->id != snd_soc_dapm_aif_in) && (w->id != snd_soc_dapm_aif_out)) {dev_dbg (codec->dev,"No action required for %s\n" , w->name);
@@ -589,7 +589,7 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream)struct gbaudio_stream_params *params;dev_dbg (dai->dev,"Mute:%d, Direction:%s\n" , mute, - stream ?"CAPTURE" :"PLAYBACK" ); + stream ?"CAPTURE" :"PLAYBACK" );mutex_lock (&codec->lock);
Signature · 1 line
2.7.4
PATCH 5/6 staging: greybus: Move logical operator in previous line
In reply to Frank A. Cancio BelloReorganize the if condition line so logical continuation fall in the previous line to meet the preferred coding style for the linux kernel.
Detected by checkpatch with message:
CHECK: Logical continuations should be on the previous line
--- drivers/staging/greybus/audio_codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/audio_codec.c +2 -2
@@ -842,8 +842,8 @@ int gbaudio_register_module(struct gbaudio_module_info *module)* from codec->jack_list */ list_for_each_entry (jack, &codec->jack_list, list) { -if ((jack == &module->headset_jack) - || (jack == &module->button_jack)) +if (jack == &module->headset_jack || + jack == &module->button_jack)snd_device_register (codec->card->snd_card, jack->jack); }
Signature · 1 line
2.7.4
PATCH 6/6 staging: greybus: Rewrite NULL comparisons
In reply to Frank A. Cancio BelloMake NULL comparisons shortest and quicker to read changing 'var_name == NULL' by '!var_name'.
Detected by checkpatch with messages like:
CHECK: Comparison to NULL could be written "!id"
--- drivers/staging/greybus/bundle.c | 2 +- drivers/staging/greybus/camera.c | 16 ++++++++-------- drivers/staging/greybus/core.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/greybus/bundle.c +1 -1
@@ -33,7 +33,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr, {struct gb_bundle *bundle =to_gb_bundle (dev); -if (bundle->state ==NULL ) +if (!bundle->state)return sprintf (buf,"\n" );return sprintf (buf,"%s\n" , bundle->state);
drivers/staging/greybus/camera.c +8 -8
@@ -919,7 +919,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,/* Retrieve number of streams to configure */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token)return -EINVAL ; ret =kstrtouint (token,10 , &nstreams);
@@ -930,7 +930,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,return -EINVAL ; token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token)return -EINVAL ; ret =kstrtouint (token,10 , &flags);
@@ -947,7 +947,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,/* width */ token =strsep (&buf,";" ); -if (token ==NULL ) { +if (!token) { ret = -EINVAL ; goto done; }
@@ -957,7 +957,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,/* height */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token) goto done; ret =kstrtouint (token,10 , &stream->height);
@@ -966,7 +966,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,/* Image format code */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token) goto done; ret =kstrtouint (token,16 , &stream->format);
@@ -1010,7 +1010,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,/* Request id */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token)return -EINVAL ; ret =kstrtouint (token,10 , &request_id);if (ret <0 )
@@ -1018,7 +1018,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,/* Stream mask */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token)return -EINVAL ; ret =kstrtouint (token,16 , &streams_mask);if (ret <0 )
@@ -1026,7 +1026,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,/* number of frames */ token =strsep (&buf,";" ); -if (token ==NULL ) +if (!token)return -EINVAL ; ret =kstrtouint (token,10 , &num_frames);if (ret <0 )
drivers/staging/greybus/core.c +1 -1
@@ -49,7 +49,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)return NULL ; for (; id->vendor || id->product || id->class || id->driver_info;
Signature · 1 line
2.7.4
Johan Hovold
maintainerQuoted 3 lines · Frank A. Cancio Bello
This patchset address code style issues with blank lines, aligment, spacing. Beside it change '
var_name== NULL' by '!var_name' and use kernel type instead of C99 types.
Thanks for the clean ups. Some of these are good, some fall in category of style choices that are really up to the author of the code to decide on (e.g. using double newlines as a separator in a source file).
Either way, you need to send these also to the public lists. scripts/get_maintainer.pl will tell you which (you don't need to CC lkml unless you prefer).
Thanks,
Johan
Quoted 22 lines
Frank A. Cancio Bello (6):
staging: greybus: Remove unnecessary blank lines
staging: greybus: Fix alignment issues
staging: greybus: Use u32 instead ofuint32_t
staging: greybus: Add space around ternary operator
staging: greybus: Move logical operator in previous line
staging: greybus: Rewrite NULL comparisonsdrivers/staging/greybus/arche-apb-ctrl.c | 37 +++++++++++---------- drivers/staging/greybus/arche-platform.c | 10 +++--- drivers/staging/greybus/audio_codec.c | 23 ++++++------- drivers/staging/greybus/audio_codec.h | 2 +- drivers/staging/greybus/audio_module.c | 4 +-- drivers/staging/greybus/audio_topology.c | 55 ++++++++++++++++---------------- drivers/staging/greybus/authentication.c | 2 +- drivers/staging/greybus/bootrom.c | 20 ++++++------ drivers/staging/greybus/bundle.c | 2 +- drivers/staging/greybus/camera.c | 16 +++++----- drivers/staging/greybus/connection.c | 4 --- drivers/staging/greybus/control.c | 1 - drivers/staging/greybus/core.c | 2 +- 13 files changed, 84 insertions(+), 94 deletions(-)
Johan Hovold
maintainerRe: [PATCH 1/6] staging: greybus: Remove unnecessary blank lines
In reply to Frank A. Cancio BelloQuoted 17 lines · Frank A. Cancio Bello
Remove unnecessary blank lines to reduce file length and address checkpatch messages:
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary before a close brace '}'Signed-off-by Frank A. Cancio Bello <[email protected]>---
drivers/staging/greybus/connection.c +0
-1@@ -12,17 +12,13 @@#include "greybus.h" #include "greybus_trace.h" -
drivers/staging/greybus/connection.c line 25
Quoted 10 lines
drivers/staging/greybus/connection.c +0
-3#define GB_CONNECTION_CPORT_QUIESCE_TIMEOUT 1000 -static void gb_connection_kref_release (struct kref *kref); -static DEFINE_SPINLOCK (gb_connections_lock);static DEFINE_MUTEX (gb_connection_mutex); -
Here double newlines are used to separate and group defines, function prototypes, and static variables, which is perfectly fine.
Johan