diff mbox

[ovs-dev] hash: Remove conflicting hash_finish() prototype.

Message ID 20170613153116.14536-1-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff June 13, 2017, 3:31 p.m. UTC
Normally, hash_finish() is declared as:
static inline uint32_t hash_finish(uint32_t hash, uint32_t final)

When __SSE4_2__ && __x86_64__, it is declared as:
static inline uint32_t hash_finish(uint64_t hash, uint64_t final)

A recent commit added an unneeded prototype in the first form, which caused
an error due to the redeclaration of a different type when the second form
was actually used.  This removes the prototype, fixing the problem.

It may not be a great idea to have two different forms for this function,
but it's long standing and so I don't want to change it immediately without
proper consideration.

Reported-by: "Fischetti, Antonio" <antonio.fischetti@intel.com>
Fixes: 67702b79d845 ("hash: New helper functions for adding words in a buffer to a hash.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/hash.h | 1 -
 1 file changed, 1 deletion(-)

Comments

Darrell Ball June 13, 2017, 4:17 p.m. UTC | #1
I have been looking to fixing this when I saw the e-mail from Antonio
Using intrinsic mode is failing the “hash functions” test (#44),
which I suppose is better than never having being able to build.

 



On 6/13/17, 8:31 AM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:

    Normally, hash_finish() is declared as:
    static inline uint32_t hash_finish(uint32_t hash, uint32_t final)
    
    When __SSE4_2__ && __x86_64__, it is declared as:
    static inline uint32_t hash_finish(uint64_t hash, uint64_t final)
    
    A recent commit added an unneeded prototype in the first form, which caused
    an error due to the redeclaration of a different type when the second form
    was actually used.  This removes the prototype, fixing the problem.
    
    It may not be a great idea to have two different forms for this function,
    but it's long standing and so I don't want to change it immediately without
    proper consideration.
    
    Reported-by: "Fischetti, Antonio" <antonio.fischetti@intel.com>
    Fixes: 67702b79d845 ("hash: New helper functions for adding words in a buffer to a hash.")
    Signed-off-by: Ben Pfaff <blp@ovn.org>

    ---
     lib/hash.h | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/lib/hash.h b/lib/hash.h
    index 7dffeaa9cacc..a642a1e97954 100644
    --- a/lib/hash.h
    +++ b/lib/hash.h
    @@ -92,7 +92,6 @@ static inline uint32_t mhash_finish(uint32_t hash)
     
     static inline uint32_t hash_add(uint32_t hash, uint32_t data);
     static inline uint32_t hash_add64(uint32_t hash, uint64_t data);
    -static inline uint32_t hash_finish(uint32_t hash, uint32_t final);
     
     static inline uint32_t hash_add_words(uint32_t, const uint32_t *, size_t);
     static inline uint32_t hash_add_words64(uint32_t, const uint64_t *, size_t);
    -- 
    2.10.2
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=I31eLoUgkJs498Dx_N-zRLMemNQMUQon8J-2Cr8Wehk&s=A8aQngnjfcomJtsIQAQAEJTWG5Tja7XLlQ6G-iFNZEQ&e=
Darrell Ball June 13, 2017, 4:28 p.m. UTC | #2
correction, the hash tests do pass in instrinsic mode

Acked-by: Darrell Ball <dlu998@gmail.com>




On 6/13/17, 9:17 AM, "Darrell Ball" <dball@vmware.com> wrote:

    I have been looking to fixing this when I saw the e-mail from Antonio
    Using intrinsic mode is failing the “hash functions” test (#44),
    which I suppose is better than never having being able to build.
    
     
    
    
    
    On 6/13/17, 8:31 AM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:
    
        Normally, hash_finish() is declared as:
        static inline uint32_t hash_finish(uint32_t hash, uint32_t final)
        
        When __SSE4_2__ && __x86_64__, it is declared as:
        static inline uint32_t hash_finish(uint64_t hash, uint64_t final)
        
        A recent commit added an unneeded prototype in the first form, which caused
        an error due to the redeclaration of a different type when the second form
        was actually used.  This removes the prototype, fixing the problem.
        
        It may not be a great idea to have two different forms for this function,
        but it's long standing and so I don't want to change it immediately without
        proper consideration.
        
        Reported-by: "Fischetti, Antonio" <antonio.fischetti@intel.com>
        Fixes: 67702b79d845 ("hash: New helper functions for adding words in a buffer to a hash.")
        Signed-off-by: Ben Pfaff <blp@ovn.org>

        ---
         lib/hash.h | 1 -
         1 file changed, 1 deletion(-)
        
        diff --git a/lib/hash.h b/lib/hash.h
        index 7dffeaa9cacc..a642a1e97954 100644
        --- a/lib/hash.h
        +++ b/lib/hash.h
        @@ -92,7 +92,6 @@ static inline uint32_t mhash_finish(uint32_t hash)
         
         static inline uint32_t hash_add(uint32_t hash, uint32_t data);
         static inline uint32_t hash_add64(uint32_t hash, uint64_t data);
        -static inline uint32_t hash_finish(uint32_t hash, uint32_t final);
         
         static inline uint32_t hash_add_words(uint32_t, const uint32_t *, size_t);
         static inline uint32_t hash_add_words64(uint32_t, const uint64_t *, size_t);
        -- 
        2.10.2
        
        _______________________________________________
        dev mailing list
        dev@openvswitch.org
        https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=I31eLoUgkJs498Dx_N-zRLMemNQMUQon8J-2Cr8Wehk&s=A8aQngnjfcomJtsIQAQAEJTWG5Tja7XLlQ6G-iFNZEQ&e=
Ben Pfaff June 13, 2017, 4:44 p.m. UTC | #3
Thanks, I applied this to master.

On Tue, Jun 13, 2017 at 04:28:19PM +0000, Darrell Ball wrote:
> correction, the hash tests do pass in instrinsic mode
> 
> Acked-by: Darrell Ball <dlu998@gmail.com>
> 
> 
> 
> On 6/13/17, 9:17 AM, "Darrell Ball" <dball@vmware.com> wrote:
> 
>     I have been looking to fixing this when I saw the e-mail from Antonio
>     Using intrinsic mode is failing the “hash functions” test (#44),
>     which I suppose is better than never having being able to build.
>     
>      
>     
>     
>     
>     On 6/13/17, 8:31 AM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:
>     
>         Normally, hash_finish() is declared as:
>         static inline uint32_t hash_finish(uint32_t hash, uint32_t final)
>         
>         When __SSE4_2__ && __x86_64__, it is declared as:
>         static inline uint32_t hash_finish(uint64_t hash, uint64_t final)
>         
>         A recent commit added an unneeded prototype in the first form, which caused
>         an error due to the redeclaration of a different type when the second form
>         was actually used.  This removes the prototype, fixing the problem.
>         
>         It may not be a great idea to have two different forms for this function,
>         but it's long standing and so I don't want to change it immediately without
>         proper consideration.
>         
>         Reported-by: "Fischetti, Antonio" <antonio.fischetti@intel.com>
>         Fixes: 67702b79d845 ("hash: New helper functions for adding words in a buffer to a hash.")
>         Signed-off-by: Ben Pfaff <blp@ovn.org>
>         ---
>          lib/hash.h | 1 -
>          1 file changed, 1 deletion(-)
>         
>         diff --git a/lib/hash.h b/lib/hash.h
>         index 7dffeaa9cacc..a642a1e97954 100644
>         --- a/lib/hash.h
>         +++ b/lib/hash.h
>         @@ -92,7 +92,6 @@ static inline uint32_t mhash_finish(uint32_t hash)
>          
>          static inline uint32_t hash_add(uint32_t hash, uint32_t data);
>          static inline uint32_t hash_add64(uint32_t hash, uint64_t data);
>         -static inline uint32_t hash_finish(uint32_t hash, uint32_t final);
>          
>          static inline uint32_t hash_add_words(uint32_t, const uint32_t *, size_t);
>          static inline uint32_t hash_add_words64(uint32_t, const uint64_t *, size_t);
>         -- 
>         2.10.2
>         
>         _______________________________________________
>         dev mailing list
>         dev@openvswitch.org
>         https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=I31eLoUgkJs498Dx_N-zRLMemNQMUQon8J-2Cr8Wehk&s=A8aQngnjfcomJtsIQAQAEJTWG5Tja7XLlQ6G-iFNZEQ&e= 
>         
>     
>     
>     
>     
>     
>     
>     
>     
>
diff mbox

Patch

diff --git a/lib/hash.h b/lib/hash.h
index 7dffeaa9cacc..a642a1e97954 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -92,7 +92,6 @@  static inline uint32_t mhash_finish(uint32_t hash)
 
 static inline uint32_t hash_add(uint32_t hash, uint32_t data);
 static inline uint32_t hash_add64(uint32_t hash, uint64_t data);
-static inline uint32_t hash_finish(uint32_t hash, uint32_t final);
 
 static inline uint32_t hash_add_words(uint32_t, const uint32_t *, size_t);
 static inline uint32_t hash_add_words64(uint32_t, const uint64_t *, size_t);