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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B56FAEB64DC for ; Mon, 3 Jul 2023 06:42:45 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=orPFhELO; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Qvbvm1TJBz3bqV for ; Mon, 3 Jul 2023 16:42:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=orPFhELO; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Qvbtn1rrGz30f9 for ; Mon, 3 Jul 2023 16:41:53 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1688366505; bh=SN/rqNOkg+BIF6QEZthBWLDM9wkNG/KuvshHNv3WAaU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=orPFhELO3x8zhKRBvFINPr9F22tOnD/GhNoegEV88m1K6gEhq++oIuYIWchaBYwLE WlJV8fZ8rjUF/79SjbaS1A5B+IdxU8KGoM8POcfmbBWwTjEhVWNL0NUCcR2GKjmgmr mQvcvy7CQEk4cJllSjWqMSsjQLt5tPshjs7kP4vyvs9NTDrxaAGmIIwh/LDiI/6nPs sb+CJzgj+jjQNmT71spEfLqrIilpqBoUF6Isc3/ujiB3RXg4oa/qPeOSwwi6CYa/5D 1VZDebBZZbGruRDJhAAEllFwQ+scA7gqasszGYYE+4Qo5dzYTleeTuuBxeFe1uU3pF kd0UIeWQgBslg== 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 X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Qvbtc66BSz4wqX; Mon, 3 Jul 2023 16:41:44 +1000 (AEST) From: Michael Ellerman To: Gautam Menghani , npiggin@gmail.com, christophe.leroy@csgroup.eu Subject: Re: [PATCH] arch/powerpc: Remove unnecessary endian conversion code in XICS In-Reply-To: <20230630055628.17790-1-gautam@linux.ibm.com> References: <20230630055628.17790-1-gautam@linux.ibm.com> Date: Mon, 03 Jul 2023 16:41:41 +1000 Message-ID: <878rbxwl7e.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gautam Menghani , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Gautam Menghani writes: > Remove an unnecessary piece of code that does an endianness conversion but > does not use the result. The following warning was reported by Clang's > static analyzer: > > arch/powerpc/sysdev/xics/ics-opal.c:114:2: warning: Value stored to > 'server' is never read [deadcode.DeadStores] > server = be16_to_cpu(oserver); > > As the result of endianness conversion is never used, delete the line > and fix the warning. > > Signed-off-by: Gautam Menghani > --- > arch/powerpc/sysdev/xics/ics-opal.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c > index 6cfbb4fac7fb..5fe73dabab79 100644 > --- a/arch/powerpc/sysdev/xics/ics-opal.c > +++ b/arch/powerpc/sysdev/xics/ics-opal.c > @@ -111,7 +111,6 @@ static int ics_opal_set_affinity(struct irq_data *d, > __func__, d->irq, hw_irq, rc); > return -1; > } > - server = be16_to_cpu(oserver); > > wanted_server = xics_get_irq_server(d->irq, cpumask, 1); > if (wanted_server < 0) { My first question with a patch like this is always going to be "how did the code end up like this?" Has the code changed and this assignment became unused? If so the commit that did that should be identified. If the code has always been like this that's also useful to know. Or something else happened for it to end up this way :) The second question will be "is there actually a bug here?". ie. should server actually be used, and the bug is not that it's a dead assignment but rather that server is not where it should be. cheers