Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4785414yba; Wed, 8 May 2019 02:44:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzypzkcZP8ebZsoFKZVnflNsNEUm8U15r0AQ/RW+9eGwdtmkEB55IwCls066eW4nlVNfAYi X-Received: by 2002:a63:fa4a:: with SMTP id g10mr19267522pgk.147.1557308697586; Wed, 08 May 2019 02:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557308697; cv=none; d=google.com; s=arc-20160816; b=cE39wjXq/gHVS/cM5CUhtkQTKQ1IJjo3hgLq/cWHWLZhVY6T9/XxveR7WjNg46qPH/ pe7cJqkOMKQNEb1arzndr/Y2+kKyHwCJAODQCT6Yxhttqk3ao2vihAwJIM2yOEcmEE+b /KMJajh14Voq5+9mO9S83WsVFlpKFrGKKxyoaVW7NRJv+T4k/1ZWUhkpinrYVfp4sQVI wrqZtsqGETpENQvHvqN6nsFO3i1RLL2Zo21sHvXBEXurvDunhOrsEnOnF4NtNpXTLnmo N8jk1lbGjMocLcPdU6XK0ObaaZ7nhZDzoB2J86w1akgotYdUJbwXQlXP1+0HjAQWo2is n8Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=QpeK/OJb4Ga8ez5ntyy1wNET6hAZRNpxEZUZXAjYMYM=; b=a/O9bYegbuv7DGjEbevPCv8EU0TmLDfEqeA/N4z5pZL3ifxlN3/2GC0Xh3HSkg/4Fw 0aNNgQ/JSaNtlFW2UjqDdQkoC/cVpxhRDeD+5zyQ2EfBivp4CN635UtqYw/h3qiZjeeI r9CXHsxig3dGUokGRCgzBJiUyt3JYdYr3uPc8kC3BJCTCESuOBFGKmqXCDIWrPoiQV0x CPERJsm2wNYFxLmOT/Y+PEjeQu4IGnBsSj06JmEhOrY26TTttpQ2SJpXhE3UH7RA/BV1 FSR+qFklP5QMEPqC9x1qa987k4iAq2UaovXiiCCTXJy4ABRD4yzZYw6xkm6n7koS8Ftp jGeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si21174879pgq.400.2019.05.08.02.44.41; Wed, 08 May 2019 02:44:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbfEHJLI convert rfc822-to-8bit (ORCPT + 99 others); Wed, 8 May 2019 05:11:08 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:41551 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbfEHJLI (ORCPT ); Wed, 8 May 2019 05:11:08 -0400 Received: by mail-vs1-f66.google.com with SMTP id g187so12198664vsc.8 for ; Wed, 08 May 2019 02:11:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9zvqXQzn3SLsVtTH+qrWy/dpjXSSADrZyCG/zclGFrk=; b=OjXpJ7qUsFyNmGZmvDeOv2DQb8w1ZVfQQluSWpkuf2Ij1OGY6TxleVbhBnDqj54Cso ge8zGZ2EdRdVLmEmNabw8LD5m4iprp/Y1+qfHLwlGReLXUoBiML5ZDEwWDjWTkFqiuag Nc1YQEe2sKjnesEiYWM6gvxlEaEFVr2HlPpUXQZB+zrPM0XFFXlbDpXBsz3ntW95yfKB F9kM0D6v9uKFzq+ddixoNxT+2bQVgC34P83QJC6O5jc8iSxbHGyoMFlOPENNPTuYv+oC bsrLAaWWn0DAhW4/i1LhPQvWiD4loT2rhnb9M4RIjf3t43KQxvjrI892NZMlD8wS5pci 9xJQ== X-Gm-Message-State: APjAAAU/jxe+oXqIyTdyCYgAs0K67rrc1Y+rlchYy042HkK+uc1KKBZS y9Dg2YjRZUQiBetIjF0RfnDy9JPN10HNaALSci31ZfR2 X-Received: by 2002:a67:e2ca:: with SMTP id i10mr11629908vsm.96.1557306667170; Wed, 08 May 2019 02:11:07 -0700 (PDT) MIME-Version: 1.0 References: <20190507135233.31836-1-anders.roxell@linaro.org> In-Reply-To: <20190507135233.31836-1-anders.roxell@linaro.org> From: Geert Uytterhoeven Date: Wed, 8 May 2019 11:10:55 +0200 Message-ID: Subject: Re: [PATCH] intel_th: msu: fix unused variables To: Anders Roxell Cc: Alexander Shishkin , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 7, 2019 at 3:53 PM Anders Roxell wrote: > When building and CONFIG_X86 isn't set the compiler rightly complains > about an unused varable 'i', see the warning below: > > ../drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_alloc’: > ../drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable ‘i’ [-Wunused-variable] > int ret = -ENOMEM, i; > ^ > ../drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_free’: > ../drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable ‘i’ [-Wunused-variable] > int i; > ^ > > Rework so that an else part is added where empty functions are created > for set_memory_uc() and set_memory_wb(), in that way we could remove > '#ifdef CONFIG_X86' in function msc_buffer_win_alloc() and > msc_buffer_win_free(). > > Fixes: ba39bd830605 ("intel_th: msu: Switch over to scatterlist") > Signed-off-by: Anders Roxell Thanks for your patch! > --- a/drivers/hwtracing/intel_th/msu.c > +++ b/drivers/hwtracing/intel_th/msu.c > @@ -21,6 +21,11 @@ > > #ifdef CONFIG_X86 > #include > +#else > +static void set_memory_uc(unsigned long addr, int numpages) static inline? > +{} > +static void set_memory_wb(unsigned long addr, int numpages) static inline? > +{} > #endif Regardless: Acked-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds