Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: core: Clean up SG_NONE

Remove SG_NONE and a related misleading comment. Update documentation.

This patch does not affect behaviour as zero initialization is redundant.

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Viresh Kumar <vireshk@kernel.org>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: usb-storage@lists.one-eyed-alien.net
Link: https://lore.kernel.org/r/b4779b7a6563f6bd8d259ee457871c1c463c420e.1572656814.git.fthain@telegraphics.com.au
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Finn Thain and committed by
Martin K. Petersen
35c33633 79172ab2

+3 -17
+2 -1
Documentation/scsi/scsi_mid_low_api.txt
··· 1084 1084 commands to the adapter. 1085 1085 this_id - scsi id of host (scsi initiator) or -1 if not known 1086 1086 sg_tablesize - maximum scatter gather elements allowed by host. 1087 - 0 implies scatter gather not supported by host 1087 + Set this to SG_ALL or less to avoid chained SG lists. 1088 + Must be at least 1. 1088 1089 max_sectors - maximum number of sectors (usually 512 bytes) allowed 1089 1090 in a single SCSI command. The default value of 0 leads 1090 1091 to a setting of SCSI_DEFAULT_MAX_SECTORS (defined in
-1
drivers/ata/pata_arasan_cf.c
··· 219 219 220 220 static struct scsi_host_template arasan_cf_sht = { 221 221 ATA_BASE_SHT(DRIVER_NAME), 222 - .sg_tablesize = SG_NONE, 223 222 .dma_boundary = 0xFFFFFFFFUL, 224 223 }; 225 224
+1 -1
drivers/scsi/atp870u.c
··· 1680 1680 .bios_param = atp870u_biosparam /* biosparm */, 1681 1681 .can_queue = qcnt /* can_queue */, 1682 1682 .this_id = 7 /* SCSI ID */, 1683 - .sg_tablesize = ATP870U_SCATTER /*SG_ALL*/ /*SG_NONE*/, 1683 + .sg_tablesize = ATP870U_SCATTER /*SG_ALL*/, 1684 1684 .max_sectors = ATP870U_MAX_SECTORS, 1685 1685 }; 1686 1686
-1
drivers/usb/storage/uas.c
··· 879 879 .eh_abort_handler = uas_eh_abort_handler, 880 880 .eh_device_reset_handler = uas_eh_device_reset_handler, 881 881 .this_id = -1, 882 - .sg_tablesize = SG_NONE, 883 882 .skip_settle_delay = 1, 884 883 .dma_boundary = PAGE_SIZE - 1, 885 884 };
-13
include/scsi/scsi_host.h
··· 23 23 struct scsi_transport_template; 24 24 25 25 26 - /* 27 - * The various choices mean: 28 - * NONE: Self evident. Host adapter is not capable of scatter-gather. 29 - * ALL: Means that the host adapter module can do scatter-gather, 30 - * and that there is no limit to the size of the table to which 31 - * we scatter/gather data. The value we set here is the maximum 32 - * single element sglist. To use chained sglists, the adapter 33 - * has to set a value beyond ALL (and correctly use the chain 34 - * handling API. 35 - * Anything else: Indicates the maximum number of chains that can be 36 - * used in one scatter-gather request. 37 - */ 38 - #define SG_NONE 0 39 26 #define SG_ALL SG_CHUNK_SIZE 40 27 41 28 #define MODE_UNKNOWN 0x00