lkml.org 
[lkml]   [2015]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/2] KVM: kvm_para_has_feature can be boolean
    Date
    This patch makes kvm_para_has_feature return bool due to this
    particular function only using either one or zero as its return
    value.

    No functional change.

    Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
    ---
    include/linux/kvm_para.h | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
    index 00a97bb..35e568f 100644
    --- a/include/linux/kvm_para.h
    +++ b/include/linux/kvm_para.h
    @@ -4,10 +4,8 @@
    #include <uapi/linux/kvm_para.h>


    -static inline int kvm_para_has_feature(unsigned int feature)
    +static inline bool kvm_para_has_feature(unsigned int feature)
    {
    - if (kvm_arch_para_features() & (1UL << feature))
    - return 1;
    - return 0;
    + return !!(kvm_arch_para_features() & (1UL << feature));
    }
    #endif /* __LINUX_KVM_PARA_H */
    --
    1.9.1




    \
     
     \ /
      Last update: 2015-11-14 04:41    [W:4.240 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site