clk: at91: replace conditional operator with double logical not
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 22 Jul 2020 07:38:17 +0000 (10:38 +0300)
committerStephen Boyd <sboyd@kernel.org>
Fri, 24 Jul 2020 09:19:08 +0000 (02:19 -0700)
Replace conditional operator with double logical not as code
may be simpler to read.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1595403506-8209-10-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/at91/clk-generated.c
drivers/clk/at91/clk-main.c
drivers/clk/at91/clk-master.c
drivers/clk/at91/clk-peripheral.c
drivers/clk/at91/clk-system.c

index f8e557e0e1b879deb351a2ea392dd4667abb3d37..2448bdc634251c4722d7912a1c6a6e3ac16b06eb 100644 (file)
@@ -83,7 +83,7 @@ static int clk_generated_is_enabled(struct clk_hw *hw)
        regmap_read(gck->regmap, gck->layout->offset, &status);
        spin_unlock_irqrestore(gck->lock, flags);
 
-       return status & AT91_PMC_PCR_GCKEN ? 1 : 0;
+       return !!(status & AT91_PMC_PCR_GCKEN);
 }
 
 static unsigned long
index 37c22667e8319011aa5528613c26a9e0544e3e6e..5c83e899084ffe9e1d3955e5aa074991bc998b33 100644 (file)
@@ -175,7 +175,7 @@ static bool clk_main_rc_osc_ready(struct regmap *regmap)
 
        regmap_read(regmap, AT91_PMC_SR, &status);
 
-       return status & AT91_PMC_MOSCRCS;
+       return !!(status & AT91_PMC_MOSCRCS);
 }
 
 static int clk_main_rc_osc_prepare(struct clk_hw *hw)
@@ -336,7 +336,7 @@ static int clk_rm9200_main_is_prepared(struct clk_hw *hw)
 
        regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status);
 
-       return status & AT91_PMC_MAINRDY ? 1 : 0;
+       return !!(status & AT91_PMC_MAINRDY);
 }
 
 static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw,
@@ -398,7 +398,7 @@ static inline bool clk_sam9x5_main_ready(struct regmap *regmap)
 
        regmap_read(regmap, AT91_PMC_SR, &status);
 
-       return status & AT91_PMC_MOSCSELS ? 1 : 0;
+       return !!(status & AT91_PMC_MOSCSELS);
 }
 
 static int clk_sam9x5_main_prepare(struct clk_hw *hw)
index e7e0ba652de1aad8313342cc7a0ed6a8b32d1ee6..88d545b1698ce431211509e0d078e5535d231ca9 100644 (file)
@@ -33,7 +33,7 @@ static inline bool clk_master_ready(struct regmap *regmap)
 
        regmap_read(regmap, AT91_PMC_SR, &status);
 
-       return status & AT91_PMC_MCKRDY ? 1 : 0;
+       return !!(status & AT91_PMC_MCKRDY);
 }
 
 static int clk_master_prepare(struct clk_hw *hw)
index c2ab4860a2bfdd56fd8fa48f7af6fbb3a0cbf589..4c9a4147dfe5d1598961504044699c6c56405dc2 100644 (file)
@@ -208,7 +208,7 @@ static int clk_sam9x5_peripheral_is_enabled(struct clk_hw *hw)
        regmap_read(periph->regmap, periph->layout->offset, &status);
        spin_unlock_irqrestore(periph->lock, flags);
 
-       return status & AT91_PMC_PCR_EN ? 1 : 0;
+       return !!(status & AT91_PMC_PCR_EN);
 }
 
 static unsigned long
index c4b3877aa445fc8c9f9284065c2308ac337ea171..f83ec0de86c36cf4aa505dd9deb6e75a2af7e746 100644 (file)
@@ -34,7 +34,7 @@ static inline bool clk_system_ready(struct regmap *regmap, int id)
 
        regmap_read(regmap, AT91_PMC_SR, &status);
 
-       return status & (1 << id) ? 1 : 0;
+       return !!(status & (1 << id));
 }
 
 static int clk_system_prepare(struct clk_hw *hw)
@@ -74,7 +74,7 @@ static int clk_system_is_prepared(struct clk_hw *hw)
 
        regmap_read(sys->regmap, AT91_PMC_SR, &status);
 
-       return status & (1 << sys->id) ? 1 : 0;
+       return !!(status & (1 << sys->id));
 }
 
 static const struct clk_ops system_ops = {