Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3943163iog; Tue, 28 Jun 2022 06:05:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6jrO9r48Ss++TsdrrxUWcLHUAoVW69IcTz2bwbWL2/olRp1KKU3jYcqn3PWA1K5zPEvk1 X-Received: by 2002:a05:6a00:1f94:b0:527:a8f4:9811 with SMTP id bg20-20020a056a001f9400b00527a8f49811mr3397673pfb.71.1656421538261; Tue, 28 Jun 2022 06:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656421538; cv=none; d=google.com; s=arc-20160816; b=YdqLUDMSHY3fCbdVqCQnz0DDJXnt8NzJm/aVNI8wC8Axth/t7aCvr6Nr4AEQkdnxPK mErKvYuI7u9fD9rxZgtPS/mqm7ekncfCHIc31OsrnTuxgGMTixxFmUs5uX0Nzqq97Pk4 h6mjiWytApPRZ1jgbuuDxQMKI6lO5iiqkJj/LDxeIQddlkumzVq+X4y+LZygL718HMAU oczc3TwtqFeXxtcgbVCk3gHmYi0d3ua8EU73aOEVD1FylTHweoWCLjIGAburHBVfPo0O l5C6rW36ZqN9mE8tXkoVYNl8oXbn5AIjlNOCJmBLMsJZOfWsgI3AXPotHRFWvACpF6dS bl0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oRHUNfpFVHGzlFepog/imAGSgi6aseogxw2LraLTHTI=; b=wROTSsSIKH5oYMeZwZbar3kuSQPjI113t0bx+ZICO4ehMc+hiVKZFatQ+Ayr6Mgi6W lg95PAknFcem2UP0OXZd0jmTaxVelRZMka2GJQc4ytBX2bA80cRN4gMzKfr/LmIZMk88 mXeYCg1B9BJpNJIfHSs8GEfh4TCNfzBEqJy5cDx9G+0B1gk68HY2Niv/rHGOpU/bY06F bV+m6917UekmZMdgJ5TDvPScAzPkcCBtimjVXsZy4yPgma4wpTb2ujznjv3Ui28rAJz5 G5BC2N91Mp3OqGev6omR0/mNzd6IYlu3krF59tDwcnArmT9W7B4BMeYT7BuU68puM3VP lHLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMS3kwTU; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a17090aa00e00b001e85e2bc068si21004611pjp.19.2022.06.28.06.05.10; Tue, 28 Jun 2022 06:05:38 -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=@linaro.org header.s=google header.b=kMS3kwTU; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345657AbiF1M1T (ORCPT + 99 others); Tue, 28 Jun 2022 08:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345653AbiF1M1S (ORCPT ); Tue, 28 Jun 2022 08:27:18 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA96D25591 for ; Tue, 28 Jun 2022 05:27:17 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id p7so20503274ybm.7 for ; Tue, 28 Jun 2022 05:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oRHUNfpFVHGzlFepog/imAGSgi6aseogxw2LraLTHTI=; b=kMS3kwTUJ5R9E68Apc0sC4qVHrWCaHd03NoS6lMckuWQTqPNFsQ/Qh/r3baWWeTa63 N+dKTgLQtY5+ExZ+z7lP2ll1+4uLavKL0BhH+MJFJ1Ns43nyy4Op6/qtofoTqEKVddgI K0IZxMhi+36c605vQtwjXg7nSZCExJ271nHKWGbo/GWk3YvF7dklYanJ/KPWH7DhD3ea huIaIUJrOwciwqRsJOJw6NeV0g4f2dL07gdVAYB0IHEvjkGkr+GyNOiYHT0B1wtrsBZj YLL0OmoPatcT3sqj9VMkA7pKvMjp6x6/LPs+lfRIN17RdrQOfwJI3yNP8y8YoMpupgEE BZ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oRHUNfpFVHGzlFepog/imAGSgi6aseogxw2LraLTHTI=; b=yC/1FGGEt/yCJnDGXuKFUnnidHuYpY7E5LNZ18Tg2ct1362YtaH+/1K01WZPfATrb5 7b3l1vSzM8Xse5QoTERqX54TyzWaZw8heu1HLiY6RRe7vxO0FleI1kSyUQAkJ+BJPIHO Dq0d+obpNfPtWLAXrnddpDambCCPy/0EDqW04sw59eW3sp411oKkjGp2NKO6P0Y2as7U BKaX7WFmNEkD5dCNEjaTp1xTyZXy9kIHlKXIU6G36a/yn1wYs7O7Zxt9RN+ouMLa+6lt OyEBgXlENc4n07W7brc+cZHuwo/wCiE8QcOJRArhYQg6xUtOr6xay9Y1FQf8vYnEHGzN sCMA== X-Gm-Message-State: AJIora/TMqJeaFg746xl2R5rbmJxhCapfn7oqVTEFxU1bE2Drc7euhjD T4LVmGo2FMcBRuxSQuSp8e2Xjd1f9bh/QR9+M+tCbQ== X-Received: by 2002:a25:d88d:0:b0:66c:999d:919c with SMTP id p135-20020a25d88d000000b0066c999d919cmr16062500ybg.514.1656419236961; Tue, 28 Jun 2022 05:27:16 -0700 (PDT) MIME-Version: 1.0 References: <20220617051921.3801832-1-srinivas.neeli@xilinx.com> In-Reply-To: From: Linus Walleij Date: Tue, 28 Jun 2022 14:27:05 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-xilinx: Check return value of of_property_read_u32 To: Michal Simek Cc: Andy Shevchenko , Srinivas Neeli , Bartosz Golaszewski , Bartosz Golaszewski , Michal Simek , neelisrinivas18@gmail.com, Shubhrajyoti Datta , srinivas.neeli@amd.com, Srinivas Goud , "open list:GPIO SUBSYSTEM" , linux-arm Mailing List , Linux Kernel Mailing List , git Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Jun 20, 2022 at 8:26 AM Michal Simek wrote: > On 6/17/22 18:02, Andy Shevchenko wrote: > > On Fri, Jun 17, 2022 at 7:20 AM Srinivas Neeli > > wrote: > >> > >> In five different instances the return value of "of_property_read_u32" > >> API was neither captured nor checked. > >> > >> Fixed it by capturing the return value and then checking for any error. > >> > >> Signed-off-by: Srinivas Neeli > >> Addresses-Coverity: "check_return" > > > > I think the best course of action here is to go and fix Coverity while > > marking these as false positives. > > > > To the idea of castings -- this is not good style and (many?) > > maintainers in kernel do not accept such "workaround" for fixing > > broken tool. > > Let's wait for Linus what he will say about it. > I can't see nothing wrong about declaring that I am intentionally ignoring > return code. I don't think this patch should be applied. The problem with static analysis is that such tools have no feeling for context at all, and in this case the context makes it pretty clear why it is safe to ignore these return values. But we need to adopt the tool to the code not adopt the code to the tool. Yours, Linus Walleij