Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1297066
| From | Andrew Morton <akpm@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE |
| Date | 2015-12-22 22:20 +0100 |
| Message-ID | <qICvD-GS-9@gated-at.bofh.it> (permalink) |
| References | <qI1Z7-2OG-13@gated-at.bofh.it> <qIsFY-2OC-17@gated-at.bofh.it> <qItC2-3qD-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, 22 Dec 2015 19:40:39 +0800 Xunlei Pang <xlpang@redhat.com> wrote: > > Following functions will be used only in kexec_file. Please wrap them in > > CONFIG_KEXEC_FILE. > > > > int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf, > > unsigned long buf_len); > > void * __weak arch_kexec_kernel_image_load(struct kimage *image); > > int __weak arch_kimage_file_post_load_cleanup(struct kimage *image); > > int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf, > > unsigned long buf_len); > > int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, > > Elf_Shdr *sechdrs, unsigned int relsec); > > int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, > > unsigned int relsec); > > Thanks for the comment. > > I noticed this as well, but seems for the function declarations we don't need do this, > since they don't consume the actual space. > > For example, in the include/linux/timekeeping.h > /* > * RTC specific > */ > extern bool timekeeping_rtc_skipsuspend(void); > extern bool timekeeping_rtc_skipresume(void); > > extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); > > also not embraced by the corresponding macros. Yes. If we add the ifdefs then a programming error will be detected at compile time. If we don't add the ifdefs then that error will be detected at link time. So the ifdefs provide a quite small advantage, while making the code harder to read and harder to maintain. I believe that "no ifdefs" is the better side of this tradeoff. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE Xunlei Pang <xlpang@redhat.com> - 2015-12-21 07:20 +0100
Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE Minfei Huang <mhuang@redhat.com> - 2015-12-22 11:50 +0100
Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE Xunlei Pang <xlpang@redhat.com> - 2015-12-22 12:50 +0100
Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE Minfei Huang <mhuang@redhat.com> - 2015-12-22 13:10 +0100
Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE Andrew Morton <akpm@linux-foundation.org> - 2015-12-22 22:20 +0100
csiph-web