From 7b8719ed1c376db5366e8d82c691d87c84772fa4 Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Tue, 31 Mar 2020 17:23:26 -0700 Subject: [PATCH] ANDROID: GKI: block: resolve ABI diff when CONFIG_BLK_DEV_BSG is unset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If CONFIG_BLK_DEV_BSG is disabled on the vendor side, then struct request_queue will have an ABI diff. Remove the #ifdef in the struct so that vendors can choose whether or not to use the config. 'struct request_queue at blkdev.h:434:1' changed:¬ type size changed from 17600 to 17920 (in bits)¬ 2 data member insertions:¬ 'bsg_job_fn* request_queue::bsg_job_fn', at offset 13952 (in bits) at blkdev.h:650:1¬ 'bsg_class_device request_queue::bsg_dev', at offset 14016 (in bits) at blkdev.h:651:1¬ Signed-off-by: Will McVicker Bug: 152917514 Test: compile, verify ABI diff Change-Id: Iec2e3460b717b667fcc0409cbc4ec985cfe0f69c --- include/linux/blkdev.h | 2 -- include/linux/bsg.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 46e3503d63a6..c43316d3f5be 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -646,10 +646,8 @@ struct request_queue { int bypass_depth; atomic_t mq_freeze_depth; -#if defined(CONFIG_BLK_DEV_BSG) bsg_job_fn *bsg_job_fn; struct bsg_class_device bsg_dev; -#endif #ifdef CONFIG_BLK_DEV_THROTTLING /* Throttle data */ diff --git a/include/linux/bsg.h b/include/linux/bsg.h index dac37b6e00ec..b6c554974aac 100644 --- a/include/linux/bsg.h +++ b/include/linux/bsg.h @@ -6,7 +6,6 @@ struct request; -#ifdef CONFIG_BLK_DEV_BSG struct bsg_ops { int (*check_proto)(struct sg_io_v4 *hdr); int (*fill_hdr)(struct request *rq, struct sg_io_v4 *hdr, @@ -22,6 +21,7 @@ struct bsg_class_device { const struct bsg_ops *ops; }; +#ifdef CONFIG_BLK_DEV_BSG int bsg_register_queue(struct request_queue *q, struct device *parent, const char *name, const struct bsg_ops *ops); int bsg_scsi_register_queue(struct request_queue *q, struct device *parent);