From patchwork Wed Apr 21 13:51:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 425291 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp348836jao; Wed, 21 Apr 2021 06:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8zFmAgcAaF6v9v146+2+9tXoIy1L2bUu5XUdEDH1unIk2IgH7pjqEBGTpBNDzazRGPIHj X-Received: by 2002:a17:90b:1e11:: with SMTP id pg17mr5385865pjb.81.1619013143790; Wed, 21 Apr 2021 06:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619013143; cv=none; d=google.com; s=arc-20160816; b=T9hZaAE6FUwt6Cvw/AdrfpbXBhMslJVQliB3bjN4NOONnsTBj/QD71fvSuciO4QKxK 9+2Lrht7hL03FsUv05fhrFiywnt9JU5uJFQK83PK30114H9ZdDBTCSTKxGQkiX9nb6bt 14lKHkVJqVxbz/1hMq24xVaxVG4ko7pLdmxQHjW+Cx+isUTV5keYHO6/x0AnOzb5Zm8m shJ4hTVG1XtgPVOPBPkN4JPRTK8LBJWHI4f/8s5jxSIcDinkv8AC4IIn4hpo9rXG59SI cDnojY5HoCxlcIiRwLMety4ZzM3OhVvOnGN/pFqPOsCluF2jlrvYo7ItzkfDwqLJlBrA QC9w== 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=5wNzUqdSVSzGuFBfMeimEnnQr4BWqy/PJDyhMj+V/Wo=; b=eOzl7AnE8MYTAfo01jl7/X0cTPn8wigHO/nmpdVwLRHCKs1ukh05YqvWgh6346o3rN PGX2wjR/6ioBaphzWSdPDYS0Hsk4C3UYwbw7ZFFnzTxEmGvcQs/HvE/THd/0OZhSnsvB CugrKGLYCXY6w0e+ahBsEUpb7UFsPTYaHpzasBj6Dh2uh5zQiOGARpAv/jaViuy6ot5Z GWFnSc9f+sPVfkGga90LkguoVyH2pejYrnAw2X49oU8ITJx0vErG97Yddu1aCuo4AXf+ 8bGcINiG7o0ckFDKzsaCg8NculQFupZHNCZ6Zv0SlNWLQw4DqZOf9KCWptd9iT1VIMqg b3FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=htVAWSN7; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si2481542plp.276.2021.04.21.06.52.23; Wed, 21 Apr 2021 06:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=htVAWSN7; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237813AbhDUNwz (ORCPT + 3 others); Wed, 21 Apr 2021 09:52:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:59064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237781AbhDUNwz (ORCPT ); Wed, 21 Apr 2021 09:52:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C18DD6144C; Wed, 21 Apr 2021 13:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619013142; bh=dc0EvbcvLLQuVCGRqItZSLQQVJEGn+D0uyY4r76gb2A=; h=From:To:Cc:Subject:Date:From; b=htVAWSN7dcGz2UGfywUQaAVdE0Da+7Wp8BV4DCRzCjAvswhx4/0oGPRXZHvfHsgV7 uCdnGNv0IIJZVqjbrTjLi+awk/OIMY+tpk3CAquMVf+mlmkp7GV3+l5QGN4tQPSzsj xq5dZt7Flga0/D3vo37WOycHjhPK3QvQiUl1iiv2V0xy20UKZDKy5OpX7qTfty2QOB XifDmdNZordN6XPSFLT34ZEgwvSndA9WK7NeiiEG4T/jnrMaJI+6TfXEj7DYvy9LkU 5EX/+V/7abhfr0/COe3xOfawL0E8Ji9N1HwjjD+b215e9aeFppomfniLGPksFgC6oC ahGthUnexyGOA== From: Arnd Bergmann To: Maxim Levitsky , Alex Dubov , Ulf Hansson Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Jing Xiangfeng , Jiapeng Chong , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] memstick: r592: ignore kfifo_out() return code again Date: Wed, 21 Apr 2021 15:51:58 +0200 Message-Id: <20210421135215.3414589-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Arnd Bergmann A minor cleanup to address a clang warning removed an assigned but unused local variable, but this now caused a gcc warning as kfifo_out() is annotated to require checking its return code: In file included from drivers/memstick/host/r592.h:13, from drivers/memstick/host/r592.c:21: drivers/memstick/host/r592.c: In function 'r592_flush_fifo_write': include/linux/kfifo.h:588:1: error: ignoring return value of '__kfifo_uint_must_check_helper' declared with attribute 'warn_unused_result' [-Werror=unused-result] 588 | __kfifo_uint_must_check_helper( \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 589 | ({ \ | ~~~~ 590 | typeof((fifo) + 1) __tmp = (fifo); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 591 | typeof(__tmp->ptr) __buf = (buf); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 592 | unsigned long __n = (n); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 593 | const size_t __recsize = sizeof(*__tmp->rectype); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 594 | struct __kfifo *__kfifo = &__tmp->kfifo; \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 595 | (__recsize) ?\ | ~~~~~~~~~~~~~~ 596 | __kfifo_out_r(__kfifo, __buf, __n, __recsize) : \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 597 | __kfifo_out(__kfifo, __buf, __n); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 598 | }) \ | ~~~~ 599 | ) | ~ drivers/memstick/host/r592.c:367:9: note: in expansion of macro 'kfifo_out' 367 | kfifo_out(&dev->pio_fifo, buffer, 4); | ^~~~~~~~~ The value was never checked here, and the purpose of the function is only to flush the contents, so restore the old behavior but add a cast to void and a comment, which hopefully warns with neither gcc nor clang now. If anyone has an idea for how to fix it without ignoring the return code, that is probably better. Fixes: 4b00ed3c5072 ("memstick: r592: remove unused variable") Signed-off-by: Arnd Bergmann --- drivers/memstick/host/r592.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.29.2 diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index 026fadaa1d5d..615a83782e55 100644 --- a/drivers/memstick/host/r592.c +++ b/drivers/memstick/host/r592.c @@ -359,12 +359,15 @@ static void r592_write_fifo_pio(struct r592_device *dev, /* Flushes the temporary FIFO used to make aligned DWORD writes */ static void r592_flush_fifo_write(struct r592_device *dev) { + int ret; u8 buffer[4] = { 0 }; if (kfifo_is_empty(&dev->pio_fifo)) return; - kfifo_out(&dev->pio_fifo, buffer, 4); + ret = kfifo_out(&dev->pio_fifo, buffer, 4); + /* intentionally ignore __must_check return code */ + (void)ret; r592_write_reg_raw_be(dev, R592_FIFO_PIO, *(u32 *)buffer); }