Skip to contentSkip to conversation

staging: rts5208: Comparisons should place the constant on the right side of the test

PATCH Greg KH 4 participants 4 messages Sep 15, 2016 – Sep 16, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Greg KH

author
#1 lore raw
Quoted 10 lines · Sergio Paracuellos
---
 drivers/staging/rts5208/rtsx_card.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_card.c +0 -0
index 9a5cd63..551e3064 100644

drivers/staging/rts5208/rtsx_card.c int switch_ssc_clock(struct rtsx_chip *chip, int clk) · line 648

Quoted 5 lines
drivers/staging/rts5208/rtsx_card.c +1 -1
@@ -645,7 +645,7 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)
 	dev_dbg(rtsx_dev(chip), "Switch SSC clock to %dMHz (cur_clk = %d)\n",
 		clk, chip->cur_clk);
 
-	if ((clk <= 2) || (N > max_N)) {
+	if ((clk <= 2) || (max_N < N)) {

Where is the constant?

The original code looks fine to me...

Also, I can't take patches where there is no changelog text, sorry.

greg k-h

#2 lore raw

That's true. It seems that checkpatch script is getting a false positive. Just trying to do checkpatch happy. Sorry for inconvenience.

I'll be careful with Changelog stuff from now. Thanks for advice.

Cheers,
Sergio Paracuellos

Quoted 25 lines · Greg KH
Quoted 10 lines · Sergio Paracuellos
---
  drivers/staging/rts5208/rtsx_card.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_card.c +0 -0
index 9a5cd63..551e3064 100644

drivers/staging/rts5208/rtsx_card.c int switch_ssc_clock(struct rtsx_chip *chip, int clk) · line 648

Quoted 5 lines
drivers/staging/rts5208/rtsx_card.c +1 -1
@@ -645,7 +645,7 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)
  	dev_dbg(rtsx_dev(chip), "Switch SSC clock to %dMHz (cur_clk = %d)\n",
  		clk, chip->cur_clk);
 
-	if ((clk <= 2) || (N > max_N)) {
+	if ((clk <= 2) || (max_N < N)) {

Where is the constant?

The original code looks fine to me...

Also, I can't take patches where there is no changelog text, sorry.

greg k-h

#3 lore raw
Quoted 2 lines · Sergio Paracuellos

That's true. It seems that checkpatch script is getting a false positive. Just trying to do checkpatch happy. Sorry for inconvenience.

Keeping the style consistent instead of taking the simplest path to quiet the checkpatch messages is better.

Making N, min_N, max_N all lower case would be better.

#4 lore raw
In reply to Sergio Paracuellos
Quoted 2 lines · Sergio Paracuellos

That's true. It seems that checkpatch script is getting a false positive. Just trying to do checkpatch happy.

Also the old code was better than new code so leave it alone.

regards,
dan carpenter