mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
pktcdvd: Remove CONFIG_CDROM_PKTCDVD_WCACHE from uapi header
CONFIG_* switches should not be exposed in uapi headers, thus let's get rid of the USE_WCACHING macro here (which was also named way to generic) and integrate the logic directly in the only function that needs it. Suggested-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
committed by
Arnd Bergmann
parent
d3c7ec7588
commit
f5bdc61eb6
@@ -1869,12 +1869,12 @@ static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd)
|
|||||||
/*
|
/*
|
||||||
* enable/disable write caching on drive
|
* enable/disable write caching on drive
|
||||||
*/
|
*/
|
||||||
static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd,
|
static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd)
|
||||||
int set)
|
|
||||||
{
|
{
|
||||||
struct packet_command cgc;
|
struct packet_command cgc;
|
||||||
struct scsi_sense_hdr sshdr;
|
struct scsi_sense_hdr sshdr;
|
||||||
unsigned char buf[64];
|
unsigned char buf[64];
|
||||||
|
bool set = IS_ENABLED(CONFIG_CDROM_PKTCDVD_WCACHE);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
|
init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
|
||||||
@@ -1890,7 +1890,12 @@ static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
buf[pd->mode_offset + 10] |= (!!set << 2);
|
/*
|
||||||
|
* use drive write caching -- we need deferred error handling to be
|
||||||
|
* able to successfully recover with this option (drive will return good
|
||||||
|
* status as soon as the cdb is validated).
|
||||||
|
*/
|
||||||
|
buf[pd->mode_offset + 10] |= (set << 2);
|
||||||
|
|
||||||
cgc.buflen = cgc.cmd[8] = 2 + ((buf[0] << 8) | (buf[1] & 0xff));
|
cgc.buflen = cgc.cmd[8] = 2 + ((buf[0] << 8) | (buf[1] & 0xff));
|
||||||
ret = pkt_mode_select(pd, &cgc);
|
ret = pkt_mode_select(pd, &cgc);
|
||||||
@@ -2085,7 +2090,7 @@ static int pkt_open_write(struct pktcdvd_device *pd)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
pkt_write_caching(pd, USE_WCACHING);
|
pkt_write_caching(pd);
|
||||||
|
|
||||||
ret = pkt_get_max_speed(pd, &write_speed);
|
ret = pkt_get_max_speed(pd, &write_speed);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@@ -29,17 +29,6 @@
|
|||||||
*/
|
*/
|
||||||
#define PACKET_WAIT_TIME (HZ * 5 / 1000)
|
#define PACKET_WAIT_TIME (HZ * 5 / 1000)
|
||||||
|
|
||||||
/*
|
|
||||||
* use drive write caching -- we need deferred error handling to be
|
|
||||||
* able to successfully recover with this option (drive will return good
|
|
||||||
* status as soon as the cdb is validated).
|
|
||||||
*/
|
|
||||||
#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
|
|
||||||
#define USE_WCACHING 1
|
|
||||||
#else
|
|
||||||
#define USE_WCACHING 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No user-servicable parts beyond this point ->
|
* No user-servicable parts beyond this point ->
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user