Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp600465imm; Fri, 12 Oct 2018 03:44:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV61fnJz1GB6YzoOb0I3b26VtAg5GSf7HsX9qQFVloL8+Ems+sqiTgRzc2jyUdh/IAMS4VrdI X-Received: by 2002:a62:401:: with SMTP id 1-v6mr5511240pfe.236.1539341041204; Fri, 12 Oct 2018 03:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539341041; cv=none; d=google.com; s=arc-20160816; b=eD0yhZOFG4mTD+7LYI3pXD61S7/SBbzSB/J+Q5beVD9dcwL/P9uBO1QdiOEEgbHhxQ QPwISDbHuAouX3RjuRsKPyn2efijjfvugKpMy3ZPuMdjWnwYx9K0L+OvoP3bo8qmCl4Q J35IhSb1MGqjSdYgXsFrl+k0Il8qDQ0Q5CvFcdwpJkuIToTHgv492D6XhVQmRI8Ixyx2 WrbGgBlWNFo23rVmg1C0PxrDHahlbwUbkwF89QSlrWwwdN34QQcG2cDZpxgTFzuKHnLL M6z+uvLtaWFsR2jsicfkvaDVfiS9vDtg0JydJlh6xfuBuhpArlySJwoMgFndtVvxxvYB XNwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=9aHyxyq4ofSSQwru6nrLjmeVwGY0TO/2+Z57lLiR5ug=; b=B1V3o9LQGOJEpnbvdVm5LE6qGDC1Ys5/6MJ+Miv6Gg/hymQ4KCkr/9NrovNH36KYmu BtY+oFW7XYA4joKaTw+4SdDtzeIdCfAvAfWW9alsNvzORceZMQkv5Lx3aJdT5ZAzwLfE fgFLcNhQJRWAfB7b50ryz8V+zteJOFOe5+rFiBnw6NIJnZXvmgAt/x8TwrpcZLfvWJ8P 8qWmF4tv9T2Iy8raBRiS70ZGFGcWvIVcZEXfB4F/x2MLyDICWETU76bcLqUSbRsLQMf6 UKPBftrjyOfbZEcwX77kE78NiNfJNVktldvd+ghpFi5od0eU/+iNl0Kj2q65C5CVeCtX KtrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si1024657pli.202.2018.10.12.03.43.46; Fri, 12 Oct 2018 03:44:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728037AbeJLSNm (ORCPT + 99 others); Fri, 12 Oct 2018 14:13:42 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:35955 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726665AbeJLSNm (ORCPT ); Fri, 12 Oct 2018 14:13:42 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MauJJ-1fes7e041z-00cTLa; Fri, 12 Oct 2018 12:41:45 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MauJJ-1fes7e041z-00cTLa; Fri, 12 Oct 2018 12:41:45 +0200 From: Arnd Bergmann To: Avri Altman , "Martin K. Petersen" , Bart Van Assche Cc: linux-scsi@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] scsi: ufs: fix integer type usage in uapi header Date: Fri, 12 Oct 2018 12:41:28 +0200 Message-Id: <20181012104143.1931393-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:RpmlNXRZ1eGDPsL4xmG9LGqc8hOihdqy0zHaqzxuyfHzp9QObgX YRQvPpajbO8elCmgvDozxmROd40dvo/VeQrpvH7A0ypmoC7roacYn9cSG3fEq1pyOTvDeDn HmKPk5/l0cB4RZYXQY67tAzE5I9aTfZLOfd8sCUuTfMcYaCaI81ITIj2t7Mq1nfI4BCrFvu J+H4g1aqSHx8EVaq7ZB2w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:PRp9f2VvG4A=:E5/yilLsljnCBjIAFqKe1c 8i0EoSfo2UxZ8VB8gkqZRn+H5AAHHqOcoVWwggqg4CNoTx8tJmCmUv5h0TY/nRAKh3Pmhhxmy qv4etUY5EHl73YU3rzum+KukmuteeHLnarDAN/13m5bqaQ7NRJEn4WhS4BmzJumywGyccG2q0 I598KkBHUxOJvBD8JGCOUqFR7kGxG9suvsHNKdVf0oOUCqTPO8YlJANaUvy9yO8nkU3COkWRf nQZS2m4su+TT3TGa/Yn1Q0sPTnEncmKtgx1KS3L99tiEGIu+HU7yAHfJBsiOUbbX88Hm9DzbR wiQLceEbATA5Ehm0tNScTsKqw+1LuRayBTBsQlG9npKogN3XlFeupZbsGVPYUL5tUXV24Bh0f ZXSYK7grJzh+DY4CUA0j8EUy79TDqspsnx95lVV1AJRMDEv1YMpTfGVFhNBrpAmtqjECW48sH KbHFmNNSuWm1o7hvPibsszuJrXU3gHfiJI0GnAqoPsKVGZ5vTxLQ3/7lmPs5VkueERXBygnDh S7J9BBOYHiGFoLOcgTLF/CjmlYGFDj0hsBRYjTTfcBvbiaMwr6Efa4MWuVaadkj49GnRByQw0 hWGcTYtz0eBJBB1vCYxDOxRLjZY4CdOx/V4ojh+cGxClI95tPiBIrLjhpSNA+pGdeC0ECjIyY odY3ynqEDml82c3ERs0Fbpe1aRVPThbbyTbv4Ox/GKZc02Rtwpbqw7FOPErwnXcbhoCs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get a warning from 'make headers_check' about a newly introduced usage of integer types in the scsi/scsi_bsg_ufs.h uapi header: usr/include/scsi/scsi_bsg_ufs.h:18: found __[us]{8,16,32,64} type without #include Aside from the missing linux/types.h inclusion, I also noticed that it uses the wrong types: 'u32' is not available at all in user space, and 'uint32_t' depends on the inclusion of a standard header that we should not include from kernel headers. Change the all to __u32 and similar types here. I also note the usage of '__be32' and '__be16' that seems unfortunate for a user space API. I wonder if it would be better to define the interface in terms of a CPU-endian structure and convert it in kernel space. Fixes: e77044c5a842 ("scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()") Fixes: df032bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs") Signed-off-by: Arnd Bergmann --- include/uapi/scsi/scsi_bsg_ufs.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h index 1b25930688bc..17c7abd0803a 100644 --- a/include/uapi/scsi/scsi_bsg_ufs.h +++ b/include/uapi/scsi/scsi_bsg_ufs.h @@ -8,6 +8,7 @@ #ifndef SCSI_BSG_UFS_H #define SCSI_BSG_UFS_H +#include /* * This file intended to be included by both kernel and user space */ @@ -15,7 +16,7 @@ #define UFS_CDB_SIZE 16 #define UPIU_TRANSACTION_UIC_CMD 0x1F /* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */ -#define UIC_CMD_SIZE (sizeof(u32) * 4) +#define UIC_CMD_SIZE (sizeof(__u32) * 4) /** * struct utp_upiu_header - UPIU header structure @@ -59,7 +60,7 @@ struct utp_upiu_query { */ struct utp_upiu_cmd { __be32 exp_data_transfer_len; - u8 cdb[UFS_CDB_SIZE]; + __u8 cdb[UFS_CDB_SIZE]; }; /** @@ -81,7 +82,7 @@ struct utp_upiu_req { /* request (CDB) structure of the sg_io_v4 */ struct ufs_bsg_request { - uint32_t msgcode; + __u32 msgcode; struct utp_upiu_req upiu_req; }; @@ -95,10 +96,10 @@ struct ufs_bsg_reply { * msg and status fields. The per-msgcode reply structure * will contain valid data. */ - uint32_t result; + __u32 result; /* If there was reply_payload, how much was received? */ - uint32_t reply_payload_rcv_len; + __u32 reply_payload_rcv_len; struct utp_upiu_req upiu_rsp; }; -- 2.18.0