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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 79D92C2D0A3 for ; Mon, 9 Nov 2020 12:56:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B3752076E for ; Mon, 9 Nov 2020 12:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926606; bh=Jgnn8GoI7D8swA4JQ5DxH/63GCBrrC5loXSvgV+AMRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rFkCxIoa72Uzl3hVz/h5O0mjphqK76BO0wacLeZ+OtawjgiB2KamP1GG+FiUYTltS 654nh+po1MKN4+8hai8mKuZOPCReELjSKsfFfieEWiaFVD8LFueonSczs16+04JGK9 kALbKSjRUMVQ711uzXypoZOiGXXh9fSECMtmdh1Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729850AbgKIM4n (ORCPT ); Mon, 9 Nov 2020 07:56:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:51114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729810AbgKIM4Z (ORCPT ); Mon, 9 Nov 2020 07:56:25 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34C44207BC; Mon, 9 Nov 2020 12:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926569; bh=Jgnn8GoI7D8swA4JQ5DxH/63GCBrrC5loXSvgV+AMRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uclmT97CPFW9YY/DIc/MWqU+Sq0iZ4+PzlQFtOJzWKx4Hl9Ee4ClRzVIskLRjIyy9 +jW4SNgdtjf50GlkOafXNpQAagBLE2zwsSVaPEB/c8Ha7W83Eklbc0vld+xPizZKlG EZYPxGSp4ZvKWrN1b5exRm4qV/nnu21b8Ve/8LxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Perches , "Gustavo A. R. Silva" , Miquel Raynal Subject: [PATCH 4.4 07/86] mtd: lpddr: Fix bad logic in print_drs_error Date: Mon, 9 Nov 2020 13:54:14 +0100 Message-Id: <20201109125021.220071728@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125020.852643676@linuxfoundation.org> References: <20201109125020.852643676@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gustavo A. R. Silva commit 1c9c02bb22684f6949d2e7ddc0a3ff364fd5a6fc upstream. Update logic for broken test. Use a more common logging style. It appears the logic in this function is broken for the consecutive tests of if (prog_status & 0x3) ... else if (prog_status & 0x2) ... else (prog_status & 0x1) ... Likely the first test should be if ((prog_status & 0x3) == 0x3) Found by inspection of include files using printk. Fixes: eb3db27507f7 ("[MTD] LPDDR PFOW definition") Cc: stable@vger.kernel.org Reported-by: Joe Perches Signed-off-by: Gustavo A. R. Silva Acked-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/3fb0e29f5b601db8be2938a01d974b00c8788501.1588016644.git.gustavo@embeddedor.com Signed-off-by: Greg Kroah-Hartman --- include/linux/mtd/pfow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/mtd/pfow.h +++ b/include/linux/mtd/pfow.h @@ -127,7 +127,7 @@ static inline void print_drs_error(unsig if (!(dsr & DSR_AVAILABLE)) printk(KERN_NOTICE"DSR.15: (0) Device not Available\n"); - if (prog_status & 0x03) + if ((prog_status & 0x03) == 0x03) printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid " "half with 41h command\n"); else if (prog_status & 0x02)