Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH 1/1] Drivers: hv: vmbus: Remove unused code to check for subchannels
@ 2021-10-25 19:54 Michael Kelley
  2021-10-25 20:58 ` Wei Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kelley @ 2021-10-25 19:54 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, linux-kernel, linux-hyperv; +Cc: mikelley

The last caller of vmbus_are_subchannels_present() was removed in commit
c967590457ca ("scsi: storvsc: Fix a race in sub-channel creation that can cause panic").

Remove this dead code, and the utility function invoke_sc_cb() that it is
the only caller of.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
 drivers/hv/channel_mgmt.c | 34 ----------------------------------
 include/linux/hyperv.h    | 13 -------------
 2 files changed, 47 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 1423085..2829575 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -1581,21 +1581,6 @@ int vmbus_request_offers(void)
 	return ret;
 }
 
-static void invoke_sc_cb(struct vmbus_channel *primary_channel)
-{
-	struct list_head *cur, *tmp;
-	struct vmbus_channel *cur_channel;
-
-	if (primary_channel->sc_creation_callback == NULL)
-		return;
-
-	list_for_each_safe(cur, tmp, &primary_channel->sc_list) {
-		cur_channel = list_entry(cur, struct vmbus_channel, sc_list);
-
-		primary_channel->sc_creation_callback(cur_channel);
-	}
-}
-
 void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
 				void (*sc_cr_cb)(struct vmbus_channel *new_sc))
 {
@@ -1603,25 +1588,6 @@ void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
 }
 EXPORT_SYMBOL_GPL(vmbus_set_sc_create_callback);
 
-bool vmbus_are_subchannels_present(struct vmbus_channel *primary)
-{
-	bool ret;
-
-	ret = !list_empty(&primary->sc_list);
-
-	if (ret) {
-		/*
-		 * Invoke the callback on sub-channel creation.
-		 * This will present a uniform interface to the
-		 * clients.
-		 */
-		invoke_sc_cb(primary);
-	}
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present);
-
 void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel,
 		void (*chn_rescind_cb)(struct vmbus_channel *))
 {
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index ddc8713..836fae2 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1100,19 +1100,6 @@ void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
 void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel,
 		void (*chn_rescind_cb)(struct vmbus_channel *));
 
-/*
- * Check if sub-channels have already been offerred. This API will be useful
- * when the driver is unloaded after establishing sub-channels. In this case,
- * when the driver is re-loaded, the driver would have to check if the
- * subchannels have already been established before attempting to request
- * the creation of sub-channels.
- * This function returns TRUE to indicate that subchannels have already been
- * created.
- * This function should be invoked after setting the callback function for
- * sub-channel creation.
- */
-bool vmbus_are_subchannels_present(struct vmbus_channel *primary);
-
 /* The format must be the same as struct vmdata_gpa_direct */
 struct vmbus_channel_packet_page_buffer {
 	u16 type;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] Drivers: hv: vmbus: Remove unused code to check for subchannels
  2021-10-25 19:54 [PATCH 1/1] Drivers: hv: vmbus: Remove unused code to check for subchannels Michael Kelley
@ 2021-10-25 20:58 ` Wei Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2021-10-25 20:58 UTC (permalink / raw)
  To: Michael Kelley
  Cc: kys, haiyangz, sthemmin, wei.liu, linux-kernel, linux-hyperv

On Mon, Oct 25, 2021 at 12:54:34PM -0700, Michael Kelley wrote:
> The last caller of vmbus_are_subchannels_present() was removed in commit
> c967590457ca ("scsi: storvsc: Fix a race in sub-channel creation that can cause panic").
> 
> Remove this dead code, and the utility function invoke_sc_cb() that it is
> the only caller of.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

Applied to hyperv-next. Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-25 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-25 19:54 [PATCH 1/1] Drivers: hv: vmbus: Remove unused code to check for subchannels Michael Kelley
2021-10-25 20:58 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox