diff mbox series

fc: fix fpin_els build breakage

Message ID 20200213224042.26986-1-jsmart2021@gmail.com (mailing list archive)
State Accepted
Headers show
Series fc: fix fpin_els build breakage | expand

Commit Message

James Smart Feb. 13, 2020, 10:40 p.m. UTC
Kbuild reported the following error:

All error/warnings (new ones prefixed by >>):

   In file included from <command-line>:32:0:
   ./usr/include/scsi/fc/fc_els.h: In function 'fc_tlv_next_desc':
>> ./usr/include/scsi/fc/fc_els.h:274:4: error: implicit declaration of
    function 'be32_to_cpu'; did you mean '__be32_to_cpu'?
    [-Werror=implicit-function-declaration]
      (be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
       ^
>> ./usr/include/scsi/fc/fc_els.h:286:17: note: in expansion of macro
    'FC_TLV_DESC_SZ_FROM_LENGTH'
     return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

Fix by converting fc_tlv_next_desc to use __be32_to_cpu().

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 include/uapi/scsi/fc/fc_els.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hannes Reinecke Feb. 14, 2020, 7:33 a.m. UTC | #1
On 2/13/20 11:40 PM, James Smart wrote:
> Kbuild reported the following error:
> 
> All error/warnings (new ones prefixed by >>):
> 
>    In file included from <command-line>:32:0:
>    ./usr/include/scsi/fc/fc_els.h: In function 'fc_tlv_next_desc':
>>> ./usr/include/scsi/fc/fc_els.h:274:4: error: implicit declaration of
>     function 'be32_to_cpu'; did you mean '__be32_to_cpu'?
>     [-Werror=implicit-function-declaration]
>       (be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
>        ^
>>> ./usr/include/scsi/fc/fc_els.h:286:17: note: in expansion of macro
>     'FC_TLV_DESC_SZ_FROM_LENGTH'
>      return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    cc1: some warnings being treated as errors
> 
> Fix by converting fc_tlv_next_desc to use __be32_to_cpu().
> 
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---
>  include/uapi/scsi/fc/fc_els.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h
> index 10b609a2f863..66318c44acd7 100644
> --- a/include/uapi/scsi/fc/fc_els.h
> +++ b/include/uapi/scsi/fc/fc_els.h
> @@ -271,7 +271,7 @@ struct fc_tlv_desc {
>  
>  /* Macro, used on received payloads, to return the descriptor length */
>  #define FC_TLV_DESC_SZ_FROM_LENGTH(tlv)		\
> -		(be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
> +		(__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
>  
>  /*
>   * This helper is used to walk descriptors in a descriptor list.
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/include/uapi/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h
index 10b609a2f863..66318c44acd7 100644
--- a/include/uapi/scsi/fc/fc_els.h
+++ b/include/uapi/scsi/fc/fc_els.h
@@ -271,7 +271,7 @@  struct fc_tlv_desc {
 
 /* Macro, used on received payloads, to return the descriptor length */
 #define FC_TLV_DESC_SZ_FROM_LENGTH(tlv)		\
-		(be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
+		(__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
 
 /*
  * This helper is used to walk descriptors in a descriptor list.