Skip to content

Commit 6371be7

Browse files
damien-lemoalmartinkpetersen
authored andcommitted
scsi: Change SCSI device boolean fields to single bit flags
Commit 3cc2ffe ("scsi: sd: Differentiate system and runtime start/stop management") changed the single bit manage_start_stop flag into 2 boolean fields of the SCSI device structure. Commit 24eca2d ("scsi: sd: Introduce manage_shutdown device flag") introduced the manage_shutdown boolean field for the same structure. Together, these 2 commits increase the size of struct scsi_device by 8 bytes by using booleans instead of defining the manage_xxx fields as single bit flags, similarly to other flags of this structure. Avoid this unnecessary structure size increase and be consistent with the definition of other flags by reverting the definitions of the manage_xxx fields as single bit flags. Fixes: 3cc2ffe ("scsi: sd: Differentiate system and runtime start/stop management") Fixes: 24eca2d ("scsi: sd: Introduce manage_shutdown device flag") Cc: <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Niklas Cassel <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 93e6c0e commit 6371be7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/ata/libata-scsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,8 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
10561056
* and resume and shutdown only. For system level suspend/resume,
10571057
* devices power state is handled directly by libata EH.
10581058
*/
1059-
sdev->manage_runtime_start_stop = true;
1060-
sdev->manage_shutdown = true;
1059+
sdev->manage_runtime_start_stop = 1;
1060+
sdev->manage_shutdown = 1;
10611061
}
10621062

10631063
/*

drivers/firewire/sbp2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,9 +1519,9 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
15191519
sdev->use_10_for_rw = 1;
15201520

15211521
if (sbp2_param_exclusive_login) {
1522-
sdev->manage_system_start_stop = true;
1523-
sdev->manage_runtime_start_stop = true;
1524-
sdev->manage_shutdown = true;
1522+
sdev->manage_system_start_stop = 1;
1523+
sdev->manage_runtime_start_stop = 1;
1524+
sdev->manage_shutdown = 1;
15251525
}
15261526

15271527
if (sdev->type == TYPE_ROM)

include/scsi/scsi_device.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@ struct scsi_device {
167167
* power state for system suspend/resume (suspend to RAM and
168168
* hibernation) operations.
169169
*/
170-
bool manage_system_start_stop;
170+
unsigned manage_system_start_stop:1;
171171

172172
/*
173173
* If true, let the high-level device driver (sd) manage the device
174174
* power state for runtime device suspand and resume operations.
175175
*/
176-
bool manage_runtime_start_stop;
176+
unsigned manage_runtime_start_stop:1;
177177

178178
/*
179179
* If true, let the high-level device driver (sd) manage the device
180180
* power state for system shutdown (power off) operations.
181181
*/
182-
bool manage_shutdown;
182+
unsigned manage_shutdown:1;
183183

184184
unsigned removable:1;
185185
unsigned changed:1; /* Data invalid due to media change */

0 commit comments

Comments
 (0)