Message ID | 1432043231-31102-3-git-send-email-ygardi@codeaurora.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 2015-05-19 at 16:47 +0300, Yaniv Gardi wrote: > --- a/drivers/scsi/ufs/ufs-qcom.c > +++ b/drivers/scsi/ufs/ufs-qcom.c > @@ -885,7 +885,7 @@ out: > > #define ANDROID_BOOT_DEV_MAX 30 > static char android_boot_dev[ANDROID_BOOT_DEV_MAX]; > -static int get_android_boot_dev(char *str) > +static int __maybe_unused get_android_boot_dev(char *str) > { > strlcpy(android_boot_dev, str, ANDROID_BOOT_DEV_MAX); > return 1; Wouldn't it be clearer to wrap these few lines (until after the __setup() macro) with #ifndef MODULE? And I think get_android_boot_dev() could be marked __init. Because if it's built-in it will never be called after the kernel has finished booting, right? Paul Bolle -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> On Tue, 2015-05-19 at 16:47 +0300, Yaniv Gardi wrote: >> --- a/drivers/scsi/ufs/ufs-qcom.c >> +++ b/drivers/scsi/ufs/ufs-qcom.c >> @@ -885,7 +885,7 @@ out: >> >> #define ANDROID_BOOT_DEV_MAX 30 >> static char android_boot_dev[ANDROID_BOOT_DEV_MAX]; >> -static int get_android_boot_dev(char *str) >> +static int __maybe_unused get_android_boot_dev(char *str) >> { >> strlcpy(android_boot_dev, str, ANDROID_BOOT_DEV_MAX); >> return 1; > > Wouldn't it be clearer to wrap these few lines (until after the > __setup() macro) with #ifndef MODULE? > > And I think get_android_boot_dev() could be marked __init. Because if > it's built-in it will never be called after the kernel has finished > booting, right? > That's correct. I will upload an update to this patch. I accept both comments #ifndef MODULE is indeed clearer and __init flag as well, since get_android_boot_dev() will not be called again after booting finished. > > Paul Bolle > > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 6652a81..2e4ad21 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -885,7 +885,7 @@ out: #define ANDROID_BOOT_DEV_MAX 30 static char android_boot_dev[ANDROID_BOOT_DEV_MAX]; -static int get_android_boot_dev(char *str) +static int __maybe_unused get_android_boot_dev(char *str) { strlcpy(android_boot_dev, str, ANDROID_BOOT_DEV_MAX); return 1;
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)