Constants should be on the right side of comparisons.
Issue found by checkpatch.pl script.
Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the chunks of the patch apply to comments save the first one.
Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&i@p)
)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;
File size before:
text data bss dec hex filename
6248 1024 0 7272 1c68
drivers/staging/dgnc/dgnc_sysfs.o
File size after:
text data bss dec hex filename
6288 960 0 7248 1c50
drivers/staging/dgnc/dgnc_sysfs.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&i@p)
)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;
File size before:
text data bss dec hex filename
509 160 0 669 29d
drivers/staging/most/hdm-dim2/dim2_sysfs.o
File size after:
text data bss dec hex filename
565 96 0 661 295
drivers/staging/most/hdm-dim2/dim2_sysfs.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix checkpatch warning "braces {} are not necessary for single statement
blocks" to conform to linux kernel coding style.
Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- NULL comparison rewritten to use '!' operator
Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add space around binary operators to resolve checkpatch issue.
Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&i@p)
)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;
File size before:
text data bss dec hex filename
7551 1440 16 9007 232f
drivers/staging/speakup/kobjects.o
File size after:
text data bss dec hex filename
7671 1312 16 8999 2327
drivers/staging/speakup/kobjects.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: Block comments use * on subsequent lines
No more warnings block comments warnings for this file.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_metacmd_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_usbctlxq_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_usbctlx_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_rridresult_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_cmdresult_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdrec_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_end_of_pda_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_manf_testi_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_manf_testsp_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_hfo_delay_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_nic_config_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_chcali_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_chcalsp_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_ifrf_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_shadow_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_hfa3861_baseline_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_rfr_setting_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_ifr_setting_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_trimdac_setup_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_level_comp_setup_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_vgdac_setup_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_refdac_setup_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_temptype_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_privacy_option_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_default_channel_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_allowed_channel_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_regdomain_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_mkk_callname_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_mac_address_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_level_compc_measurements_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_vgdac_measurements_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_refdac_measurements_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_nicid_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_cfisuprange_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs
It applies for typedef hfa384x_pdr_mfisuprange_t
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>