Re: [PATCH v5 13/23] sg: ioctl handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-10-18 6:12 a.m., Hannes Reinecke wrote:
On 10/8/19 9:50 AM, Douglas Gilbert wrote:
Shorten sg_ioctl() by adding some helper functions. sg_ioctl()
is the main entry point for ioctls used on this driver's
devices.

Signed-off-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>
---
  drivers/scsi/sg.c | 325 ++++++++++++++++++++++++++++------------------
  1 file changed, 200 insertions(+), 125 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 2796fef42837..90753f7759c7 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -72,6 +72,9 @@ static char *sg_version_date = "20190606";
   */
  #define SG_MAX_CDB_SIZE 252
+#define uptr64(val) ((void __user *)(uintptr_t)(val))
+#define cuptr64(val) ((const void __user *)(uintptr_t)(val))
+
  #define SG_DEFAULT_TIMEOUT mult_frac(SG_DEFAULT_TIMEOUT_USER, HZ, USER_HZ)
/* Bit positions (flags) for sg_device::fdev_bm bitmask follow */

These defines are used only once; I'd rather drop them and do the
conversion in-place.

Okay, I'll take them out. And they will go back in in patch 28
as their main use is to handle the way the sg v4 interface
send pointers through 64 bit integers. The first one should be
familiar to anyone who has worked on block/bsg.h .

Doug Gilbert



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux