From patchwork Thu Oct 16 10:03:02 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Katiyar X-Patchwork-Id: 4679 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.176.167]) by ozlabs.org (Postfix) with ESMTP id A7D8ADDF96 for ; Thu, 16 Oct 2008 21:03:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbYJPKDF (ORCPT ); Thu, 16 Oct 2008 06:03:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753077AbYJPKDF (ORCPT ); Thu, 16 Oct 2008 06:03:05 -0400 Received: from ti-out-0910.google.com ([209.85.142.191]:34728 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbYJPKDE (ORCPT ); Thu, 16 Oct 2008 06:03:04 -0400 Received: by ti-out-0910.google.com with SMTP id b6so1767087tic.23 for ; Thu, 16 Oct 2008 03:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=TiPbF/f0pAF/pcYmc9doTnvkElCT9gzQL3hwWE9cDEs=; b=gMHjsBBsemrJZIw0tVUrsV6/Uqj91VMRgqrRqFUhk1ODz7O/v0i5hbVKvPaAOrQUph Gdoi+AOrCKaIvHxpxYrTEjBRfp2zd4PgnMBu7qtFfT5PRgbV4RO796JOHTbHjPMuzO8t /5dEC6s01H8sERshRWizT438iuuNUGlMYB8io= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=C90+JHcyPobiLSscVTFkYwM2CADiSgiJpeUFRiLTXrMpjEQ2QtpToSBpX5ZHaCILzm ZlrUq2iUxZwC6FmOijh4FRf7V3IKQIwj1gwsyLGZC3+Qmyxj3hey/tbbeY9yCxeRbzXc PY/SAWIgPn6fp8oa34BRnS4U9cZM1Ui+ifnnw= Received: by 10.110.52.1 with SMTP id z1mr1776350tiz.44.1224151382384; Thu, 16 Oct 2008 03:03:02 -0700 (PDT) Received: by 10.110.39.8 with HTTP; Thu, 16 Oct 2008 03:03:02 -0700 (PDT) Message-ID: Date: Thu, 16 Oct 2008 15:33:02 +0530 From: "Manish Katiyar" To: "Theodore Tso" , ext4 Subject: [PATCH] ext4: Remove compilation warnings in fs/ext4/mballoc.c Cc: mkatiyar@gmail.com MIME-Version: 1.0 Content-Disposition: inline Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Ted, Below patch fixes the following compilation warnings fs/ext4/mballoc.c:2717: warning: unused variable 'proc' fs/ext4/mballoc.c:2715: warning: unused variable 'mode' I think a cleaner fix would be to call these functions only when CONFIG_PROC_FS is set and cleanup EXT4_PROC_HANDLER to be always defined . Also since s_proc in sb only makes sense when procfs is configured should that also be ifdef'd in the structure itself ?? Let me know if these cleanup can be done in a better way (or the way you would prefer :-) . I can do this. Signed-off-by: Manish Katiyar --- fs/ext4/mballoc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index b580714..c88b5ab 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2712,12 +2712,14 @@ ext4_mb_free_committed_blocks(struct super_block *sb) static int ext4_mb_init_per_dev_proc(struct super_block *sb) { +#ifdef CONFIG_PROC_FS mode_t mode = S_IFREG | S_IRUGO | S_IWUSR; struct ext4_sb_info *sbi = EXT4_SB(sb); struct proc_dir_entry *proc; if (sbi->s_proc == NULL) return -EINVAL; +#endif EXT4_PROC_HANDLER(EXT4_MB_STATS_NAME, mb_stats); EXT4_PROC_HANDLER(EXT4_MB_MAX_TO_SCAN_NAME, mb_max_to_scan); @@ -2739,10 +2741,12 @@ err_out: static int ext4_mb_destroy_per_dev_proc(struct super_block *sb) { +#ifdef CONFIG_PROC_FS struct ext4_sb_info *sbi = EXT4_SB(sb); if (sbi->s_proc == NULL) return -EINVAL; +#endif remove_proc_entry(EXT4_MB_GROUP_PREALLOC, sbi->s_proc); remove_proc_entry(EXT4_MB_STREAM_REQ, sbi->s_proc);