From patchwork Tue Oct 30 18:40:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 195583 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C57D42C0080 for ; Wed, 31 Oct 2012 05:39:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756075Ab2J3Sjv (ORCPT ); Tue, 30 Oct 2012 14:39:51 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:41992 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753797Ab2J3Sju (ORCPT ); Tue, 30 Oct 2012 14:39:50 -0400 Received: by mail-ia0-f174.google.com with SMTP id y32so410648iag.19 for ; Tue, 30 Oct 2012 11:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=converseincode.com; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=AVJgJZEGHv7wL5TVewRUkCaNCbIBzf3hX1v8jA47AO4=; b=TQxvn8xEd7sCRTklP4gK6tIIKBWiX8Nx3kjTID9rUdnvh0hRbQ1kNiE31r1gEpcVhL eE+e/jxkiUVKWn3UZ5WSTgzWsiREcQfIxlBalPDv21t+5RErNXdCxbetVs371+2GR/6n rgjdDpa3L7wCEJrhGuw1Xk0u0Vb1nYozzXA64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=AVJgJZEGHv7wL5TVewRUkCaNCbIBzf3hX1v8jA47AO4=; b=Pw5Xyq6wsid0910+0RBc23CyWHhiWdahHd8efqIbs1O7nElGIgmIyekoTGgRujm9Sk akIQt55uVj4aH8PCT438CFPWwKqG7yhVMBGXmrerXL8xyYraZNvPTJnglgPwE5UBc5S2 t6lpQPEF/MoXbX2vlg3X70ItJy6hnIwMuTVOX4EdebiPz3lJ/liOa3Zpru46SnE0Tb19 +KcMNZGDahnSefuX+XXoszQe2a1W3P5+WCyp7c44MrEWuagqGSYP8Gylil9d++bswu1I tGuhO6PSwr/2jy1cqVJst0bziZmWvR7/KU0VF3g6sgWX+2eta5eo6oS9JxtMZfm0cbQf 3/9g== Received: by 10.43.57.5 with SMTP id we5mr29102314icb.23.1351622389567; Tue, 30 Oct 2012 11:39:49 -0700 (PDT) Received: from GaldorVB.converseincode.com (216-58-123-56.cpe.distributel.net. [216.58.123.56]) by mx.google.com with ESMTPS id s3sm1120835igb.14.2012.10.30.11.39.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 11:39:49 -0700 (PDT) Received: by GaldorVB.converseincode.com (Postfix, from userid 1000) id DA524650A3; Tue, 30 Oct 2012 14:40:08 -0400 (EDT) From: Behan Webster To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org, Mark Charlebois , Behan Webster Subject: [PATCH] Remove VLAIS usage from JBD2 code Date: Tue, 30 Oct 2012 14:40:04 -0400 Message-Id: <1351622404-18214-2-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351622404-18214-1-git-send-email-behanw@converseincode.com> References: <1351622404-18214-1-git-send-email-behanw@converseincode.com> X-Gm-Message-State: ALoCoQk5s4LTOUcOP7UlsgLgGg7YyJEfx7oJbo3roy4sX6/0gqm9i3dy2SIusMLRqCxYiUdyrsWR Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Mark Charlebois The use of variable length arrays in structs (VLAIS) in the Linux Kernel code precludes the use of compilers which don't implement VLAIS (for instance the Clang compiler). Since ctx is always a 32-bit CRC, hard coding a size of 4 bytes accomplishes the same thing without the use of VLAIS. This is the same technique already employed in fs/ext4/ext4.h Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster Acked-by: Darrick J. Wong --- include/linux/jbd2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 3efc43f..efcbdfc 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1308,7 +1308,7 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc, { struct { struct shash_desc shash; - char ctx[crypto_shash_descsize(journal->j_chksum_driver)]; + char ctx[4]; } desc; int err;