public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Potter <phil@philpotter.co.uk>
To: Enze Li <lienze@kylinos.cn>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org
Subject: Re: [PATCH] cdrom: make EXPORT_SYMBOL follow exported function
Date: Sat, 9 Apr 2022 10:10:21 +0100	[thread overview]
Message-ID: <YlFNfb3IB0KLdnf6@equinox> (raw)
In-Reply-To: <20220406090337.1116708-1-lienze@kylinos.cn>

On Wed, Apr 06, 2022 at 05:03:37PM +0800, Enze Li wrote:
> Currently, some EXPORT_SYMBOL declarations do not follow the exported
> function, which affects the readability of the code.  To maintain
> consistency, move these EXPORT_SYMBOL declarations to the correct
> position to improve the readability of the code.
> 
> Signed-off-by: Enze Li <lienze@kylinos.cn>
> ---
>  drivers/cdrom/cdrom.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> index 7bd10d63ddbe..2d9dce967c90 100644
> --- a/drivers/cdrom/cdrom.c
> +++ b/drivers/cdrom/cdrom.c
> @@ -648,6 +648,7 @@ int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi)
>  	mutex_unlock(&cdrom_mutex);
>  	return 0;
>  }
> +EXPORT_SYMBOL(register_cdrom);
>  #undef ENSURE
>  
>  void unregister_cdrom(struct cdrom_device_info *cdi)
> @@ -663,6 +664,7 @@ void unregister_cdrom(struct cdrom_device_info *cdi)
>  
>  	cd_dbg(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
>  }
> +EXPORT_SYMBOL(unregister_cdrom);
>  
>  int cdrom_get_media_event(struct cdrom_device_info *cdi,
>  			  struct media_event_desc *med)
> @@ -690,6 +692,7 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi,
>  	memcpy(med, &buffer[sizeof(*eh)], sizeof(*med));
>  	return 0;
>  }
> +EXPORT_SYMBOL(cdrom_get_media_event);
>  
>  static int cdrom_get_random_writable(struct cdrom_device_info *cdi,
>  			      struct rwrt_feature_desc *rfd)
> @@ -1206,6 +1209,7 @@ int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev,
>  	cdi->use_count--;
>  	return ret;
>  }
> +EXPORT_SYMBOL(cdrom_open);
>  
>  /* This code is similar to that in open_for_data. The routine is called
>     whenever an audio play operation is requested.
> @@ -1301,6 +1305,7 @@ void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode)
>  			cdo->tray_move(cdi, 1);
>  	}
>  }
> +EXPORT_SYMBOL(cdrom_release);
>  
>  static int cdrom_read_mech_status(struct cdrom_device_info *cdi, 
>  				  struct cdrom_changer_info *buf)
> @@ -1383,6 +1388,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
>  	kfree(info);
>  	return nslots;
>  }
> +EXPORT_SYMBOL(cdrom_number_of_slots);
>  
>  
>  /* If SLOT < 0, unload the current slot.  Otherwise, try to load SLOT. */
> @@ -1582,6 +1588,7 @@ void init_cdrom_command(struct packet_command *cgc, void *buf, int len,
>  	cgc->data_direction = type;
>  	cgc->timeout = CDROM_DEF_TIMEOUT;
>  }
> +EXPORT_SYMBOL(init_cdrom_command);
>  
>  /* DVD handling */
>  
> @@ -2000,6 +2007,7 @@ int cdrom_mode_sense(struct cdrom_device_info *cdi,
>  	cgc->data_direction = CGC_DATA_READ;
>  	return cdo->generic_packet(cdi, cgc);
>  }
> +EXPORT_SYMBOL(cdrom_mode_sense);
>  
>  int cdrom_mode_select(struct cdrom_device_info *cdi,
>  		      struct packet_command *cgc)
> @@ -2015,6 +2023,7 @@ int cdrom_mode_select(struct cdrom_device_info *cdi,
>  	cgc->data_direction = CGC_DATA_WRITE;
>  	return cdo->generic_packet(cdi, cgc);
>  }
> +EXPORT_SYMBOL(cdrom_mode_select);
>  
>  static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
>  				 struct cdrom_subchnl *subchnl, int mcn)
> @@ -2893,6 +2902,7 @@ int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written)
>  	*last_written = toc.cdte_addr.lba;
>  	return 0;
>  }
> +EXPORT_SYMBOL(cdrom_get_last_written);
>  
>  /* return the next writable block. also for udf file system. */
>  static int cdrom_get_next_writable(struct cdrom_device_info *cdi,
> @@ -3430,18 +3440,7 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev,
>  
>  	return -ENOSYS;
>  }
> -
> -EXPORT_SYMBOL(cdrom_get_last_written);
> -EXPORT_SYMBOL(register_cdrom);
> -EXPORT_SYMBOL(unregister_cdrom);
> -EXPORT_SYMBOL(cdrom_open);
> -EXPORT_SYMBOL(cdrom_release);
>  EXPORT_SYMBOL(cdrom_ioctl);
> -EXPORT_SYMBOL(cdrom_number_of_slots);
> -EXPORT_SYMBOL(cdrom_mode_select);
> -EXPORT_SYMBOL(cdrom_mode_sense);
> -EXPORT_SYMBOL(init_cdrom_command);
> -EXPORT_SYMBOL(cdrom_get_media_event);
>  
>  #ifdef CONFIG_SYSCTL
>  
> -- 
> 2.25.1
> 

Seems like a sensible change to me, and builds OK. Many thanks for the
patch. As we're now outside the merge window, I will send onto Jens at
the appropriate time.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

      reply	other threads:[~2022-04-09  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  9:03 [PATCH] cdrom: make EXPORT_SYMBOL follow exported function Enze Li
2022-04-09  9:10 ` Phillip Potter [this message]

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=YlFNfb3IB0KLdnf6@equinox \
    --to=phil@philpotter.co.uk \
    --cc=axboe@kernel.dk \
    --cc=lienze@kylinos.cn \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox