Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1793824rwb; Sun, 6 Aug 2023 03:07:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtR4Gz5cGruqMdSmsvT7oGpwdjKIrxMAjA4R622M0IQ80brVNByBHTez1ianUgssUwXB6q X-Received: by 2002:a17:90b:385:b0:268:fc26:73a9 with SMTP id ga5-20020a17090b038500b00268fc2673a9mr4771581pjb.40.1691316431285; Sun, 06 Aug 2023 03:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691316431; cv=none; d=google.com; s=arc-20160816; b=IRKx61OM47+B2OdS6Iaa20+bHiFffoYhI0UqbgYs2tTnSvkcaJ76R/LNGHgFV1gvbf RxzGz7Rbzh6fk9A1YlHPfsFwjZFaKCl41xU3983m4rdrbEFzKR6L4NcpE//MQj+UKVik UmFBuxDA7IwyPDSgDHu7smTEDvvGIXaYENDvLcvidMCyylW95wCeRvCKlj1SSIuzvFKc vy4uUCGQd5X0zCpKSulfZSOv3ruNxoyZby51ndD7icrJd0Z0gJZzxmlDsAisgWHQWIZL I2hS65/bu6lOOXDUplJmOUD4tnC1fvKeiWvVokKlTKMaBrpU3/RFDtbA0twOzzdFg12t VZrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=y/VsbE0slEMRhZ8TGMIdWLlmOlT7Ip9MoAgWWsTSAm8=; fh=OnVXZR/xMlTDaO2l7yI2gI/v6kWP0ES896Di16+esTI=; b=yiA1lgI9lp1NS8+MipWrq8oCSkXMLYuZkY9rHHhMhnh97YNkMS5RbneWTtvv6FLKI7 mqoyP6R0+2v8Kjd5xxmAlhHvvGuRaxv/1r9kohbjLw04ubS2LyZYOPHxRN3JmygRFn67 SxATEoiE8HWkFNXY2fWZoHb3BEqnxWjDZySaRL81Oi4xQFC8Zl9ZgNgPrTz43hidq3sJ YoFolHuAngSs1gewbN1bfAjvw0MpWTN/eY93AP6R7l6Rfa03JBwODFFDfqcvjbpXyr1s jRqT9jx4P037bqY1Xh22k1K618fUtPXkML2yNbZ73xAJSpXFZR07Dfh5Vswr11gpjDsr ry6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=KzgTJeju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo22-20020a17090b091600b0026301f58ac4si4333157pjb.82.2023.08.06.03.07.00; Sun, 06 Aug 2023 03:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=KzgTJeju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbjHFIhm (ORCPT + 99 others); Sun, 6 Aug 2023 04:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjHFIhl (ORCPT ); Sun, 6 Aug 2023 04:37:41 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BF311D; Sun, 6 Aug 2023 01:37:40 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2682b4ca7b7so1886187a91.3; Sun, 06 Aug 2023 01:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691311060; x=1691915860; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y/VsbE0slEMRhZ8TGMIdWLlmOlT7Ip9MoAgWWsTSAm8=; b=KzgTJejuxzMjf7uHhJZ1yYeDin/Jxg2lr0jvwD1a2ZB0FOHX1cWxEidzAj2xBDkv1A 6RZGS47QIYBBfFWTWHCIJAccg2aNjxoSrEz7VGUNQWOIYeD1GtiwBFC7ZOjw0Tt/eLis dSVrChsTtepG4sT13WoxwAq2bULnjIeo93EZmwLYOTO7EevsicYjme9BfsYwxKPmCzTW sxopvfmh3WgJjbierzs+xoEm0BzzA8X/+Lq4ConhV6PqcM+67bwrwn2ZPatD02udTbqW 0oBWwcW3wBlkmBSNRmpFiciBUThVlLiUlvHvfRRK6/8NsW1aW/Bt/TdXcvmGZFqg65+w H5cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691311060; x=1691915860; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y/VsbE0slEMRhZ8TGMIdWLlmOlT7Ip9MoAgWWsTSAm8=; b=XyZpBqUfY8/iiq+74TwoR61kj0Yyi4B/AFIeQkkaPt3mBb+XLUZtKPR3QKrVOAR978 9WuV2kS84PLT/Pz51pzTt4vR71CeYedeaLpvLCrOPblcaQ3fY6xASf71e/9B7dTiiWs7 xrYuf5PZ9THld5CXdLrqXQ7uZbAYa3LCiPP8pCiBG7kp7PGlM7uAJLxQGRrR7tEQBAbh qI90PEYtE9t3AR69SMoe+eJAZLYfCsiW0JQPpj+Nh6+g3n1R1bikzFyFtlyepWUIK2l1 7XIRmgcOnjUXVzBeo6WPzQbClqJyztAD9mYLMkkKJCNLftsVoF5qgG+bhd8M/1d0ztPL yuUQ== X-Gm-Message-State: AOJu0Yym9bdRozU2rjOhHb3h2IRItVZ3aqVgD/FWlf0I+j1w+qQyvZ7a NmoSm2M4vdQXi/AxOs+68pc= X-Received: by 2002:a17:90a:f287:b0:268:5558:de4c with SMTP id fs7-20020a17090af28700b002685558de4cmr4980313pjb.38.1691311059896; Sun, 06 Aug 2023 01:37:39 -0700 (PDT) Received: from localhost.localdomain ([2409:40c2:1028:5dc5:7c0a:52e1:6b87:38ef]) by smtp.gmail.com with ESMTPSA id i4-20020a17090a64c400b0026307fa0442sm6580403pjm.49.2023.08.06.01.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 01:37:39 -0700 (PDT) From: coolrrsh@gmail.com To: broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-kernel-mentees@lists.linuxfoundation.org, Rajeshwar R Shinde Subject: [PATCH v3] spi: spi-mpc512x-psc: Fix an unsigned comparison that can never be negative Date: Sun, 6 Aug 2023 14:07:33 +0530 Message-Id: <20230806083734.7685-1-coolrrsh@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajeshwar R Shinde In struct mpc512x_psc_spi, the variable 'irq' is declared as an unsigned int. The comparison of variable 'irq' with signed int operand is incorrect. Also, the return value from the call to platform_get_irq(pdev,0) is int and it is assigned to an unsigned int variable 'irq', thus redeclaring the type of variable 'irq' to signed int. This fixes warning such as: drivers/spi/spi-mpc512x-psc.c:493:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0 --- drivers/spi/spi-mpc512x-psc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 99aeef28a..5cecca1be 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -53,7 +53,7 @@ struct mpc512x_psc_spi { int type; void __iomem *psc; struct mpc512x_psc_fifo __iomem *fifo; - unsigned int irq; + int irq; u8 bits_per_word; u32 mclk_rate; -- 2.25.1