From: Thomas Huth <thuth@redhat.com>
To: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>
Subject: [PATCH v2 4/5] pktcdvd: Remove CONFIG_CDROM_PKTCDVD_WCACHE from uapi header
Date: Fri, 10 Mar 2023 17:07:56 +0100 [thread overview]
Message-ID: <20230310160757.199253-5-thuth@redhat.com> (raw)
In-Reply-To: <20230310160757.199253-1-thuth@redhat.com>
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>
---
drivers/block/pktcdvd.c | 13 +++++++++----
include/uapi/linux/pktcdvd.h | 11 -----------
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 2f1a92509271..5ae2a80db2c3 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1869,12 +1869,12 @@ static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd)
/*
* enable/disable write caching on drive
*/
-static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd,
- int set)
+static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd)
{
struct packet_command cgc;
struct scsi_sense_hdr sshdr;
unsigned char buf[64];
+ bool set = IS_ENABLED(CONFIG_CDROM_PKTCDVD_WCACHE);
int ret;
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)
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));
ret = pkt_mode_select(pd, &cgc);
@@ -2085,7 +2090,7 @@ static int pkt_open_write(struct pktcdvd_device *pd)
return -EIO;
}
- pkt_write_caching(pd, USE_WCACHING);
+ pkt_write_caching(pd);
ret = pkt_get_max_speed(pd, &write_speed);
if (ret)
diff --git a/include/uapi/linux/pktcdvd.h b/include/uapi/linux/pktcdvd.h
index 9cbb55d21c94..6a5552dfd6af 100644
--- a/include/uapi/linux/pktcdvd.h
+++ b/include/uapi/linux/pktcdvd.h
@@ -29,17 +29,6 @@
*/
#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 ->
*/
--
2.31.1
next prev parent reply other threads:[~2023-03-10 16:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 16:07 [PATCH v2 0/5] Remove #ifdef CONFIG_* from uapi headers (2023 edition) Thomas Huth
2023-03-10 16:07 ` [PATCH v2 1/5] Move COMPAT_ATM_ADDPARTY to net/atm/svc.c Thomas Huth
2023-03-10 16:07 ` [PATCH v2 2/5] Move ep_take_care_of_epollwakeup() to fs/eventpoll.c Thomas Huth
2023-03-10 16:07 ` [PATCH v2 3/5] Move bp_type_idx to include/linux/hw_breakpoint.h Thomas Huth
2023-03-10 16:07 ` Thomas Huth [this message]
2023-03-13 15:16 ` [PATCH v2 4/5] pktcdvd: Remove CONFIG_CDROM_PKTCDVD_WCACHE from uapi header Christoph Hellwig
2023-03-10 16:07 ` [PATCH v2 5/5] scripts: Update the CONFIG_* ignore list in headers_install.sh Thomas Huth
2023-03-10 20:06 ` [PATCH v2 0/5] Remove #ifdef CONFIG_* from uapi headers (2023 edition) Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230310160757.199253-5-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=3chas3@gmail.com \
--cc=arnd@arndb.de \
--cc=hch@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=palmer@dabbelt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.