Thread (3 messages) flat view 3 messages, 2 authors, 2015-03-12

Re: [PATCH v6 1/3] scsi: ufs: add ioctl interface for query request

From: Gilad Broner <hidden>
Date: 2015-03-12 15:27:54
Also in: linux-arm-msm, linux-scsi, lkml

quoted
+       if (!buffer) {
+               dev_err(hba->dev, "%s: User buffer is NULL!\n",
__func__);
+               return -EINVAL;
+       }
+
Should we remove this check or move it into ufshcd_query_ioctl()?
For example, BLKFLS ioctl without argument is correct usage, but
it always triggers this message. (blkdev_ioctl -> __blkdev_driver_ioctl
-> sd_ioctl -> scsi_ioctl -> ufshcd_ioctl)
You're right, I'll move the check to ufshcd_query_ioctl().
 +++ b/include/uapi/scsi/ufs/ioctl.h
quoted
@@ -0,0 +1,57 @@
+#ifndef UAPI_UFS_IOCTL_H_
+#define UAPI_UFS_IOCTL_H_
+
+#include <linux/types.h>
+
+/*
+ *  IOCTL opcode for ufs queries has the following opcode after
+ *  SCSI_IOCTL_GET_PCI
+ */
+#define UFS_IOCTL_QUERY                        0x5388
Should we also need some comments near SCSI_IOCTL_GET_PCI in
include/scsi/scsi.h in order to avoid someone trying to define
the same ioctl code in the future?
Indeed - I will add a comment.

Gilad.

-- 
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help