From nobody Mon Apr 27 14:56:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 427C6C433EF for ; Mon, 13 Jun 2022 10:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240685AbiFMKHQ (ORCPT ); Mon, 13 Jun 2022 06:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235024AbiFMKHF (ORCPT ); Mon, 13 Jun 2022 06:07:05 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DB72613 for ; Mon, 13 Jun 2022 03:07:03 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id g7so6421603eda.3 for ; Mon, 13 Jun 2022 03:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UMHcbNV6LUSIBgqPCd8l2C2cXREeSA5BqoEsfTECcso=; b=WVVTwkKXFoycQxD/JGtwpvq6uPsYYmB+gMYPiYWh1Lk5fh297GiaBnPa1wzcCdVyGF K5ksY8tMTyf3B6tizFNdjn44DodSazbQL2z4r0F1NuBk7e7JZaa5fsXncAk/SFRGwNdo LLBaG5nwep51vC78c2oYhPJjH/i4YC1SnIm4yqPAw3/5hpACT8uZi8MSyKKNSibdqsdb MR/3bf56TzVqWsJO7gmPAZQAi/idI/sdvFrIX4PzZrHCypzbiIGrcbMC8KB7H8ikOsjX 2n7zfFASvedhCTdcquDxtF9PIiBKymSX9ra1i8EoUloJK5IpHujbXBguNhAuTwfNbyeo YPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UMHcbNV6LUSIBgqPCd8l2C2cXREeSA5BqoEsfTECcso=; b=XGsuPGE3cSnunqFgP4TO0GLdhdmT+CTg3MiDKGoV2IXtqydx8X6TTwmohxxjsxnzb7 T/q6ahMUCX9iBaAsDiH9kxrnZ+7q3nlqIYCmFyF6tK+hc1Sq5iQZDPNoiLhtI1uYJfzM HrfVYoQQ2Ljg0COMf997vchGI+kIzL1uKEiP6CekASrFCh1/o/1epYJG0nvbSKb4JcWT xltNvBie3OYBly8NqdesPWVsKDeguEKgntC8Q/ZjF8FLngPsCYKAqrCPEMDNbLWILhw1 pSsJ4+aZcUACTksq6eMhJyeIYbgwqNsK2CUdPfzlnKJLfrIJSti+UfUeJLKpZ+e8rAQ9 kZag== X-Gm-Message-State: AOAM533IvkHLf7X1CD5lJ0eUI6nqQYiedbDw03yF4boqLKBhngg4Nv+k 6QtUeHUIfsFRyKXPn3B8vkIJAQ== X-Google-Smtp-Source: ABdhPJyoIrzOPHfwp4rZhmD5TWu+Lu+x8SKHwpznxTUSHOuI/OY6Brs9jnLvGNIwsEayX64+DYJA7w== X-Received: by 2002:a05:6402:2931:b0:42d:df54:c2e6 with SMTP id ee49-20020a056402293100b0042ddf54c2e6mr63768036edb.44.1655114821354; Mon, 13 Jun 2022 03:07:01 -0700 (PDT) Received: from krzk-bin.monzoon.net (80-254-69-65.dynamic.monzoon.net. [80.254.69.65]) by smtp.gmail.com with ESMTPSA id v2-20020a170906858200b006fe921fcb2dsm3639911ejx.49.2022.06.13.03.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 03:07:00 -0700 (PDT) From: Krzysztof Kozlowski To: "James E.J. Bottomley" , "Martin K. Petersen" , Alim Akhtar , Avri Altman , Bart Van Assche , Damien Le Moal , Doug Gilbert , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v3 1/3] scsi: core: fix white-spaces Date: Mon, 13 Jun 2022 12:06:53 +0200 Message-Id: <20220613100655.105301-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> References: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove trailing white-spaces and correct mixed-up indentation. Signed-off-by: Krzysztof Kozlowski --- drivers/scsi/scsi_debug.c | 2 +- drivers/scsi/scsi_priv.h | 4 +-- drivers/scsi/scsi_proc.c | 14 ++++----- drivers/scsi/scsi_scan.c | 10 +++---- drivers/scsi/scsi_sysfs.c | 4 +-- drivers/scsi/scsi_transport_spi.c | 49 +++++++++++++++---------------- drivers/scsi/scsicam.c | 6 ++-- drivers/scsi/sr.c | 8 ++--- include/linux/libata.h | 6 ++-- include/scsi/scsi_cmnd.h | 2 +- include/scsi/scsi_device.h | 10 +++---- include/scsi/scsi_host.h | 13 ++++---- include/scsi/scsi_ioctl.h | 2 +- include/scsi/scsi_transport.h | 2 +- include/scsi/scsi_transport_spi.h | 2 +- include/scsi/scsicam.h | 2 +- include/scsi/sg.h | 2 +- 17 files changed, 68 insertions(+), 70 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 1f423f723d06..5ef54b1f97f9 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1610,7 +1610,7 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct= sdebug_dev_info *devip) u32 len; char lu_id_str[6]; int host_no =3D devip->sdbg_host->shost->host_no; - =09 + port_group_id =3D (((host_no + 1) & 0x7f) << 8) + (devip->channel & 0x7f); if (sdebug_vpd_use_hostno =3D=3D 0) diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 5c4786310a31..8bc7353883ee 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -37,7 +37,7 @@ void scsi_init_command(struct scsi_device *dev, struct sc= si_cmnd *cmd); void scsi_log_send(struct scsi_cmnd *cmd); void scsi_log_completion(struct scsi_cmnd *cmd, int disposition); #else -static inline void scsi_log_send(struct scsi_cmnd *cmd)=20 +static inline void scsi_log_send(struct scsi_cmnd *cmd) { }; static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposit= ion) { }; @@ -183,7 +183,7 @@ struct bsg_device *scsi_bsg_register_queue(struct scsi_= device *sdev); =20 extern int scsi_device_max_queue_depth(struct scsi_device *sdev); =20 -/*=20 +/* * internal scsi timeout functions: for use by mid-layer and transport * classes. */ diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 95aee1ad1383..72548b9e685a 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -4,13 +4,13 @@ * * The functions in this file provide an interface between * the PROC file system and the SCSI device drivers - * It is mainly used for debugging, statistics and to pass=20 + * It is mainly used for debugging, statistics and to pass * information directly to the lowlevel driver. * - * (c) 1995 Michael Neuffer neuffer@goofy.zdv.uni-mainz.de=20 + * (c) 1995 Michael Neuffer neuffer@goofy.zdv.uni-mainz.de * Version: 0.99.8 last change: 95/09/13 - *=20 - * generic command parser provided by:=20 + * + * generic command parser provided by: * Andreas Heilwagen * * generic_proc_info() support of xxxx_info() by: @@ -52,7 +52,7 @@ static ssize_t proc_scsi_host_write(struct file *file, co= nst char __user *buf, struct Scsi_Host *shost =3D pde_data(file_inode(file)); ssize_t ret =3D -ENOMEM; char *page; - =20 + if (count > PROC_BLOCK_SIZE) return -EOVERFLOW; =20 @@ -106,7 +106,7 @@ void scsi_proc_hostdir_add(struct scsi_host_template *s= ht) mutex_lock(&global_host_template_mutex); if (!sht->present++) { sht->proc_dir =3D proc_mkdir(sht->proc_name, proc_scsi); - if (!sht->proc_dir) + if (!sht->proc_dir) printk(KERN_ERR "%s: proc_mkdir failed for %s\n", __func__, sht->proc_name); } @@ -361,7 +361,7 @@ static ssize_t proc_scsi_write(struct file *file, const= char __user *buf, } =20 /* - * convert success returns so that we return the=20 + * convert success returns so that we return the * number of bytes consumed. */ if (!err) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 91ac901a6682..1ffc5e137fdd 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -108,7 +108,7 @@ MODULE_PARM_DESC(scan, "sync, async, manual, or none. " static unsigned int scsi_inq_timeout =3D SCSI_TIMEOUT/HZ + 18; =20 module_param_named(inq_timeout, scsi_inq_timeout, uint, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(inq_timeout,=20 +MODULE_PARM_DESC(inq_timeout, "Timeout (in seconds) waiting for devices to answer INQUIRY." " Default is 20. Some devices may need more; most need less."); =20 @@ -687,7 +687,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, uns= igned char *inq_result, * not-ready to ready transition [asc/ascq=3D0x28/0x0] * or power-on, reset [asc/ascq=3D0x29/0x0], continue. * INQUIRY should not yield UNIT_ATTENTION - * but many buggy devices do so anyway.=20 + * but many buggy devices do so anyway. */ if (scsi_status_is_check_condition(result) && scsi_sense_valid(&sshdr)) { @@ -943,7 +943,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsig= ned char *inq_result, * Don't set the device offline here; rather let the upper * level drivers eval the PQ to decide whether they should * attach. So remove ((inq_result[0] >> 5) & 7) =3D=3D 1 check. - */=20 + */ =20 sdev->inq_periph_qual =3D (inq_result[0] >> 5) & 7; sdev->lockable =3D sdev->removable; @@ -1098,7 +1098,7 @@ static int scsi_add_lun(struct scsi_device *sdev, uns= igned char *inq_result, } =20 #ifdef CONFIG_SCSI_LOGGING -/**=20 +/** * scsi_inq_str - print INQUIRY data from min to max index, strip trailing= whitespace * @buf: Output buffer with at least end-first+1 bytes of space * @inq: Inquiry buffer (input) @@ -1598,7 +1598,7 @@ EXPORT_SYMBOL(__scsi_add_device); int scsi_add_device(struct Scsi_Host *host, uint channel, uint target, u64 lun) { - struct scsi_device *sdev =3D=20 + struct scsi_device *sdev =3D __scsi_add_device(host, channel, target, lun, NULL); if (IS_ERR(sdev)) return PTR_ERR(sdev); diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 43949798a2e4..00334e189f98 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -672,7 +672,7 @@ static int scsi_sdev_check_buf_bit(const char *buf) return 1; else if (buf[0] =3D=3D '0') return 0; - else=20 + else return -EINVAL; } else return -EINVAL; @@ -888,7 +888,7 @@ store_queue_type_field(struct device *dev, struct devic= e_attribute *attr, =20 if (!sdev->tagged_supported) return -EINVAL; - =09 + sdev_printk(KERN_INFO, sdev, "ignoring write to deprecated queue_type attribute"); return count; diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transpor= t_spi.c index bd72c38d7bfc..51d163200f41 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -/*=20 +/* * Parallel SCSI (SPI) transport specific attributes exported to sysfs. * * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. @@ -33,7 +33,7 @@ =20 #define DV_LOOPS 3 #define DV_TIMEOUT (10*HZ) -#define DV_RETRIES 3 /* should only need at most=20 +#define DV_RETRIES 3 /* should only need at most * two cc/ua clears */ =20 /* Our blacklist flags */ @@ -651,7 +651,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 = *buffer, * 0xffff (test b) */ for ( ; j < min(len, k + 32); j +=3D 2) { u16 *word =3D (u16 *)&buffer[j]; - =09 + *word =3D (j & 0x02) ? 0x0000 : 0xffff; } k =3D j; @@ -667,7 +667,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 = *buffer, for ( ; j < min(len, k + 32); j +=3D 4) { u32 *word =3D (unsigned int *)&buffer[j]; u32 roll =3D (pattern & 0x80000000) ? 1 : 0; - =09 + *word =3D pattern; pattern =3D (pattern << 1) | roll; } @@ -724,7 +724,7 @@ spi_dv_device_compare_inquiry(struct scsi_device *sdev,= u8 *buffer, =20 result =3D spi_execute(sdev, spi_inquiry, DMA_FROM_DEVICE, ptr, len, NULL); - =09 + if(result || !scsi_device_online(sdev)) { scsi_device_set_state(sdev, SDEV_QUIESCE); return SPI_COMPARE_FAILURE; @@ -747,12 +747,12 @@ spi_dv_device_compare_inquiry(struct scsi_device *sde= v, u8 *buffer, =20 static enum spi_compare_returns spi_dv_retrain(struct scsi_device *sdev, u8 *buffer, u8 *ptr, - enum spi_compare_returns=20 + enum spi_compare_returns (*compare_fn)(struct scsi_device *, u8 *, u8 *, int)) { struct spi_internal *i =3D to_spi_internal(sdev->host->transportt); struct scsi_target *starget =3D sdev->sdev_target; - int period =3D 0, prevperiod =3D 0;=20 + int period =3D 0, prevperiod =3D 0; enum spi_compare_returns retval; =20 =20 @@ -808,11 +808,11 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sde= v, u8 *buffer) { int l, result; =20 - /* first off do a test unit ready. This can error out=20 + /* first off do a test unit ready. This can error out * because of reservations or some other reason. If it * fails, the device won't let us write to the echo buffer * so just return failure */ -=09 + static const char spi_test_unit_ready[] =3D { TEST_UNIT_READY, 0, 0, 0, 0, 0 }; @@ -821,14 +821,13 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sde= v, u8 *buffer) READ_BUFFER, 0x0b, 0, 0, 0, 0, 0, 0, 4, 0 }; =20 -=09 - /* We send a set of three TURs to clear any outstanding=20 + /* We send a set of three TURs to clear any outstanding * unit attention conditions if they exist (Otherwise the * buffer tests won't be happy). If the TUR still fails * (reservation conflict, device not ready, etc) just * skip the write tests */ for (l =3D 0; ; l++) { - result =3D spi_execute(sdev, spi_test_unit_ready, DMA_NONE,=20 + result =3D spi_execute(sdev, spi_test_unit_ready, DMA_NONE, NULL, 0, NULL); =20 if(result) { @@ -840,7 +839,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev,= u8 *buffer) } } =20 - result =3D spi_execute(sdev, spi_read_buffer_descriptor,=20 + result =3D spi_execute(sdev, spi_read_buffer_descriptor, DMA_FROM_DEVICE, buffer, 4, NULL); =20 if (result) @@ -1222,7 +1221,7 @@ EXPORT_SYMBOL_GPL(spi_populate_ppr_msg); * @cmd: pointer to the scsi command for the tag * * Notes: - * designed to create the correct type of tag message for the=20 + * designed to create the correct type of tag message for the * particular request. Returns the size of the tag message. * May return 0 if TCQ is disabled for this device. **/ @@ -1231,7 +1230,7 @@ int spi_populate_tag_msg(unsigned char *msg, struct s= csi_cmnd *cmd) if (cmd->flags & SCMD_TAGGED) { *msg++ =3D SIMPLE_QUEUE_TAG; *msg++ =3D scsi_cmd_to_rq(cmd)->tag; - return 2; + return 2; } =20 return 0; @@ -1241,10 +1240,10 @@ EXPORT_SYMBOL_GPL(spi_populate_tag_msg); #ifdef CONFIG_SCSI_CONSTANTS static const char * const one_byte_msgs[] =3D { /* 0x00 */ "Task Complete", NULL /* Extended Message */, "Save Pointers", -/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error",=20 +/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", /* 0x06 */ "Abort Task Set", "Message Reject", "Nop", "Message Parity Erro= r", /* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag", -/* 0x0c */ "Target Reset", "Abort Task", "Clear Task Set",=20 +/* 0x0c */ "Target Reset", "Abort Task", "Clear Task Set", /* 0x0f */ "Initiate Recovery", "Release Recovery", /* 0x11 */ "Terminate Process", "Continue Task", "Target Transfer Disable", /* 0x14 */ NULL, NULL, "Clear ACA", "LUN Reset" @@ -1290,8 +1289,8 @@ int spi_print_msg(const unsigned char *msg) if (len =3D=3D 2) len +=3D 256; if (msg[2] < ARRAY_SIZE(extended_msgs)) - printk ("%s ", extended_msgs[msg[2]]);=20 - else=20 + printk ("%s ", extended_msgs[msg[2]]); + else printk ("Extended Message, reserved code (0x%02x) ", (int) msg[2]); switch (msg[2]) { @@ -1312,7 +1311,7 @@ int spi_print_msg(const unsigned char *msg) print_ptr(msg, 7, "in"); break; default: - for (i =3D 2; i < len; ++i)=20 + for (i =3D 2; i < len; ++i) printk("%02x ", msg[i]); } /* Identify */ @@ -1332,13 +1331,13 @@ int spi_print_msg(const unsigned char *msg) /* Two byte */ } else if (msg[0] <=3D 0x2f) { if ((msg[0] - 0x20) < ARRAY_SIZE(two_byte_msgs)) - printk("%s %02x ", two_byte_msgs[msg[0] - 0x20],=20 + printk("%s %02x ", two_byte_msgs[msg[0] - 0x20], msg[1]); - else=20 - printk("reserved two byte (%02x %02x) ",=20 + else + printk("reserved two byte (%02x %02x) ", msg[0], msg[1]); len =3D 2; - } else=20 + } else printk("reserved "); return len; } @@ -1366,7 +1365,7 @@ int spi_print_msg(const unsigned char *msg) } else if (msg[0] <=3D 0x2f) { printk("%02x %02x", msg[0], msg[1]); len =3D 2; - } else=20 + } else printk("%02x ", msg[0]); return len; } diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index e2c7d8ef205f..a30b0a3fe68f 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c @@ -3,7 +3,7 @@ * scsicam.c - SCSI CAM support functions, use for HDIO_GETGEO, etc. * * Copyright 1993, 1994 Drew Eckhardt - * Visionary Computing=20 + * Visionary Computing * (Unix and Linux consulting and custom programming) * drew@Colorado.EDU * +1 (303) 786-7975 @@ -159,7 +159,7 @@ EXPORT_SYMBOL(scsi_partsize); * Information technology - * SCSI-2 Common access method * transport and SCSI interface module - *=20 + * * ANNEX A : * * setsize() converts a read capacity value to int 13h @@ -169,7 +169,7 @@ EXPORT_SYMBOL(scsi_partsize); * will not fit in 4 bits (or 6 bits). This algorithm also * minimizes the number of sectors that will be unused at the end * of the disk while allowing for very large disks to be - * accommodated. This algorithm does not use physical geometry.=20 + * accommodated. This algorithm does not use physical geometry. */ =20 static int setsize(unsigned long capacity, unsigned int *cyls, unsigned in= t *hds, diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 32d3b8274f14..2b6d08ab61fa 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -94,7 +94,7 @@ static const struct dev_pm_ops sr_pm_ops =3D { =20 static struct scsi_driver sr_template =3D { .gendrv =3D { - .name =3D "sr", + .name =3D "sr", .owner =3D THIS_MODULE, .probe =3D sr_probe, .remove =3D sr_remove, @@ -123,8 +123,8 @@ static int sr_read_cdda_bpc(struct cdrom_device_info *c= di, void __user *ubuf, =20 static const struct cdrom_device_ops sr_dops =3D { .open =3D sr_open, - .release =3D sr_release, - .drive_status =3D sr_drive_status, + .release =3D sr_release, + .drive_status =3D sr_drive_status, .check_events =3D sr_check_events, .tray_move =3D sr_tray_move, .lock_door =3D sr_lock_door, @@ -600,7 +600,7 @@ static int sr_open(struct cdrom_device_info *cdi, int p= urpose) return 0; =20 error_out: - return retval;=09 + return retval; } =20 static void sr_release(struct cdrom_device_info *cdi) diff --git a/include/linux/libata.h b/include/linux/libata.h index 732de9014626..3d9317aedf85 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -564,7 +564,7 @@ struct ata_ioports { =20 struct ata_host { spinlock_t lock; - struct device *dev; + struct device *dev; void __iomem * const *iomap; unsigned int n_ports; unsigned int n_tags; /* nr of NCQ tags */ @@ -833,7 +833,7 @@ struct ata_port { =20 struct ata_port_stats stats; struct ata_host *host; - struct device *dev; + struct device *dev; struct device tdev; =20 struct mutex scsi_scan_mutex; @@ -986,7 +986,7 @@ struct ata_port_info { unsigned long mwdma_mask; unsigned long udma_mask; struct ata_port_operations *port_ops; - void *private_data; + void *private_data; }; =20 struct ata_timing { diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 1e80e70dfa92..410a2ceefc52 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -105,7 +105,7 @@ struct scsi_cmnd { =20 unsigned transfersize; /* How much we are guaranteed to transfer with each SCSI transfer - (ie, between disconnect /=20 + (ie, between disconnect / reconnects. Probably =3D=3D sector size */ unsigned resid_len; /* residual count */ diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 7cf5f3b7589f..1fb790ef9b96 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -42,7 +42,7 @@ enum scsi_device_state { * All commands allowed */ SDEV_CANCEL, /* beginning to delete device * Only error handler commands allowed */ - SDEV_DEL, /* device deleted=20 + SDEV_DEL, /* device deleted * no commands allowed */ SDEV_QUIESCE, /* Device quiescent. No block commands * will be accepted, only specials (which @@ -130,14 +130,14 @@ struct scsi_device { =20 unsigned int id, channel; u64 lun; - unsigned int manufacturer; /* Manufacturer of device, for using=20 + unsigned int manufacturer; /* Manufacturer of device, for using * vendor-specific cmd's */ unsigned sector_size; /* size in bytes */ =20 void *hostdata; /* available to low-level driver */ unsigned char type; char scsi_level; - char inq_periph_qual; /* PQ from INQUIRY data */=09 + char inq_periph_qual; /* PQ from INQUIRY data */ struct mutex inquiry_mutex; unsigned char inquiry_len; /* valid bytes in 'inquiry' */ unsigned char * inquiry; /* INQUIRY response data */ @@ -165,7 +165,7 @@ struct scsi_device { unsigned busy:1; /* Used to prevent races */ unsigned lockable:1; /* Able to prevent media removal */ unsigned locked:1; /* Media removal disabled */ - unsigned borken:1; /* Tell the Seagate driver to be=20 + unsigned borken:1; /* Tell the Seagate driver to be * painfully slow on this device */ unsigned disconnect:1; /* can disconnect */ unsigned soft_reset:1; /* Uses soft reset option */ @@ -174,7 +174,7 @@ struct scsi_device { unsigned ppr:1; /* Device supports PPR messages */ unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */ unsigned simple_tags:1; /* simple queue tag messages are enabled */ - unsigned was_reset:1; /* There was a bus reset on the bus for=20 + unsigned was_reset:1; /* There was a bus reset on the bus for * this device */ unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN * because we did a bus reset. */ diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 667d889b92b5..44ff28d8fd0d 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -178,7 +178,7 @@ struct scsi_host_template { * this function, it *must* perform the task of setting the queue * depth on the device. All other tasks are optional and depend * on what the driver supports and various implementation details. - *=20 + * * Things currently recommended to be handled at this time include: * * 1. Setting the device queue depth. Proper setting of this is @@ -207,7 +207,7 @@ struct scsi_host_template { * has ceased the mid layer calls this point so that the low level * driver may completely detach itself from the scsi device and vice * versa. The low level driver is responsible for freeing any memory - * it allocated in the slave_alloc or slave_configure calls.=20 + * it allocated in the slave_alloc or slave_configure calls. * * Status: OPTIONAL */ @@ -466,7 +466,7 @@ struct scsi_host_template { /* * Default value for the blocking. If the queue is empty, * host_blocked counts down in the request_fn until it restarts - * host operations as zero is reached. =20 + * host operations as zero is reached. * * FIXME: This should probably be a value in the template */ @@ -540,7 +540,7 @@ struct Scsi_Host { */ struct list_head __devices; struct list_head __targets; -=09 + struct list_head starved_list; =20 spinlock_t default_lock; @@ -565,7 +565,7 @@ struct Scsi_Host { unsigned int host_failed; /* commands that failed. protected by host_lock */ unsigned int host_eh_scheduled; /* EH scheduled without command */ - =20 + unsigned int host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ =20 /* next two fields are used to bound the time spent in error handling */ @@ -627,7 +627,7 @@ struct Scsi_Host { * time being. */ unsigned host_self_blocked:1; - =20 + /* * Host uses correct SCSI ordering not PC ordering. The bit is * set for the minority of drivers whose authors actually read @@ -682,7 +682,6 @@ struct Scsi_Host { unsigned char n_io_port; unsigned char dma_channel; unsigned int irq; -=09 =20 enum scsi_host_state shost_state; =20 diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h index beac64e38b87..c3ab331c809b 100644 --- a/include/scsi/scsi_ioctl.h +++ b/include/scsi/scsi_ioctl.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _SCSI_IOCTL_H -#define _SCSI_IOCTL_H=20 +#define _SCSI_IOCTL_H =20 #define SCSI_IOCTL_SEND_COMMAND 1 #define SCSI_IOCTL_TEST_UNIT_READY 2 diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index a0458bda3148..1a7b92f8b423 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -/*=20 +/* * Transport specific attributes. * * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transpor= t_spi.h index 78324502b1c9..d967bc6f1836 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -/*=20 +/* * Parallel SCSI (SPI) transport specific attributes exported to sysfs. * * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. diff --git a/include/scsi/scsicam.h b/include/scsi/scsicam.h index 08edd603e521..3a37512c06ec 100644 --- a/include/scsi/scsicam.h +++ b/include/scsi/scsicam.h @@ -3,7 +3,7 @@ * scsicam.h - SCSI CAM support functions, use for HDIO_GETGEO, etc. * * Copyright 1993, 1994 Drew Eckhardt - * Visionary Computing=20 + * Visionary Computing * (Unix and Linux consulting and custom programming) * drew@Colorado.EDU * +1 (303) 786-7975 diff --git a/include/scsi/sg.h b/include/scsi/sg.h index 068e35d36557..e16160b5b407 100644 --- a/include/scsi/sg.h +++ b/include/scsi/sg.h @@ -244,7 +244,7 @@ typedef struct sg_req_info { /* used by SG_GET_REQUEST_= TABLE ioctl() */ #define SG_GET_KEEP_ORPHAN 0x2288 =20 /* yields scsi midlevel's access_count for this SCSI device */ -#define SG_GET_ACCESS_COUNT 0x2289 =20 +#define SG_GET_ACCESS_COUNT 0x2289 =20 =20 #define SG_SCATTER_SZ (8 * 4096) --=20 2.34.1 From nobody Mon Apr 27 14:56:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58927CCA47C for ; Mon, 13 Jun 2022 10:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240822AbiFMKHV (ORCPT ); Mon, 13 Jun 2022 06:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235807AbiFMKHF (ORCPT ); Mon, 13 Jun 2022 06:07:05 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19BC725FC for ; Mon, 13 Jun 2022 03:07:04 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id u12so10137704eja.8 for ; Mon, 13 Jun 2022 03:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZGEshUVR72se0cly2sjnnLyILAX1UOXEx9LJVGIAmRA=; b=jwgEfOivK6xbWY9rmeyxxzqERA4hxbJmU7zY8cqXCuPBK6ptEsHPI7FxquijIHvMTO Yhmpvr/RhQV30q9xRySOditrPS9+hKmlwMZEnB3BRtnfcgvczaiELl1okDAszPIx3oXe RPAX4m9CXaoHGjPRC3T+ngwv67GhdsK0+nEm+MPrMoKyZLrjo8YiUT1aZmxr0lFed7WZ VonynU5csyqJAYCONWsoFVc0t7eNpHZ7JnG67OGaOuufsM3xuDbL0CJSCBUHh7PYy8RX cpyumM4tQSXsXCETFTVbcnxePjkAe9ZUoX11IXkcDEE0Zn2SyOs53v1p9IaAK/3SgN+f boGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZGEshUVR72se0cly2sjnnLyILAX1UOXEx9LJVGIAmRA=; b=dOUdz1qHN1kjxxUSqlvudXlaISjFOKnM5zrL5jv5SaFTkBX0kP0VGRXWPB0U5wJkZN F+MGBvyLJ83aRfJvZnz8OigNr6zb+txLTR3FJbbG6Ihgk5jzAnwRB2DN8dYAl2vw0PhB 8jqimDtKiMlngtY+alKnm4jjlnbhGVwl2BNKs04u62f1nazuBm2sFeeSoNu9UCBzTlFn Zi+IUKhXJCDVNryYHdY1ajqZO7Yx4Un7SAv850suJ6zp72iasw64I0uzgfhiAiYWoeno TKktbyg5EcOaZ01gejOj3fDqV5nwshyLGAO4kw2bZrYPCZtEJjrhWiMtiFXz3UsN5tI5 YybA== X-Gm-Message-State: AOAM5322hTC6mChDqnmuKeuUbjBRdY1gFYaUu1wuGx33olHUATFQpf1N kVAeigb+VyVgw80SzrhdYH9XRQ== X-Google-Smtp-Source: ABdhPJy1hl/o2TfsysynVpPKCaGGb0ZFi6E0t4i1npezDW4+GAs2tyVdYaAjzownmGggCWQf116zPA== X-Received: by 2002:a17:906:180c:b0:6fe:9a3e:3d5b with SMTP id v12-20020a170906180c00b006fe9a3e3d5bmr52108425eje.202.1655114822640; Mon, 13 Jun 2022 03:07:02 -0700 (PDT) Received: from krzk-bin.monzoon.net (80-254-69-65.dynamic.monzoon.net. [80.254.69.65]) by smtp.gmail.com with ESMTPSA id v2-20020a170906858200b006fe921fcb2dsm3639911ejx.49.2022.06.13.03.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 03:07:02 -0700 (PDT) From: Krzysztof Kozlowski To: "James E.J. Bottomley" , "Martin K. Petersen" , Alim Akhtar , Avri Altman , Bart Van Assche , Damien Le Moal , Doug Gilbert , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v3 2/3] scsi: ufs: ufshcd-pltfrm: constify pointed data Date: Mon, 13 Jun 2022 12:06:54 +0200 Message-Id: <20220613100655.105301-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> References: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Constify pointers to data which is not modified for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bart Van Assche --- drivers/ufs/host/ufshcd-pltfrm.c | 10 +++++----- drivers/ufs/host/ufshcd-pltfrm.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-plt= frm.c index e7332cc65b1f..e0b7c02092cc 100644 --- a/drivers/ufs/host/ufshcd-pltfrm.c +++ b/drivers/ufs/host/ufshcd-pltfrm.c @@ -26,7 +26,7 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) int i; struct device *dev =3D hba->dev; struct device_node *np =3D dev->of_node; - char *name; + const char *name; u32 *clkfreq =3D NULL; struct ufs_clk_info *clki; int len =3D 0; @@ -79,8 +79,8 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) } =20 for (i =3D 0; i < sz; i +=3D 2) { - ret =3D of_property_read_string_index(np, - "clock-names", i/2, (const char **)&name); + ret =3D of_property_read_string_index(np, "clock-names", i/2, + &name); if (ret) goto out; =20 @@ -208,8 +208,8 @@ static void ufshcd_init_lanes_per_dir(struct ufs_hba *h= ba) * * Returns 0 on success, non-zero value on failure */ -int ufshcd_get_pwr_dev_param(struct ufs_dev_params *pltfrm_param, - struct ufs_pa_layer_attr *dev_max, +int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *pltfrm_param, + const struct ufs_pa_layer_attr *dev_max, struct ufs_pa_layer_attr *agreed_pwr) { int min_pltfrm_gear; diff --git a/drivers/ufs/host/ufshcd-pltfrm.h b/drivers/ufs/host/ufshcd-plt= frm.h index 43c2e412bd99..fead72998dca 100644 --- a/drivers/ufs/host/ufshcd-pltfrm.h +++ b/drivers/ufs/host/ufshcd-pltfrm.h @@ -25,8 +25,8 @@ struct ufs_dev_params { u32 desired_working_mode; }; =20 -int ufshcd_get_pwr_dev_param(struct ufs_dev_params *dev_param, - struct ufs_pa_layer_attr *dev_max, +int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *dev_param, + const struct ufs_pa_layer_attr *dev_max, struct ufs_pa_layer_attr *agreed_pwr); void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param); int ufshcd_pltfrm_init(struct platform_device *pdev, --=20 2.34.1 From nobody Mon Apr 27 14:56:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9298CC433EF for ; Mon, 13 Jun 2022 10:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240357AbiFMKH2 (ORCPT ); Mon, 13 Jun 2022 06:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbiFMKHH (ORCPT ); Mon, 13 Jun 2022 06:07:07 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD3FF1139 for ; Mon, 13 Jun 2022 03:07:05 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id fu3so10156631ejc.7 for ; Mon, 13 Jun 2022 03:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nyX3Q3rQQM2IsC6FFrgRDtgxd8UP6+kxf/OJYst5UXA=; b=nyCWPHxIGKa2NB5OHYiSyem5xuy6+kXjlO9RrgVfZL+LLd23RIjjmQX66HJL8NIYmH qF2KKYqmXcquxwaqa14kZEhuU/AaqSJiy/z5rb1RcyDAu9jjVpXzvPZCA6tOSo7nzd6y UhKXG4bt+S6iTSMIkTYRQ228IQ5XsdvJkJ/xWrmupMtG4+0+seyCR98xMpyNx9/OXGW/ Em9fccEdZ+yDexaflRVSWUZ4Y+OYecjtThEhqA1qoBsoKKIh01Gn+hqLqVAV0jJmUrEr LtltEO0pyw5S5J5cyDrPoZRpsB3XFScAYuQbtIMHlW2mXtffInZPtxQwQNKVZFK5YAmI xonQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nyX3Q3rQQM2IsC6FFrgRDtgxd8UP6+kxf/OJYst5UXA=; b=w29CsOS8LI17MdSWCFiN3kh8UJQmz1PEeHCH8gSsCNYQRMdNpEWGQzTIotrRw130+4 RZJ7J/2e5mUm6r6JlVMSd/xpx9zLviyr3A0TViMOIaI2/xSFrWjRS42ewHALpitWL1ub 3HMjeXaCBwJEFgn9qcvv1hEHSbqMjwikNfr8TungwUfdAIFKCYOJUjVs+C77tm+55m3k ktxzgW0iETz4Avw54C3J/6W6kAzb8dxdbQLZqsUuO8rWt3E+RSWQ8D5JWUMWRRsw9XNi AylUoov/YDR4MKXicEg66fFev5iqIhgpHEPKL4IWz3CDX8qYcbX+w+TRG1U7jSEVBsNF D+8Q== X-Gm-Message-State: AOAM531zMn2aT+0ysp0ldusZhiB12BvXoBbZ8IqdU1/1egJ3w9/XEN7D R+/hnZz9+tIwVaK84C0WSKYklw== X-Google-Smtp-Source: ABdhPJzWkcnRCWVe/fTvWG3tCIJR5yjLJBH55iEtG+cyP0Xrqj/+5gHFUwbKjtBy0csgJHIUqA2EDA== X-Received: by 2002:a17:907:1250:b0:711:d0bc:2370 with SMTP id wc16-20020a170907125000b00711d0bc2370mr34681686ejb.454.1655114824203; Mon, 13 Jun 2022 03:07:04 -0700 (PDT) Received: from krzk-bin.monzoon.net (80-254-69-65.dynamic.monzoon.net. [80.254.69.65]) by smtp.gmail.com with ESMTPSA id v2-20020a170906858200b006fe921fcb2dsm3639911ejx.49.2022.06.13.03.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 03:07:03 -0700 (PDT) From: Krzysztof Kozlowski To: "James E.J. Bottomley" , "Martin K. Petersen" , Alim Akhtar , Avri Altman , Bart Van Assche , Damien Le Moal , Doug Gilbert , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v3 3/3] scsi: ufs: ufshcd: constify pointed data Date: Mon, 13 Jun 2022 12:06:55 +0200 Message-Id: <20220613100655.105301-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> References: <20220613100655.105301-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Constify arrays and pointers to data which is not modified for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd-priv.h | 6 ++--- drivers/ufs/core/ufshcd.c | 42 ++++++++++++++++++---------------- include/ufs/ufshcd.h | 6 ++--- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h index ffb01fc6de75..8f67db202d7b 100644 --- a/drivers/ufs/core/ufshcd-priv.h +++ b/drivers/ufs/core/ufshcd-priv.h @@ -215,7 +215,7 @@ static inline void ufshcd_vops_config_scaling_param(str= uct ufs_hba *hba, hba->vops->config_scaling_param(hba, p, data); } =20 -extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; +extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[]; =20 /** * ufshcd_scsi_to_upiu_lun - maps scsi LUN to UPIU LUN @@ -234,8 +234,8 @@ static inline u8 ufshcd_scsi_to_upiu_lun(unsigned int s= csi_lun) =20 int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask); int ufshcd_write_ee_control(struct ufs_hba *hba); -int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, u16 *other_ma= sk, - u16 set, u16 clr); +int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, + const u16 *other_mask, u16 set, u16 clr); =20 static inline int ufshcd_update_ee_drv_mask(struct ufs_hba *hba, u16 set, u16 clr) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 01fb4bad86be..59f73d67a673 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -175,7 +175,7 @@ enum { #define ufshcd_clear_eh_in_progress(h) \ ((h)->eh_flags &=3D ~UFSHCD_EH_IN_PROGRESS) =20 -struct ufs_pm_lvl_states ufs_pm_lvl_states[] =3D { +const struct ufs_pm_lvl_states ufs_pm_lvl_states[] =3D { [UFS_PM_LVL_0] =3D {UFS_ACTIVE_PWR_MODE, UIC_LINK_ACTIVE_STATE}, [UFS_PM_LVL_1] =3D {UFS_ACTIVE_PWR_MODE, UIC_LINK_HIBERN8_STATE}, [UFS_PM_LVL_2] =3D {UFS_SLEEP_PWR_MODE, UIC_LINK_ACTIVE_STATE}, @@ -363,7 +363,7 @@ static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hb= a, unsigned int tag, } =20 static void ufshcd_add_uic_command_trace(struct ufs_hba *hba, - struct uic_command *ucmd, + const struct uic_command *ucmd, enum ufs_trace_str_t str_t) { u32 cmd; @@ -443,11 +443,11 @@ static void ufshcd_print_clk_freqs(struct ufs_hba *hb= a) } =20 static void ufshcd_print_evt(struct ufs_hba *hba, u32 id, - char *err_name) + const char *err_name) { int i; bool found =3D false; - struct ufs_event_hist *e; + const struct ufs_event_hist *e; =20 if (id >=3D UFS_EVT_CNT) return; @@ -497,7 +497,7 @@ static void ufshcd_print_evt_hist(struct ufs_hba *hba) static void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_p= rdt) { - struct ufshcd_lrb *lrbp; + const struct ufshcd_lrb *lrbp; int prdt_length; int tag; =20 @@ -553,7 +553,7 @@ static void ufshcd_print_tmrs(struct ufs_hba *hba, unsi= gned long bitmap) =20 static void ufshcd_print_host_state(struct ufs_hba *hba) { - struct scsi_device *sdev_ufs =3D hba->ufs_device_wlun; + const struct scsi_device *sdev_ufs =3D hba->ufs_device_wlun; =20 dev_err(hba->dev, "UFS Host state=3D%d\n", hba->ufshcd_state); dev_err(hba->dev, "outstanding reqs=3D0x%lx tasks=3D0x%lx\n", @@ -1098,7 +1098,7 @@ static bool ufshcd_is_devfreq_scaling_required(struct= ufs_hba *hba, */ static u32 ufshcd_pending_cmds(struct ufs_hba *hba) { - struct scsi_device *sdev; + const struct scsi_device *sdev; u32 pending =3D 0; =20 lockdep_assert_held(hba->host->host_lock); @@ -2069,14 +2069,15 @@ static inline int ufshcd_monitor_opcode2dir(u8 opco= de) static inline bool ufshcd_should_inform_monitor(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) { - struct ufs_hba_monitor *m =3D &hba->monitor; + const struct ufs_hba_monitor *m =3D &hba->monitor; =20 return (m->enabled && lrbp && lrbp->cmd && (!m->chunk_size || m->chunk_size =3D=3D lrbp->cmd->sdb.length) && ktime_before(hba->monitor.enabled_ts, lrbp->issue_time_stamp)); } =20 -static void ufshcd_start_monitor(struct ufs_hba *hba, struct ufshcd_lrb *l= rbp) +static void ufshcd_start_monitor(struct ufs_hba *hba, + const struct ufshcd_lrb *lrbp) { int dir =3D ufshcd_monitor_opcode2dir(*lrbp->cmd->cmnd); unsigned long flags; @@ -2087,14 +2088,14 @@ static void ufshcd_start_monitor(struct ufs_hba *hb= a, struct ufshcd_lrb *lrbp) spin_unlock_irqrestore(hba->host->host_lock, flags); } =20 -static void ufshcd_update_monitor(struct ufs_hba *hba, struct ufshcd_lrb *= lrbp) +static void ufshcd_update_monitor(struct ufs_hba *hba, const struct ufshcd= _lrb *lrbp) { int dir =3D ufshcd_monitor_opcode2dir(*lrbp->cmd->cmnd); unsigned long flags; =20 spin_lock_irqsave(hba->host->host_lock, flags); if (dir >=3D 0 && hba->monitor.nr_queued[dir] > 0) { - struct request *req =3D scsi_cmd_to_rq(lrbp->cmd); + const struct request *req =3D scsi_cmd_to_rq(lrbp->cmd); struct ufs_hba_monitor *m =3D &hba->monitor; ktime_t now, inc, lat; =20 @@ -4899,7 +4900,7 @@ static int ufshcd_get_lu_wp(struct ufs_hba *hba, * */ static inline void ufshcd_get_lu_power_on_wp_status(struct ufs_hba *hba, - struct scsi_device *sdev) + const struct scsi_device *sdev) { if (hba->dev_info.f_power_on_wp_en && !hba->dev_info.is_lu_power_on_wp) { @@ -5418,8 +5419,8 @@ int ufshcd_write_ee_control(struct ufs_hba *hba) return err; } =20 -int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, u16 *other_ma= sk, - u16 set, u16 clr) +int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, + const u16 *other_mask, u16 set, u16 clr) { u16 new_mask, ee_ctrl_mask; int err =3D 0; @@ -7346,7 +7347,8 @@ static int ufshcd_eh_host_reset_handler(struct scsi_c= mnd *cmd) * * Returns calculated max ICC level for specific regulator */ -static u32 ufshcd_get_max_icc_level(int sup_curr_uA, u32 start_scan, char = *buff) +static u32 ufshcd_get_max_icc_level(int sup_curr_uA, u32 start_scan, + const char *buff) { int i; int curr_uA; @@ -7393,7 +7395,7 @@ static u32 ufshcd_get_max_icc_level(int sup_curr_uA, = u32 start_scan, char *buff) * Returns calculated ICC level */ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba, - u8 *desc_buf, int len) + const u8 *desc_buf, int len) { u32 icc_level =3D 0; =20 @@ -7543,7 +7545,7 @@ static int ufshcd_scsi_add_wlus(struct ufs_hba *hba) return ret; } =20 -static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf) +static void ufshcd_wb_probe(struct ufs_hba *hba, const u8 *desc_buf) { struct ufs_dev_info *dev_info =3D &hba->dev_info; u8 lun; @@ -7614,7 +7616,7 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *= desc_buf) hba->caps &=3D ~UFSHCD_CAP_WB_EN; } =20 -static void ufshcd_temp_notif_probe(struct ufs_hba *hba, u8 *desc_buf) +static void ufshcd_temp_notif_probe(struct ufs_hba *hba, const u8 *desc_bu= f) { struct ufs_dev_info *dev_info =3D &hba->dev_info; u32 ext_ufs_feature; @@ -7848,7 +7850,7 @@ static int ufshcd_quirk_tune_host_pa_tactivate(struct= ufs_hba *hba) u32 granularity, peer_granularity; u32 pa_tactivate, peer_pa_tactivate; u32 pa_tactivate_us, peer_pa_tactivate_us; - u8 gran_to_us_table[] =3D {1, 4, 8, 16, 32, 100}; + const u8 gran_to_us_table[] =3D {1, 4, 8, 16, 32, 100}; =20 ret =3D ufshcd_dme_get(hba, UIC_ARG_MIB(PA_GRANULARITY), &granularity); @@ -7965,7 +7967,7 @@ struct ufs_ref_clk { enum ufs_ref_clk_freq val; }; =20 -static struct ufs_ref_clk ufs_ref_clk_freqs[] =3D { +static const struct ufs_ref_clk ufs_ref_clk_freqs[] =3D { {19200000, REF_CLK_FREQ_19_2_MHZ}, {26000000, REF_CLK_FREQ_26_MHZ}, {38400000, REF_CLK_FREQ_38_4_MHZ}, diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index a92271421718..4f0531af9141 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1217,14 +1217,14 @@ static inline int ufshcd_vops_phy_initialization(st= ruct ufs_hba *hba) return 0; } =20 -extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; +extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[]; =20 int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len, const char *prefix); =20 int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask); int ufshcd_write_ee_control(struct ufs_hba *hba); -int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, u16 *other_ma= sk, - u16 set, u16 clr); +int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask, + const u16 *other_mask, u16 set, u16 clr); =20 #endif /* End of Header */ --=20 2.34.1