Fix defines in rf69.h
cover Fix defines in rf69.h
This patchset fixes several misuses of the define statement in rf69.h Duplicted defines.
Define in header instead of source file.
Unused define.
Shahar Avidar (4):
staging: pi433: Remove a duplicated F_OSC define
staging: pi433: Remove the unused FREQUENCY define
staging: pi433: Remove a duplicated FIFO_SIZE define
staging: pi433: Move FIFO_THRESHOLD define to source file
drivers/staging/pi433/pi433_if.c | 1 + drivers/staging/pi433/rf69.c | 3 +-- drivers/staging/pi433/rf69.h | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-)
base-commit: 455c5e12a3b7d08c2ab47b7dd54944901c69cdcd
Signature · 1 line
2.34.1
PATCH 1/4 staging: pi433: Remove a duplicated F_OSC define
F_OSC is already defined & only used by rf69.c source file Also fix define comment
--- drivers/staging/pi433/rf69.c | 2 +- drivers/staging/pi433/rf69.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/staging/pi433/rf69.c +1 -1
@@ -12,7 +12,7 @@#include "rf69.h" #include "rf69_registers.h" -#define F_OSC 32000000/* in Hz */ +#define F_OSC 32000000/* Hz */ #define FIFO_SIZE 66/* in byte */ /*-------------------------------------------------------------------------*/
drivers/staging/pi433/rf69.h +0 -1
@@ -12,7 +12,6 @@#include "rf69_registers.h" /* NOTE: Modifying FREQUENCY value impacts CE certification */ -#define F_OSC 32000000/* Hz */ #define FREQUENCY 433920000/* Hz */ #define FIFO_SIZE 66/* bytes */ #define FIFO_THRESHOLD 15/* bytes */
Signature · 1 line
2.34.1
Re: [PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define
Quoted 2 lines · Shahar Avidar
F_OSCis already defined & only used byrf69.csource file Also fix define comment
You missed periods at the end of the sentences.
...
drivers/staging/pi433/rf69.c line 15
Quoted 2 lines
drivers/staging/pi433/rf69.c +1
-1-#define F_OSC 32000000/* in Hz */ +#define F_OSC 32000000/* Hz */
Instead of having a comment you can
#include <linux/units.h> ... #define F_OSC (32 * HZ_PER_MHZ)
which will be more robust code (no need to count 0s).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Shahar Avidar
F_OSCis already defined & only used byrf69.csource file Also fix define commentYou missed periods at the end of the sentences.
Thank you for noticing.
Quoted 11 lines
drivers/staging/pi433/rf69.c line 15
Quoted 2 lines
drivers/staging/pi433/rf69.c +1
-1-#define F_OSC 32000000/* in Hz */ +#define F_OSC 32000000/* Hz */ Instead of having a comment you can
#include <linux/units.h> ... #define F_OSC (32 * HZ_PER_MHZ)which will be more robust code (no need to count 0s).
All comments are fixed in v2 which was just sent.
Please note I sent the updated patchset twice, I forgot to add v2 the first time...
Signature · 3 lines
Regards, Shahar
PATCH 2/4 staging: pi433: Remove the unused FREQUENCY define
In reply to Shahar AvidarFREQUENCY is not being used, delete its comment
--- drivers/staging/pi433/rf69.h | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/pi433/rf69.h +0 -2
@@ -11,8 +11,6 @@#include "rf69_enum.h" #include "rf69_registers.h" -/* NOTE: Modifying FREQUENCY value impacts CE certification */ -#define FREQUENCY 433920000/* Hz */ #define FIFO_SIZE 66/* bytes */ #define FIFO_THRESHOLD 15/* bytes */
Signature · 1 line
2.34.1
PATCH 3/4 staging: pi433: Remove a duplicated FIFO_SIZE define
In reply to Shahar AvidarFIFO_SIZE is being used in both rf69.c & pi433_if.c source files It is also already defined in rf69.h header file
--- drivers/staging/pi433/rf69.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/pi433/rf69.c +0 -1
@@ -13,7 +13,6 @@#include "rf69_registers.h" #define F_OSC 32000000/* Hz */ -#define FIFO_SIZE 66/* in byte */ /*-------------------------------------------------------------------------*/
Signature · 1 line
2.34.1
Re: [PATCH 3/4] staging: pi433: Remove a duplicated FIFO_SIZE define
Quoted 2 lines · Shahar Avidar
FIFO_SIZEis being used in bothrf69.c&pi433_if.csource files It is also already defined inrf69.hheader file
You can done this before patch 1, so the code will be cleaner already.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 4/4 staging: pi433: Move FIFO_THRESHOLD define to source file
In reply to Shahar AvidarFIFO_THRESHOLD is only being used by pi433_if.c source file
--- drivers/staging/pi433/pi433_if.c | 1 + drivers/staging/pi433/rf69.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/pi433_if.c +1 -0
@@ -49,6 +49,7 @@#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 FIFO_THRESHOLD 15/* bytes */ #define NUM_DIO 2static dev_t pi433_dev;
drivers/staging/pi433/rf69.h +0 -1
@@ -12,7 +12,6 @@#include "rf69_registers.h" #define FIFO_SIZE 66/* bytes */ -#define FIFO_THRESHOLD 15/* bytes */ u8 rf69_read_reg (struct spi_device *spi,u8 addr);int rf69_get_version (struct spi_device *spi);
Signature · 1 line
2.34.1
Re: [PATCH 4/4] staging: pi433: Move FIFO_THRESHOLD define to source file
Quoted 1 line · Shahar Avidar
FIFO_THRESHOLDis only being used bypi433_if.csource file
Same issue (and seems in all of your commit messages) — missing periods at the end of the sentences. Respect English grammar, please.
Signature · 2 lines
With Best Regards, Andy Shevchenko