From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164392AbdAIUbd (ORCPT ); Mon, 9 Jan 2017 15:31:33 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:34470 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164375AbdAIUbO (ORCPT ); Mon, 9 Jan 2017 15:31:14 -0500 Date: Mon, 9 Jan 2017 15:31:07 -0500 From: Tejun Heo To: Geert Uytterhoeven Cc: Christoph Hellwig , "linux-ide@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] libata-eh: Use switch() instead of sparse array for protocol strings Message-ID: <20170109203107.GO12827@mtj.duckdns.org> References: <1483973368-6828-1-git-send-email-geert@linux-m68k.org> <20170109152319.GA12827@mtj.duckdns.org> <20170109160424.GB12827@mtj.duckdns.org> <20170109172723.GA30423@infradead.org> <20170109173154.GE12827@mtj.duckdns.org> <20170109194100.GH12827@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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