Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1554691

Re: [PATCH] libata-eh: Use switch() instead of sparse array for protocol strings

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] libata-eh: Use switch() instead of sparse array for protocol strings
Date 2017-01-09 21:40 +0100
Message-ID <sXOTw-ng-15@gated-at.bofh.it> (permalink)
References (5 earlier) <sXLVE-74k-23@gated-at.bofh.it> <sXM5k-77I-59@gated-at.bofh.it> <sXMRH-7CY-5@gated-at.bofh.it> <sXO77-8iZ-7@gated-at.bofh.it> <sXOJQ-jZ-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Mon, Jan 09, 2017 at 09:28:12PM +0100, Geert Uytterhoeven wrote:
> > So, to avoid that, we can just kmalloc and kfree the buffer, but it
> > seems like a silly complication to work around bugs in some
> > bootloaders.  There are many places in kernel where we're liberal
> > about __initdata which is great.  I'm not sure complicating all those
> > places for a broken bootloader is a good idea.
> 
> Sure. We cannot avoid that kernels (esp. multiplatform) keep on growing.
> 
> But when I see a new 4KiB-sized buffer, i'm always suspicious...
> A few years ago, I caught someone miscalculating shifts, leading
> to a static buffer that was 256 times larger than intended ;-)

Oh, sure, things like the protocol string table are just stupid and
it's great that you caught it.  I just don't think it makes sense to
scrutinize bss __initdata.  It's not in kernel image and goes away
once the kernel boots.  It's okay to a bit liberal with them for the
sake of simplicity.

Thanks.

-- 
tejun

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] libata-eh: Use switch() instead of sparse array for protocol strings Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-09 16:00 +0100
  Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 16:30 +0100
    Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-09 16:50 +0100
      Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 17:10 +0100
        Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Christoph Hellwig <hch@infradead.org> - 2017-01-09 17:30 +0100
          Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Christoph Hellwig <hch@infradead.org> - 2017-01-09 18:30 +0100
            Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 18:40 +0100
        Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-09 17:40 +0100
          Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Christoph Hellwig <hch@infradead.org> - 2017-01-09 18:30 +0100
            Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 18:40 +0100
              Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-09 19:30 +0100
                Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 20:50 +0100
                Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-09 21:30 +0100
                Re: [PATCH] libata-eh: Use switch() instead of sparse array for  protocol strings Tejun Heo <tj@kernel.org> - 2017-01-09 21:40 +0100

csiph-web