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

Message ID 20240225173341.1278918-2-ikobh7@gmail.com
State New
Headers
Series Fix defines in rf69.h |

Commit Message

Shahar Avidar Feb. 25, 2024, 5:33 p.m. UTC
  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(-)
  

Comments

Andy Shevchenko Feb. 26, 2024, 2:45 p.m. UTC | #1
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).
  
Shahar Avidar Feb. 27, 2024, 10:17 p.m. UTC | #2
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...
  

Patch

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 */