Skip to content

Commit 42324d9

Browse files
claudiubezneabebarino
authored andcommitted
clk: at91: replace conditional operator with double logical not
Replace conditional operator with double logical not as code may be simpler to read. Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent e1e3e70 commit 42324d9

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

drivers/clk/at91/clk-generated.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int clk_generated_is_enabled(struct clk_hw *hw)
8383
regmap_read(gck->regmap, gck->layout->offset, &status);
8484
spin_unlock_irqrestore(gck->lock, flags);
8585

86-
return status & AT91_PMC_PCR_GCKEN ? 1 : 0;
86+
return !!(status & AT91_PMC_PCR_GCKEN);
8787
}
8888

8989
static unsigned long

drivers/clk/at91/clk-main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static bool clk_main_rc_osc_ready(struct regmap *regmap)
175175

176176
regmap_read(regmap, AT91_PMC_SR, &status);
177177

178-
return status & AT91_PMC_MOSCRCS;
178+
return !!(status & AT91_PMC_MOSCRCS);
179179
}
180180

181181
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)
336336

337337
regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status);
338338

339-
return status & AT91_PMC_MAINRDY ? 1 : 0;
339+
return !!(status & AT91_PMC_MAINRDY);
340340
}
341341

342342
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)
398398

399399
regmap_read(regmap, AT91_PMC_SR, &status);
400400

401-
return status & AT91_PMC_MOSCSELS ? 1 : 0;
401+
return !!(status & AT91_PMC_MOSCSELS);
402402
}
403403

404404
static int clk_sam9x5_main_prepare(struct clk_hw *hw)

drivers/clk/at91/clk-master.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline bool clk_master_ready(struct regmap *regmap)
3333

3434
regmap_read(regmap, AT91_PMC_SR, &status);
3535

36-
return status & AT91_PMC_MCKRDY ? 1 : 0;
36+
return !!(status & AT91_PMC_MCKRDY);
3737
}
3838

3939
static int clk_master_prepare(struct clk_hw *hw)

drivers/clk/at91/clk-peripheral.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int clk_sam9x5_peripheral_is_enabled(struct clk_hw *hw)
208208
regmap_read(periph->regmap, periph->layout->offset, &status);
209209
spin_unlock_irqrestore(periph->lock, flags);
210210

211-
return status & AT91_PMC_PCR_EN ? 1 : 0;
211+
return !!(status & AT91_PMC_PCR_EN);
212212
}
213213

214214
static unsigned long

drivers/clk/at91/clk-system.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline bool clk_system_ready(struct regmap *regmap, int id)
3434

3535
regmap_read(regmap, AT91_PMC_SR, &status);
3636

37-
return status & (1 << id) ? 1 : 0;
37+
return !!(status & (1 << id));
3838
}
3939

4040
static int clk_system_prepare(struct clk_hw *hw)
@@ -74,7 +74,7 @@ static int clk_system_is_prepared(struct clk_hw *hw)
7474

7575
regmap_read(sys->regmap, AT91_PMC_SR, &status);
7676

77-
return status & (1 << sys->id) ? 1 : 0;
77+
return !!(status & (1 << sys->id));
7878
}
7979

8080
static const struct clk_ops system_ops = {

0 commit comments

Comments
 (0)