On 5 April 2012 16:48, Igor Mitsyanko <i.mitsya...@samsung.com> wrote: > For the sake of code clarity > > Signed-off-by: Igor Mitsyanko <i.mitsya...@samsung.com> > --- > hw/sd.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/sd.c b/hw/sd.c > index e1c998c..7160e8c 100644 > --- a/hw/sd.c > +++ b/hw/sd.c > @@ -539,9 +539,9 @@ static void sd_function_switch(SDState *sd, uint32_t arg) > sd->data[66] = crc & 0xff; > } > > -static inline int sd_wp_addr(SDState *sd, uint32_t addr) > +static inline bool sd_wp_addr(SDState *sd, uint32_t addr) > { > - return test_bit(addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT), > + return !!test_bit(addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT), > sd->wp_groups); > }
The !! is unnecessary: (a) test_bit always returns 0 or 1 and (b) the cast from int to bool will convert anything-not-zero to 1 anyway. -- PMM