From patchwork Mon Sep 27 09:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 514669 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp3942240jao; Mon, 27 Sep 2021 02:45:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHhrqFpfKP2/LA8VCqna6f4izrqCu08WoBb+miKnTAAkwCft0aJur4OuHNI/fbXAOKgZk7 X-Received: by 2002:a50:fa81:: with SMTP id w1mr21539388edr.277.1632735926994; Mon, 27 Sep 2021 02:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632735926; cv=none; d=google.com; s=arc-20160816; b=Kyh5IkWgU5qcVlhhhSG3bfvD8jhd88B3nAlVHUHOmJ4SpReubTOZwwz6pwnBphoOB6 CpHNJWSs5Owk0Z55KP2pU298n26poaIIHTwMvbGDEhuZmp50EiXNqqlKj92roXSdn7Av tNCHcJ8BK1IQrfdtj9BKVSDo6lJie+cS08szRqjn/rvj4u7HzDDmIjeCbT275wrMyiUe r3cTU4YjGUv4J7f1jQ+Y7Wz3VYoZYjKmUNGspjYpQPTVamrpzXbBPEZSMpU0wOPvM117 LJ8a9D4hHhemIC6neFuSvd+ES+qA1KemA0tJ0ZJPUZ0nuhKtzTJkJeCpSjmSCEdpGdjA v/Hg== 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=IAkdMeXzPCeIZZKn0qtIzFjz6XDzxI8Cz/ShROStT2Q=; b=m7cy/IJG8D/q7hrfsRa6rBmvJpGlB9X7p2GKtndTkSdv6UbWbBv5pyECphFZsUefuV QVQBbSISyQTjlUZGjKpX1fM7ZEWsJK7GHkWKFhvIJ9hVpxquIyErlzWD30lYcN/wRU1Q nW47pjcDqMeSli8nA80reG7AJzE3GY7qlEPijronQs8DnsrmC5zxcCVT0qdJrSypq6c9 jLUZY/yvgiYfi0sCN+1UCaPAl5zKXLxOyUk2pCXuB6IJh2jbQeedw7ghEU9iC533m9Jp 72l5Ls+N0RyEYq6iiYKJxzMY1O6TmcghYmiUZ0P+JJIQurv32uXlClTIZf3NlAW9ma1R wqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o6PSo81t; 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 o12si1446191edc.95.2021.09.27.02.45.26; Mon, 27 Sep 2021 02:45:26 -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=o6PSo81t; 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 S233587AbhI0JrD (ORCPT + 3 others); Mon, 27 Sep 2021 05:47:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:49980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233680AbhI0JrC (ORCPT ); Mon, 27 Sep 2021 05:47:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E597461157; Mon, 27 Sep 2021 09:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632735924; bh=gFGitQYEbKU+ll1qJ4OCqESVHY1IMF80+p0Jqsb7qYE=; h=From:To:Cc:Subject:Date:From; b=o6PSo81tkdTwK2YP2LSaneKqFnF7Ou7RHR44P7NLtHNmh9aGGhJ+XPQSxGi7gfxjj QDh/V2gXj4WWHOMI2J22bBciYlwxSrH0/q25j/mViAP9yg0vAcWoxMKb4tWWJ+lY4e IwrtDqS4CLTH1b0VH05ynKY+uwD+E+7Jr9EElnKZdBh1obUEOJKFm4fJWtB3gm7SzW M9bqm6EwZhifWOwPZwYQoSkvs/O5IKYtbuC7TE6Qc63v/Q7ggIJBDqxPs8aEoOB47j 4m1zB/FMn4NUuUI6fEItZ1t+3U4rPtw5b8Qhg0z+xDjmD1pJ1GiNz4+977X0v9fDu3 NfBV/yZQG8tDw== From: Arnd Bergmann To: Maxim Levitsky , Alex Dubov , Ulf Hansson Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Jens Axboe , Andrew Morton , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] memstick: avoid out-of-range warning Date: Mon, 27 Sep 2021 11:44:47 +0200 Message-Id: <20210927094520.696665-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 clang-14 complains about a sanity check that always passes when the page size is 64KB or larger: drivers/memstick/core/ms_block.c:1739:21: error: result of comparison of constant 65536 with expression of type 'unsigned short' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (msb->page_size > PAGE_SIZE) { ~~~~~~~~~~~~~~ ^ ~~~~~~~~~ This is fine, it will still work on all architectures, so just shut up that warning with a cast. Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks") Signed-off-by: Arnd Bergmann --- drivers/memstick/core/ms_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index acf36676e388..487e4cc2951e 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -1736,7 +1736,7 @@ static int msb_init_card(struct memstick_dev *card) msb->pages_in_block = boot_block->attr.block_size * 2; msb->block_size = msb->page_size * msb->pages_in_block; - if (msb->page_size > PAGE_SIZE) { + if ((size_t)msb->page_size > PAGE_SIZE) { /* this isn't supported by linux at all, anyway*/ dbg("device page %d size isn't supported", msb->page_size); return -EINVAL;