From patchwork Mon Oct 24 16:28:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 9967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp614226wru; Mon, 24 Oct 2022 12:23:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70F/FniVGxcSHnv4PRv00OmhTHpfE3yD2lO6dR/YIPa073IzrEjBqukgH6Q1XEpPU9wevH X-Received: by 2002:a17:90a:582:b0:20a:97f6:f52e with SMTP id i2-20020a17090a058200b0020a97f6f52emr40259232pji.126.1666639398696; Mon, 24 Oct 2022 12:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666639398; cv=none; d=google.com; s=arc-20160816; b=PLExKHEqWSBdmtV1/tw1wTCFtJW8bT/DhrPmUv+J5Y96hcqHiy7gKFQUj1gl8d8sm4 B4uzAtuGjgg6nYkhjzT1sOtmPDsTnzTkl6XTl//IK8L0g6iadCazhQEt2f0TIP724JBB dJEXgBeO6Tcj5eqyoYBw/Gz9jHWghbRmVDdxR7xjUN/+IAO9BfH+iASdwTnCul/4dahN 5kSuH02Mz6Ji5zy1LAEYy9O4VhYOd+afGZxmizx6bUaVitICOurYiOglSX5cnSH8LPcO UAF7Gt5s1rAyR/UdrVXCgZV92X9tPtca7SmI100Bo/cOErnAwNE5aHyh1xEGsQf0Quk4 u/Cg== 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=SBGplGN9wXQ6YLKsKfvWr4VPlcYFhGIJKX2SJ5Tbgz0=; b=oQmqNzkU/claYLyt8smzgGmbjvc27+BiRlPHa3V3YP3enuszivne8niVeM6N1/K/iB oOtS2EGFpVWUmVdU+zlsfaMghSThMGK5USJ8y23hZwjfxdWXieQBBOhXWwNBa2AGc4pK CZpo82AnwiXb8T9E9wN+EIGUeigdWgsSg8H9P2RAkCrp1hdEBdrsvpwLJk7OjQL3e+jM Y3xjCgF/71OVV7ihfc/9VLsoEBvYUIPmI/xW9tF516OA3GCBYa+RDOzAasAfYuxO8ATi wfh7UA+/JhjIQiTGeZtzk/6yZT5kUdNkxpE5x4KPu0kuQIJmk5phL5XrnGgj1DsB33jl 0ehw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=OuR0REi9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902e31100b001869c035f20si267653plc.381.2022.10.24.12.23.04; Mon, 24 Oct 2022 12:23:18 -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=@zx2c4.com header.s=20210105 header.b=OuR0REi9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbiJXTPT (ORCPT + 99 others); Mon, 24 Oct 2022 15:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231972AbiJXTO2 (ORCPT ); Mon, 24 Oct 2022 15:14:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0572A7D1CE for ; Mon, 24 Oct 2022 10:52:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CBC4EB8128A for ; Mon, 24 Oct 2022 16:28:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABD71C433D7; Mon, 24 Oct 2022 16:28:36 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="OuR0REi9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666628914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SBGplGN9wXQ6YLKsKfvWr4VPlcYFhGIJKX2SJ5Tbgz0=; b=OuR0REi93gSfWxI2j9p4sviZJruH4d2XvOwVipHS0AEud70IfxjbJv4Ywxb5KHJwn2D/u7 sAvY7pYUeLJXrKoTVt/BiPkEqt8iyonJkVCFj+aXSsmTqCeL9TfK9VYGmYwQxE6CxKYNUX r917dy9emszDy6uLr7I2HUAU/DVsUV4= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id aef9884c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 24 Oct 2022 16:28:33 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" , Dimitri Sivanich , Arnd Bergmann , Greg Kroah-Hartman Subject: [PATCH] misc: sgi-gru: use explicitly signed char Date: Mon, 24 Oct 2022 18:28:23 +0200 Message-Id: <20221024162823.535884-1-Jason@zx2c4.com> MIME-Version: 1.0 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747598074345561557?= X-GMAIL-MSGID: =?utf-8?q?1747598074345561557?= With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: drivers/misc/sgi-gru/grumain.c:711 gru_check_chiplet_assignment() warn: 'gts->ts_user_chiplet_id' is unsigned Cc: Dimitri Sivanich Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld --- drivers/misc/sgi-gru/grumain.c | 6 +++--- drivers/misc/sgi-gru/grutables.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c index 9afda47efbf2..6706ef3c5977 100644 --- a/drivers/misc/sgi-gru/grumain.c +++ b/drivers/misc/sgi-gru/grumain.c @@ -152,7 +152,7 @@ static int gru_assign_asid(struct gru_state *gru) * Optionally, build an array of chars that contain the bit numbers allocated. */ static unsigned long reserve_resources(unsigned long *p, int n, int mmax, - char *idx) + signed char *idx) { unsigned long bits = 0; int i; @@ -170,14 +170,14 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax, } unsigned long gru_reserve_cb_resources(struct gru_state *gru, int cbr_au_count, - char *cbmap) + signed char *cbmap) { return reserve_resources(&gru->gs_cbr_map, cbr_au_count, GRU_CBR_AU, cbmap); } unsigned long gru_reserve_ds_resources(struct gru_state *gru, int dsr_au_count, - char *dsmap) + signed char *dsmap) { return reserve_resources(&gru->gs_dsr_map, dsr_au_count, GRU_DSR_AU, dsmap); diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h index 5efc869fe59a..e467d78fcf64 100644 --- a/drivers/misc/sgi-gru/grutables.h +++ b/drivers/misc/sgi-gru/grutables.h @@ -351,7 +351,7 @@ struct gru_thread_state { pid_t ts_tgid_owner; /* task that is using the context - for migration */ short ts_user_blade_id;/* user selected blade */ - char ts_user_chiplet_id;/* user selected chiplet */ + signed char ts_user_chiplet_id;/* user selected chiplet */ unsigned short ts_sizeavail; /* Pagesizes in use */ int ts_tsid; /* thread that owns the structure */ @@ -364,11 +364,11 @@ struct gru_thread_state { required for contest */ unsigned char ts_cbr_au_count;/* Number of CBR resources required for contest */ - char ts_cch_req_slice;/* CCH packet slice */ - char ts_blade; /* If >= 0, migrate context if + signed char ts_cch_req_slice;/* CCH packet slice */ + signed char ts_blade; /* If >= 0, migrate context if ref from different blade */ - char ts_force_cch_reload; - char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each + signed char ts_force_cch_reload; + signed char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each allocated CB */ int ts_data_valid; /* Indicates if ts_gdata has valid data */