[PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define

Shahar Avidar posted 4 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define
Posted by Shahar Avidar 1 year, 11 months ago
F_OSC is already defined & only used by rf69.c source file
Also fix define comment

Signed-off-by: Shahar Avidar <ikobh7@gmail.com>
---
 drivers/staging/pi433/rf69.c | 2 +-
 drivers/staging/pi433/rf69.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 8c7fab6a46bb..d7e2dbe70d7c 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -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 */
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 78fa0b8bab8b..52e43a909b03 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -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 */
-- 
2.34.1
Re: [PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define
Posted by Andy Shevchenko 1 year, 11 months ago
On Sun, Feb 25, 2024 at 07:33:38PM +0200, Shahar Avidar wrote:
> F_OSC is already defined & only used by rf69.c source file
> Also fix define comment

You missed periods at the end of the sentences.

...

> -#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).

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 1/4] staging: pi433: Remove a duplicated F_OSC define
Posted by Shahar Avidar 1 year, 11 months ago
On 26/02/2024 16:45, Andy Shevchenko wrote:
> On Sun, Feb 25, 2024 at 07:33:38PM +0200, Shahar Avidar wrote:
>> F_OSC is already defined & only used by rf69.c source file
>> Also fix define comment
> 
> You missed periods at the end of the sentences.

Thank you for noticing.

>> -#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...

-- 
Regards,

Shahar