From patchwork Fri Oct 12 10:41:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 148746 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp570307lji; Fri, 12 Oct 2018 03:41:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62JUt/QqWwXBUJNX4ryiM6F99aAQcxWiKqY2SCYFAdXfuJ9mdJ36y98ZCTMBwsK6p4p3T1H X-Received: by 2002:a62:9e52:: with SMTP id s79-v6mr5663320pfd.110.1539340916155; Fri, 12 Oct 2018 03:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539340916; cv=none; d=google.com; s=arc-20160816; b=NqSGHErZUG572SxciYCM7b/UmIQCoEIqXZwtlc0ih/YkXXR3EwJy1CsS7dyRb1TNXu HT6IZZAUdNF9mAEc44X9JAq+TcM32GtiNE5Sq4enfFT3vDm4SpW/OOIOdZfdsVMukq6k i46Bi1s2MzKUmhNQliX7l7W1CW+G46m9c6lGQ/XC7BB8Zc00hro4zEqmF+Rg3zefZ7KJ 5v9GUHpn37h8cUp1oNxW7Cl1XWGpcSL+CKPc0ul3lyr/glDGo8C8XRC/eDNnxdBfGUtr y6oEWMbvw74RM5nzdw1yLy1w8Ad/orvRC0+LsEJdc4b86xO7nUzgYGI/mKejnLR9COCg MxIQ== 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=MxtJQJFtJZextwT/nLyZ+qTgV/fs3KY9mobI40ToDMRA3rsodt0BdH4cFl6SANxLLk zGNYs0yuSzb58ZJOO+jcIY/q2r9PC6mSdoOCQjpTHXgaUExWF60rKHXuwe2l0Nu0GM5e MTeLWPcpo2OSvU5IIiLjjhfW/1C7ILoSwU/3nbPRj1iuvaA/XymgZqZu/EXFj+Eoeyfl uUAtyekokMkvgf28qGT19p5deCtnvmIXYAyDJ/po2nlezu0FW3JIUhwecfvPUVKqZjOP PoSVEY2YCy0PvqC4HvmzSNxQYqNN1HZO8olbqIp9WEMhXk1s8GKCxClbgE+VXmdEYOdI LDGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 q12-v6si875400pgl.531.2018.10.12.03.41.55; Fri, 12 Oct 2018 03:41:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbeJLSNm (ORCPT + 1 other); 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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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(-) -- 2.18.0 Reviewed-by: Avri Altman 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; };