[PATCH] staging/ccree: Declare compiled out functions static inline
Sparse was giving out a warning for symbols 'cc_set_ree_fips_status' and 'fips_handler' that they were not declared and need to be made static. This patch makes both the symbols static inline, to remove the warnings. Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/ccree/ssi_fips.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h index 369ddf9..63bcca7 100644 --- a/drivers/staging/ccree/ssi_fips.h +++ b/drivers/staging/ccree/ssi_fips.h @@ -40,8 +40,8 @@ static inline int ssi_fips_init(struct ssi_drvdata *p_drvdata) } static inline void ssi_fips_fini(struct ssi_drvdata *drvdata) {} -void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} -void fips_handler(struct ssi_drvdata *drvdata) {} +static inline void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} +static inline void fips_handler(struct ssi_drvdata *drvdata) {} #endif /* CONFIG_CRYPTO_FIPS */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline
On Wed, Aug 16, 2017 at 03:09:09PM -0700, Greg KH wrote: > On Mon, Jul 31, 2017 at 02:47:23PM +0530, RishabhHardas wrote: > > From: RishabhHardas <rishabhhar...@gmail.com> > > > > Sparse was giving out a warning for symbols 'cc_set_ree_fips_status' and > > 'fips_handler' > > that they were not declared and need to be made static. This patch makes > > both the symbols > > static inline, to remove the warnings. > > > > Signed-off-by: RishabhHardas <rishabhhar...@gmail.com> > > I doubt you sign your name on legal documents without a ' ' somewhere in > it :( > > Please fix up and resend. > > thanks, > > greg k-h >From 717ec264a6212b8526c381d3673dd0ee45352266 Mon Sep 17 00:00:00 2001 From: Rishabh Hardas <rishabhhar...@gmail.com> Date: Tue, 22 Aug 2017 18:56:45 +0530 Subject: [PATCH v2] staging/ccree: Declare compiled out fuctions static inline Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- Changes in v2: Corrected my Name. drivers/staging/ccree/ssi_fips.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h index 369ddf9..63bcca7 100644 --- a/drivers/staging/ccree/ssi_fips.h +++ b/drivers/staging/ccree/ssi_fips.h @@ -40,8 +40,8 @@ static inline int ssi_fips_init(struct ssi_drvdata *p_drvdata) } static inline void ssi_fips_fini(struct ssi_drvdata *drvdata) {} -void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} -void fips_handler(struct ssi_drvdata *drvdata) {} +static inline void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} +static inline void fips_handler(struct ssi_drvdata *drvdata) {} #endif /* CONFIG_CRYPTO_FIPS */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline
On Wed, Aug 16, 2017 at 03:09:09PM -0700, Greg KH wrote: > On Mon, Jul 31, 2017 at 02:47:23PM +0530, RishabhHardas wrote: > > From: RishabhHardas <rishabhhar...@gmail.com> > > > > Sparse was giving out a warning for symbols 'cc_set_ree_fips_status' and > > 'fips_handler' > > that they were not declared and need to be made static. This patch makes > > both the symbols > > static inline, to remove the warnings. > > > > Signed-off-by: RishabhHardas <rishabhhar...@gmail.com> > > I doubt you sign your name on legal documents without a ' ' somewhere in > it :( > > Please fix up and resend. > > thanks, > > greg k-h From: Rishabh Hardas <rishabhhar...@gmail.com> Sparse was giving out a warning for symbols 'cc_set_ree_fips_status' and 'fips_handler' that they were not declared and need to be made static. This patch makes both the symbols static inline, to remove the warnings. Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/ccree/ssi_fips.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_fips.h b/drivers/staging/ccree/ssi_fips.h index 369ddf9..63bcca7 100644 --- a/drivers/staging/ccree/ssi_fips.h +++ b/drivers/staging/ccree/ssi_fips.h @@ -40,1 +40,1 @@ static inline int ssi_fips_init(struct ssi_drvdata *p_drvdata) } static inline void ssi_fips_fini(struct ssi_drvdata *drvdata) {} -void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} -void fips_handler(struct ssi_drvdata *drvdata) {} +static inline void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {} +static inline void fips_handler(struct ssi_drvdata *drvdata) {} #endif /* CONFIG_CRYPTO_FIPS */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/4] staging: pi433: Style fix - Correct long lines
On Sat, Aug 19, 2017 at 09:47:28PM -0700, Joe Perches wrote: > On Wed, 2017-08-16 at 10:31 +0300, Dan Carpenter wrote: > > On Wed, Aug 16, 2017 at 10:53:18AM +0530, Rishabh Hardas wrote: > > > @@ -143,10 +142,13 @@ struct pi433_rx_cfg { > > > > > > #define PI433_IOC_MAGIC 'r' > > > > > > -#define PI433_IOC_RD_TX_CFG _IOR(PI433_IOC_MAGIC, > > > PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)]) > > > -#define PI433_IOC_WR_TX_CFG _IOW(PI433_IOC_MAGIC, > > > PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)]) > > > - > > > -#define PI433_IOC_RD_RX_CFG _IOR(PI433_IOC_MAGIC, > > > PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)]) > > > -#define PI433_IOC_WR_RX_CFG _IOW(PI433_IOC_MAGIC, > > > PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)]) > > > +#define PI433_IOC_RD_TX_CFG _IOR(PI433_IOC_MAGIC, > > > PI433_TX_CFG_IOCTL_NR,\ > > > + char[sizeof(struct pi433_tx_cfg)]) > > > +#define PI433_IOC_WR_TX_CFG _IOW(PI433_IOC_MAGIC, > > > PI433_TX_CFG_IOCTL_NR,\ > > > + char[sizeof(struct pi433_tx_cfg)]) > > > +#define PI433_IOC_RD_RX_CFG _IOR(PI433_IOC_MAGIC, > > > PI433_RX_CFG_IOCTL_NR,\ > > > + char[sizeof(struct pi433_rx_cfg)]) > > > +#define PI433_IOC_WR_RX_CFG _IOW(PI433_IOC_MAGIC, > > > PI433_RX_CFG_IOCTL_NR,\ > > > + char[sizeof(struct pi433_rx_cfg)]) > > > > > > These don't help readability. The original was better. > > The original wasn't any good either. > > It'd be better to avoid the macros altogether > as almost all are use-once. > > So should I keep this as it is or remove the macros ? Because as Dan said the corrections that I made aren't goo either. Regards Rishabh Hardas ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/4] staging: pi433: Change Comments
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.h | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index 91e4a01..84032f3 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -126,9 +126,18 @@ struct pi433_rx_cfg { /* packet format */ enum optionOnOffenable_sync; - enum optionOnOffenable_length_byte; /* should be used in combination with sync, only */ - enum addressFiltering enable_address_filtering; /* operational with sync, only */ - enum optionOnOffenable_crc; /* only operational, if sync on and fixed length or length byte is used */ + enum optionOnOffenable_length_byte; /* should be used in + * combination with + * sync, only + */ + enum addressFiltering enable_address_filtering; /* operational + * with sync, only + */ + enum optionOnOffenable_crc; /* only operational, + *if sync on and fixed + * length or length + * byte is used + */ __u8sync_length; __u8fixed_message_length; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/4] staging: pi433: Renaming Enums
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.h | 36 drivers/staging/pi433/rf69.c | 26 +- drivers/staging/pi433/rf69.h | 26 +- drivers/staging/pi433/rf69_enum.h | 16 4 files changed, 50 insertions(+), 54 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index 84032f3..2929de0 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -62,21 +62,20 @@ struct pi433_tx_cfg { __u16 bit_rate; __u32 dev_frequency; enum modulation modulation; - enum modShaping modShaping; + enum mod_shapingmodShaping; - enum paRamp pa_ramp; + enum pa_ramppa_ramp; - enum txStartCondition tx_start_condition; + enum tx_start_condition tx_start_condition; __u16 repetitions; - /* packet format */ - enum optionOnOffenable_preamble; - enum optionOnOffenable_sync; - enum optionOnOffenable_length_byte; - enum optionOnOffenable_address_byte; - enum optionOnOffenable_crc; + enum option_on_off enable_preamble; + enum option_on_off enable_sync; + enum option_on_off enable_length_byte; + enum option_on_off enable_address_byte; + enum option_on_off enable_crc; __u16 preamble_length; __u8sync_length; @@ -86,7 +85,6 @@ struct pi433_tx_cfg { __u8address_byte; }; - /** * struct pi433_rx_config - describes the configuration of the radio module for * sending @@ -115,25 +113,24 @@ struct pi433_rx_cfg { enum modulation modulation; __u8rssi_threshold; - enum thresholdDecrement thresholdDecrement; - enum antennaImpedance antenna_impedance; - enum lnaGainlna_gain; + + enum threshold_decrementthresholdDecrement; + enum antenna_impedance antenna_impedance; + enum lna_gain lna_gain; enum mantisse bw_mantisse;/* normal: 0x50 */ __u8bw_exponent;/* during AFC: 0x8b */ enum dagc dagc; - - /* packet format */ - enum optionOnOffenable_sync; - enum optionOnOffenable_length_byte; /* should be used in + enum option_on_off enable_sync; + enum option_on_off enable_length_byte; /* should be used in * combination with * sync, only */ - enum addressFiltering enable_address_filtering; /* operational + enum address_filtering enable_address_filtering; /* operational * with sync, only */ - enum optionOnOffenable_crc; /* only operational, + enum option_on_off enable_crc; /* only operational, *if sync on and fixed * length or length * byte is used @@ -148,7 +145,6 @@ struct pi433_rx_cfg { __u8broadcast_address; }; - #define PI433_IOC_MAGIC'r' #define PI433_IOC_RD_TX_CFG_IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR,\ diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index f83523e..b7b8c7c 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -109,7 +109,7 @@ enum modulation rf69_get_modulation(struct spi_device *spi) } } -int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping modShaping) +int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping modShaping) { #ifdef DEBUG dev_dbg(>dev, "set: mod shaping"); @@ -264,7 +264,7 @@ int rf69_set_frequency(struct spi_device *spi, u32 frequency) return 0; } -int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: amp #0"); @@ -277,7 +277,7 @@ int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifie
[PATCH v2 4/4] staging: pi433: Remove camel case variable names
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 4 ++-- drivers/staging/pi433/pi433_if.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ed737f4..11c042b 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -192,7 +192,7 @@ struct pi433_instance { SET_CHECKED(rf69_set_modulation (dev->spi, rx_cfg->modulation)); SET_CHECKED(rf69_set_antenna_impedance (dev->spi, rx_cfg->antenna_impedance)); SET_CHECKED(rf69_set_rssi_threshold (dev->spi, rx_cfg->rssi_threshold)); - SET_CHECKED(rf69_set_ook_threshold_dec (dev->spi, rx_cfg->thresholdDecrement)); + SET_CHECKED(rf69_set_ook_threshold_dec (dev->spi, rx_cfg->threshold_decrement)); SET_CHECKED(rf69_set_bandwidth (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); SET_CHECKED(rf69_set_dagc(dev->spi, rx_cfg->dagc)); @@ -254,7 +254,7 @@ struct pi433_instance { SET_CHECKED(rf69_set_modulation (dev->spi, tx_cfg->modulation)); SET_CHECKED(rf69_set_deviation (dev->spi, tx_cfg->dev_frequency)); SET_CHECKED(rf69_set_pa_ramp(dev->spi, tx_cfg->pa_ramp)); - SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->modShaping)); + SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->mod_shaping)); SET_CHECKED(rf69_set_tx_start_condition(dev->spi, tx_cfg->tx_start_condition)); /* packet format enable */ diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index 2929de0..7f57e7d 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -62,7 +62,7 @@ struct pi433_tx_cfg { __u16 bit_rate; __u32 dev_frequency; enum modulation modulation; - enum mod_shapingmodShaping; + enum mod_shapingmod_shaping; enum pa_ramppa_ramp; @@ -114,8 +114,8 @@ struct pi433_rx_cfg { __u8rssi_threshold; - enum threshold_decrementthresholdDecrement; - enum antenna_impedance antenna_impedance; + enum threshold_decrementthreshold_decrement; + enum antenna_impedance antenna_impedance; enum lna_gain lna_gain; enum mantisse bw_mantisse;/* normal: 0x50 */ __u8bw_exponent;/* during AFC: 0x8b */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/4] staging: pi433: Style fix - Correct long lines
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.h | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index e6ed3cd..91e4a01 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -33,14 +33,13 @@ #include "rf69_enum.h" /*---*/ - - /*---*/ /* IOCTL structs and commands */ /** - * struct pi433_tx_config - describes the configuration of the radio module for sending + * struct pi433_tx_config - describes the configuration of the radio module for + * sending * @frequency: * @bit_rate: * @modulation: @@ -57,9 +56,8 @@ * * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_TX_CFG_IOCTL_NR 0 -struct pi433_tx_cfg -{ +#define PI433_TX_CFG_IOCTL_NR 0 +struct pi433_tx_cfg { __u32 frequency; __u16 bit_rate; __u32 dev_frequency; @@ -90,7 +88,8 @@ struct pi433_tx_cfg /** - * struct pi433_rx_config - describes the configuration of the radio module for sending + * struct pi433_rx_config - describes the configuration of the radio module for + * sending * @frequency: * @bit_rate: * @modulation: @@ -107,7 +106,7 @@ struct pi433_tx_cfg * * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_RX_CFG_IOCTL_NR 1 +#define PI433_RX_CFG_IOCTL_NR 1 struct pi433_rx_cfg { __u32 frequency; __u16 bit_rate; @@ -143,10 +142,13 @@ struct pi433_rx_cfg { #define PI433_IOC_MAGIC'r' -#define PI433_IOC_RD_TX_CFG_IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)]) -#define PI433_IOC_WR_TX_CFG_IOW(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)]) - -#define PI433_IOC_RD_RX_CFG_IOR(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)]) -#define PI433_IOC_WR_RX_CFG_IOW(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)]) +#define PI433_IOC_RD_TX_CFG_IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR,\ +char[sizeof(struct pi433_tx_cfg)]) +#define PI433_IOC_WR_TX_CFG_IOW(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR,\ +char[sizeof(struct pi433_tx_cfg)]) +#define PI433_IOC_RD_RX_CFG_IOR(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR,\ +char[sizeof(struct pi433_rx_cfg)]) +#define PI433_IOC_WR_RX_CFG_IOW(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR,\ +char[sizeof(struct pi433_rx_cfg)]) #endif /* PI433_H */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/4] staging: pi433: Rename camel case and other style issues
Hi, This series pf patches solves some of the coding style issues. I have corrected long lines, changed comment style, renamed enums and variables that were in camel case. Tried to get zero erros and warnings on the pi433_if.h file. Regards, Rishabh Hardas Rishabh Hardas (4): staging: pi433: Style fix - Correct long lines staging: pi433: Change Comments staging: pi433: Renaming Enums staging: pi433: Remove camel case variable names drivers/staging/pi433/pi433_if.c | 4 +-- drivers/staging/pi433/pi433_if.h | 73 +-- drivers/staging/pi433/rf69.c | 26 +++--- drivers/staging/pi433/rf69.h | 26 +++--- drivers/staging/pi433/rf69_enum.h | 16 - 5 files changed, 76 insertions(+), 69 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging/pi433/rf69_enum.h:Removed Coding style issues from pi433_if.h and other dependencies arising from it.
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/rf69_enum.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/pi433/rf69_enum.h b/drivers/staging/pi433/rf69_enum.h index fbfb59b..f51eec3 100644 --- a/drivers/staging/pi433/rf69_enum.h +++ b/drivers/staging/pi433/rf69_enum.h @@ -18,2 +18,2 @@ #ifndef RF69_ENUM_H #define RF69_ENUM_H -enum optionOnOff +enum option_on_off { optionOff, optionOn @@ -46,2 +46,2 @@ enum modulation FSK }; -enum modShaping +enum mod_shaping { shapingOff, shaping1_0, @@ -56,2 +56,2 @@ enum modShaping shaping2BR }; -enum paRamp +enum pa_ramp { ramp3400, ramp2000, @@ -76,2 +76,2 @@ enum paRamp ramp10 }; -enum antennaImpedance +enum antenna_impedance { fiftyOhm, twohundretOhm }; -enum lnaGain +enum lnagain { automatic, max, @@ -132,2 +132,2 @@ enum thresholdStep step_6_0db }; -enum thresholdDecrement +enum threshold_decrement { dec_every8th, dec_every4th, @@ -177,2 +177,2 @@ enum packetFormat packetLengthVar }; -enum txStartCondition +enum tx_start_condition { fifoLevel, fifoNotEmpty }; -enum addressFiltering +enum address_filtering { filteringOff, nodeAddress, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging/pi433/rf69.h:Removed Coding style issues from pi433_if.h and other dependencies arising from it.
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/rf69.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h index b81e076..e98e24e 100644 --- a/drivers/staging/pi433/rf69.h +++ b/drivers/staging/pi433/rf69.h @@ -29,18 +29,18 @@ int rf69_set_mode(struct spi_device *spi, enum mode mode); int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode); int rf69_set_modulation(struct spi_device *spi, enum modulation modulation); enum modulation rf69_get_modulation(struct spi_device *spi); -int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping modShaping); +int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping modShaping); int rf69_set_bit_rate(struct spi_device *spi, u16 bitRate); int rf69_set_deviation(struct spi_device *spi, u32 deviation); int rf69_set_frequency(struct spi_device *spi, u32 frequency); -int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff); +int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off optionOnOff); int rf69_set_output_power_level(struct spi_device *spi, u8 powerLevel); -int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp); -int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance antennaImpedance); -int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain); -enum lnaGain rf69_get_lna_gain(struct spi_device *spi); +int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp); +int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance antennaImpedance); +int rf69_set_lna_gain(struct spi_device *spi, enum lnagain lnaGain); +enum lnagain rf69_get_lna_gain(struct spi_device *spi); int rf69_set_dc_cut_off_frequency_intern(struct spi_device *spi, u8 reg, enum dccPercent dccPercent); int rf69_set_dc_cut_off_frequency(struct spi_device *spi, enum dccPercent dccPercent); int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum dccPercent dccPercent); @@ -48,7 +48,7 @@ int rf69_set_bandwidth(struct spi_device *spi, enum mantisse mantisse, u8 expone int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse mantisse, u8 exponent); int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType thresholdType); int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep thresholdStep); -int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement thresholdDecrement); +int rf69_set_ook_threshold_dec(struct spi_device *spi, enum threshold_decrement thresholdDecrement); int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value); bool rf69_get_flag(struct spi_device *spi, enum flag flag); int rf69_reset_flag(struct spi_device *spi, enum flag flag); @@ -56,18 +56,18 @@ int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold); int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout); int rf69_set_rssi_timeout(struct spi_device *spi, u8 timeout); int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength); -int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff); +int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off optionOnOff); int rf69_set_fifo_fill_condition(struct spi_device *spi, enum fifoFillCondition fifoFillCondition); int rf69_set_sync_size(struct spi_device *spi, u8 sync_size); int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance); int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8]); int rf69_set_packet_format(struct spi_device * spi, enum packetFormat packetFormat); -int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering addressFiltering); +int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering addressFiltering); int rf69_set_payload_length(struct spi_device *spi, u8 payloadLength); u8 rf69_get_payload_length(struct spi_device *spi); int rf69_set_node_address(struct spi_device *spi, u8 nodeAddress); int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress); -int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition txStartCondition); +int rf69_set_tx_start_condition(struct spi_device *spi, enum tx_start_condition txStartCondition); int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold)
[PATCH 4/5] staging/pi433/rf69.c:Removed Coding style issues from pi433_if.h and other dependencies arising from it.
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/rf69.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index f83523e..7fa63e1 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -109,2 +109,2 @@ enum modulation rf69_get_modulation(struct spi_device *spi) } } -int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping modShaping) +int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping modShaping) { #ifdef DEBUG dev_dbg(>dev, "set: mod shaping"); @@ -264,2 +264,2 @@ int rf69_set_frequency(struct spi_device *spi, u32 frequency) return 0; } -int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: amp #0"); @@ -277,2 +277,2 @@ int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: amp #1"); @@ -290,2 +290,2 @@ int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: amp #2"); @@ -319,2 +319,2 @@ int rf69_set_output_power_level(struct spi_device *spi, u8 powerLevel) return WRITE_REG(REG_PALEVEL, (READ_REG(REG_PALEVEL) & ~MASK_PALEVEL_OUTPUT_POWER) | powerLevel); } -int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp) +int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp) { #ifdef DEBUG dev_dbg(>dev, "set: pa ramp"); @@ -346,2 +346,2 @@ int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp) } } -int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance antennaImpedance) +int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance antennaImpedance) { #ifdef DEBUG dev_dbg(>dev, "set: antenna impedance"); @@ -359,2 +359,2 @@ int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance ant } } -int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain) +int rf69_set_lna_gain(struct spi_device *spi, enum lnagain lnaGain) { #ifdef DEBUG dev_dbg(>dev, "set: lna gain"); @@ -377,2 +377,2 @@ int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain) } } -enum lnaGain rf69_get_lna_gain(struct spi_device *spi) +enum lnagain rf69_get_lna_gain(struct spi_device *spi) { u8 currentValue; @@ -516,2 +516,2 @@ int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep thres } } -int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement thresholdDecrement) +int rf69_set_ook_threshold_dec(struct spi_device *spi, enum threshold_decrement thresholdDecrement) { #ifdef DEBUG dev_dbg(>dev, "set: threshold decrement"); @@ -666,2 +666,2 @@ int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength) return retval; } -int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: sync enable"); @@ -753,2 +753,2 @@ int rf69_set_packet_format(struct spi_device * spi, enum packetFormat packetForm } } -int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(>dev, "set: crc enable"); @@ -766,2 +766,2 @@ int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering addressFiltering) +int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering addressFiltering) { #ifdef DEBUG dev_dbg(>dev, "set: address filtering"); @@ -816,2 +816,2 @@ int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress) return WRITE_REG(REG_BROADCASTADRS, broadcastAddress); } -int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition txStartCondition) +int rf69_se
[PATCH 1/5] staging/pi433:Removed Coding style issues from pi433_if.h and other dependencies arising from it.
This is a 5 patch series which solves coding style issues as marked by checkpatch.pl in the file pi433_if.h and contains changes that have to be made in other files as a consequence of the changes made in pi433_if.h Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.h | 81 +--- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index e6ed3cd..d87434c 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -32,15 +32,11 @@ #include #include "rf69_enum.h" -/*---*/ - - -/*---*/ - /* IOCTL structs and commands */ /** - * struct pi433_tx_config - describes the configuration of the radio module for sending + * struct pi433_tx_config - describes the configuration of + * the radio module for sending * @frequency: * @bit_rate: * @modulation: @@ -57,28 +53,26 @@ * * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_TX_CFG_IOCTL_NR 0 -struct pi433_tx_cfg -{ +#define PI433_TX_CFG_IOCTL_NR 0 +struct pi433_tx_cfg { __u32 frequency; __u16 bit_rate; __u32 dev_frequency; enum modulation modulation; - enum modShaping modShaping; + enum mod_shapingmod_shaping; - enum paRamp pa_ramp; + enum pa_ramppa_ramp; - enum txStartCondition tx_start_condition; + enum tx_start_condition tx_start_condition; __u16 repetitions; - /* packet format */ - enum optionOnOffenable_preamble; - enum optionOnOffenable_sync; - enum optionOnOffenable_length_byte; - enum optionOnOffenable_address_byte; - enum optionOnOffenable_crc; + enum option_on_off enable_preamble; + enum option_on_off enable_sync; + enum option_on_off enable_length_byte; + enum option_on_off enable_address_byte; + enum option_on_off enable_crc; __u16 preamble_length; __u8sync_length; @@ -88,9 +82,9 @@ struct pi433_tx_cfg __u8address_byte; }; - /** - * struct pi433_rx_config - describes the configuration of the radio module for sending + * struct pi433_rx_config - describes the configuration of + * the radio module for sending * @frequency: * @bit_rate: * @modulation: @@ -107,29 +101,37 @@ struct pi433_tx_cfg * * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_RX_CFG_IOCTL_NR 1 +#define PI433_RX_CFG_IOCTL_NR 1 struct pi433_rx_cfg { __u32 frequency; __u16 bit_rate; __u32 dev_frequency; - enum modulation modulation; + enum modulation modulation; - __u8rssi_threshold; - enum thresholdDecrement thresholdDecrement; - enum antennaImpedance antenna_impedance; - enum lnaGainlna_gain; - enum mantisse bw_mantisse;/* normal: 0x50 */ - __u8bw_exponent;/* during AFC: 0x8b */ - enum dagc dagc; + __u8rssi_threshold; + enum threshold_decrementthreshold_decrement; + enum antenna_impedance antenna_impedance; + enum lnagainlna_gain; + enum mantisse bw_mantisse;/* normal: 0x50 */ + __u8bw_exponent;/* during AFC: 0x8b */ + enum dagc dagc; /* packet format */ - enum optionOnOffenable_sync; - enum optionOnOffenable_length_byte; /* should be used in combination with sync, only */ - enum addressFiltering enable_address_filtering; /* operational with sync, only */ - enum optionOnOffenable_crc; /* only operational, if sync on and fixed length or length byte is used */ + enum option_on_off enable_sync; + enum option_on_off enable_length_byte;/* should be used + * in combination + * with sync,only + */ + enum address_filtering enable_address_filtering;/* operational with + *sync, only + */ + enum option_on_off enable_crc;/* only operational, if sync on + *
[PATCH 2/5] staging/pi433/pi433_if.c:Removed Coding style issues from pi433_if.h and other dependencies arising from it.
Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ed737f4..11c042b 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -192,7 +192,7 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) SET_CHECKED(rf69_set_modulation (dev->spi, rx_cfg->modulation)); SET_CHECKED(rf69_set_antenna_impedance (dev->spi, rx_cfg->antenna_impedance)); SET_CHECKED(rf69_set_rssi_threshold (dev->spi, rx_cfg->rssi_threshold)); - SET_CHECKED(rf69_set_ook_threshold_dec (dev->spi, rx_cfg->thresholdDecrement)); + SET_CHECKED(rf69_set_ook_threshold_dec (dev->spi, rx_cfg->threshold_decrement)); SET_CHECKED(rf69_set_bandwidth (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); SET_CHECKED(rf69_set_dagc(dev->spi, rx_cfg->dagc)); @@ -254,5 +254,5 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct pi433_tx_cfg *tx_cfg) SET_CHECKED(rf69_set_modulation (dev->spi, tx_cfg->modulation)); SET_CHECKED(rf69_set_deviation (dev->spi, tx_cfg->dev_frequency)); SET_CHECKED(rf69_set_pa_ramp(dev->spi, tx_cfg->pa_ramp)); - SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->modShaping)); + SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->mod_shaping)); SET_CHECKED(rf69_set_tx_start_condition(dev->spi, tx_cfg->tx_start_condition)); /* packet format enable */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/pi433: Solved some coding style issues in pi433_if.c
From: Rishabh Hardas <rishabhhar...@gmail.com> Solved a few coding style issues, used BIT macro to set MINORBITS. Signed-off-by: Rishabh Hardas <rishabhhar...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index d9328ce..f10ffc3 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -47,18 +47,18 @@ #include #include #include +#include #ifdef CONFIG_COMPAT -#include +#include #endif #include "pi433_if.h" #include "rf69.h" - -#define N_PI433_MINORS (1U << MINORBITS) /*32*//* ... up to 256 */ -#define MAX_MSG_SIZE 900 /* min: FIFO_SIZE! */ -#define MSG_FIFO_SIZE 65536 /* 65536 = 2^16 */ -#define NUM_DIO2 +#define N_PI433_MINORS BIT(MINORBITS) /*32*/ /* ... up to 256 */ +#define MAX_MSG_SIZE 900 /* min: FIFO_SIZE! */ +#define MSG_FIFO_SIZE 65536 /* 65536 = 2^16 */ +#define NUM_DIO2 static dev_t pi433_dev; static DEFINE_IDR(pi433_idr); @@ -66,10 +66,14 @@ static struct class *pi433_class; /* mainly for udev to create /dev/pi433 */ -/* tx config is instance specific - so with each open a new tx config struct is needed */ -/* rx config is device specific - so we have just one rx config, ebedded in device struct */ +/* + * tx config is instance specific + * so with each open a new tx config struct is needed + */ +/* + * rx config is device specific + * so we have just one rx config, ebedded in device struct + */ struct pi433_device { /* device handling related values */ dev_t devt; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel