From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67AB3C10DCE for ; Fri, 13 Mar 2020 10:43:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BA142072C for ; Fri, 13 Mar 2020 10:43:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="e3GcwYox" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbgCMKng (ORCPT ); Fri, 13 Mar 2020 06:43:36 -0400 Received: from ozlabs.org ([203.11.71.1]:38919 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726364AbgCMKng (ORCPT ); Fri, 13 Mar 2020 06:43:36 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 48f2Nj1nkdz9sQx; Fri, 13 Mar 2020 21:43:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1584096214; bh=48BTPpdnvH7ubHf8Mn96zZTm64oFJUSebhf5Q/n0y2U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=e3GcwYoxeeUUmg4GpRStDdvnzxQK+ciVsY7yqakH7GrxIraMabyMbhFZ9i1cyXFAJ LQDeCWoPVvrQNUHqhoXMPmMEzQfS43lfBi3L26viv/f/xBCNtfEvZ0l+pALgV6hO5U OsQNJZFWHXu6j67mhmgisj+rTFIaO21BK5Yc+gWmxCN2qK+It5nqaYbxkfI/mHkxVP gFc1sUcHR3KYm97tm6aNARINaJvUBjWmYTetktYEDCkh+q0eYWbQcNiWLQP220T/1B faNwPRaJSDAjgifYpLSpCOzdBge9Zz917p3aKmffsrbmZ3IfLN+GyDqwmp0AONgJxZ W48hm3c3qjeAw== From: Michael Ellerman To: Bjorn Helgaas , Chen Zhou Cc: paulus@samba.org, tyreld@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] PCI: rpaphp: remove set but not used variable 'value' In-Reply-To: <20200312144157.GA110750@google.com> References: <20200312144157.GA110750@google.com> Date: Fri, 13 Mar 2020 21:43:29 +1100 Message-ID: <877dzoy1pq.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Bjorn Helgaas writes: > On Thu, Mar 12, 2020 at 09:38:02AM -0500, Bjorn Helgaas wrote: >> On Thu, Mar 12, 2020 at 10:04:12PM +0800, Chen Zhou wrote: >> > Fixes gcc '-Wunused-but-set-variable' warning: >> > >> > drivers/pci/hotplug/rpaphp_core.c: In function is_php_type: >> > drivers/pci/hotplug/rpaphp_core.c:291:16: warning: >> > variable value set but not used [-Wunused-but-set-variable] >> > >> > Reported-by: Hulk Robot >> > Signed-off-by: Chen Zhou >> >> Michael, if you want this: >> >> Acked-by: Bjorn Helgaas >> >> If you don't mind, edit the subject to follow the convention, e.g., >> >> PCI: rpaphp: Remove unused variable 'value' >> >> Apparently simple_strtoul() is deprecated and we're supposed to use >> kstrtoul() instead. Looks like kstrtoul() might simplify the code a >> little, too, e.g., >> >> if (kstrtoul(drc_type, 0, &value) == 0) >> return 1; >> >> return 0; > > I guess there are several other uses of simple_strtoul() in this file. > Not sure if it's worth changing them all, just this one, or just the > patch below as-is. I'll take this patch as-is, and someone can send a follow-up to convert the whole file to kstrtoul(). cheers