Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253993
b: refs/heads/master
c: d698a34
h: refs/heads/master
i:
  253991: 508d4a9
v: v3
  • Loading branch information
Alex Deucher authored and Dave Airlie committed Jun 24, 2011
1 parent 33c7045 commit 599dbdb
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 115 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a1f7b3d68174f99d01d52b585088b2eaee758a6
refs/heads/master: d698a34da7c5626c3c16a6311c6290522e902e7f
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static bool resource_contains(struct resource *res, resource_size_t point)
return false;
}

static void coalesce_windows(struct pci_root_info *info, unsigned long type)
static void coalesce_windows(struct pci_root_info *info, int type)
{
int i, j;
struct resource *res1, *res2;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2013,9 +2013,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
rdev->config.evergreen.tile_config |= (3 << 0);
break;
}
/* num banks is 8 on all fusion asics */
/* num banks is 8 on all fusion asics. 0 = 4, 1 = 8, 2 = 16 */
if (rdev->flags & RADEON_IS_IGP)
rdev->config.evergreen.tile_config |= 8 << 4;
rdev->config.evergreen.tile_config |= 1 << 4;
else
rdev->config.evergreen.tile_config |=
((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3284,7 +3284,7 @@ static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
* @dev: the PCI device
* @decode: true = enable decoding, false = disable decoding
* @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY
* @flags: traverse ancestors and change bridges
* @change_bridge_flags: traverse ancestors and change bridges
* CHANGE_BRIDGE_ONLY / CHANGE_BRIDGE
*/
int pci_set_vga_state(struct pci_dev *dev, bool decode,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags |= pci_calc_resource_flags(l) | IORESOURCE_SIZEALIGN;
if (type == pci_bar_io) {
l &= PCI_BASE_ADDRESS_IO_MASK;
mask = PCI_BASE_ADDRESS_IO_MASK & (u32) IO_SPACE_LIMIT;
mask = PCI_BASE_ADDRESS_IO_MASK & IO_SPACE_LIMIT;
} else {
l &= PCI_BASE_ADDRESS_MEM_MASK;
mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/target/loopback/tcm_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
*/
se_cmd->se_tmr_req = core_tmr_alloc_req(se_cmd, (void *)tl_tmr,
TMR_LUN_RESET);
if (IS_ERR(se_cmd->se_tmr_req))
if (!se_cmd->se_tmr_req)
goto release;
/*
* Locate the underlying TCM struct se_lun from sc->device->lun
Expand Down Expand Up @@ -1017,7 +1017,6 @@ static int tcm_loop_make_nexus(
struct se_portal_group *se_tpg;
struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
struct tcm_loop_nexus *tl_nexus;
int ret = -ENOMEM;

if (tl_tpg->tl_hba->tl_nexus) {
printk(KERN_INFO "tl_tpg->tl_hba->tl_nexus already exists\n");
Expand All @@ -1034,10 +1033,8 @@ static int tcm_loop_make_nexus(
* Initialize the struct se_session pointer
*/
tl_nexus->se_sess = transport_init_session();
if (IS_ERR(tl_nexus->se_sess)) {
ret = PTR_ERR(tl_nexus->se_sess);
if (!tl_nexus->se_sess)
goto out;
}
/*
* Since we are running in 'demo mode' this call with generate a
* struct se_node_acl for the tcm_loop struct se_portal_group with the SCSI
Expand All @@ -1063,7 +1060,7 @@ static int tcm_loop_make_nexus(

out:
kfree(tl_nexus);
return ret;
return -ENOMEM;
}

static int tcm_loop_drop_nexus(
Expand Down Expand Up @@ -1143,7 +1140,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
* the fabric protocol_id set in tcm_loop_make_scsi_hba(), and call
* tcm_loop_make_nexus()
*/
if (strlen(page) >= TL_WWN_ADDR_LEN) {
if (strlen(page) > TL_WWN_ADDR_LEN) {
printk(KERN_ERR "Emulated NAA Sas Address: %s, exceeds"
" max: %d\n", page, TL_WWN_ADDR_LEN);
return -EINVAL;
Expand Down Expand Up @@ -1324,7 +1321,7 @@ struct se_wwn *tcm_loop_make_scsi_hba(
return ERR_PTR(-EINVAL);

check_len:
if (strlen(name) >= TL_WWN_ADDR_LEN) {
if (strlen(name) > TL_WWN_ADDR_LEN) {
printk(KERN_ERR "Emulated NAA %s Address: %s, exceeds"
" max: %d\n", name, tcm_loop_dump_proto_id(tl_hba),
TL_WWN_ADDR_LEN);
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/target/target_core_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ struct target_fabric_configfs *target_fabric_configfs_init(
printk(KERN_ERR "Unable to locate passed fabric name\n");
return NULL;
}
if (strlen(name) >= TARGET_FABRIC_NAME_SIZE) {
if (strlen(name) > TARGET_FABRIC_NAME_SIZE) {
printk(KERN_ERR "Passed name: %s exceeds TARGET_FABRIC"
"_NAME_SIZE\n", name);
return NULL;
}

tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL);
if (!(tf))
return NULL;
return ERR_PTR(-ENOMEM);

INIT_LIST_HEAD(&tf->tf_list);
atomic_set(&tf->tf_access_cnt, 0);
Expand Down Expand Up @@ -851,7 +851,7 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
return -EOPNOTSUPP;
}

if (strlen(page) >= INQUIRY_VPD_SERIAL_LEN) {
if ((strlen(page) + 1) > INQUIRY_VPD_SERIAL_LEN) {
printk(KERN_ERR "Emulated VPD Unit Serial exceeds"
" INQUIRY_VPD_SERIAL_LEN: %d\n", INQUIRY_VPD_SERIAL_LEN);
return -EOVERFLOW;
Expand Down Expand Up @@ -917,7 +917,7 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_protocol_identifier(

transport_dump_vpd_proto_id(vpd, buf, VPD_TMP_BUF_SIZE);

if ((len + strlen(buf) >= PAGE_SIZE))
if ((len + strlen(buf) > PAGE_SIZE))
break;

len += sprintf(page+len, "%s", buf);
Expand Down Expand Up @@ -962,19 +962,19 @@ static ssize_t target_core_dev_wwn_show_attr_##_name( \
\
memset(buf, 0, VPD_TMP_BUF_SIZE); \
transport_dump_vpd_assoc(vpd, buf, VPD_TMP_BUF_SIZE); \
if ((len + strlen(buf) >= PAGE_SIZE)) \
if ((len + strlen(buf) > PAGE_SIZE)) \
break; \
len += sprintf(page+len, "%s", buf); \
\
memset(buf, 0, VPD_TMP_BUF_SIZE); \
transport_dump_vpd_ident_type(vpd, buf, VPD_TMP_BUF_SIZE); \
if ((len + strlen(buf) >= PAGE_SIZE)) \
if ((len + strlen(buf) > PAGE_SIZE)) \
break; \
len += sprintf(page+len, "%s", buf); \
\
memset(buf, 0, VPD_TMP_BUF_SIZE); \
transport_dump_vpd_ident(vpd, buf, VPD_TMP_BUF_SIZE); \
if ((len + strlen(buf) >= PAGE_SIZE)) \
if ((len + strlen(buf) > PAGE_SIZE)) \
break; \
len += sprintf(page+len, "%s", buf); \
} \
Expand Down Expand Up @@ -1299,7 +1299,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
&i_buf[0] : "", pr_reg->pr_res_key,
pr_reg->pr_res_generation);

if ((len + strlen(buf) >= PAGE_SIZE))
if ((len + strlen(buf) > PAGE_SIZE))
break;

len += sprintf(page+len, "%s", buf);
Expand Down Expand Up @@ -1496,7 +1496,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
ret = -ENOMEM;
goto out;
}
if (strlen(i_port) >= PR_APTPL_MAX_IPORT_LEN) {
if (strlen(i_port) > PR_APTPL_MAX_IPORT_LEN) {
printk(KERN_ERR "APTPL metadata initiator_node="
" exceeds PR_APTPL_MAX_IPORT_LEN: %d\n",
PR_APTPL_MAX_IPORT_LEN);
Expand All @@ -1510,7 +1510,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
ret = -ENOMEM;
goto out;
}
if (strlen(isid) >= PR_REG_ISID_LEN) {
if (strlen(isid) > PR_REG_ISID_LEN) {
printk(KERN_ERR "APTPL metadata initiator_isid"
"= exceeds PR_REG_ISID_LEN: %d\n",
PR_REG_ISID_LEN);
Expand Down Expand Up @@ -1571,7 +1571,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
ret = -ENOMEM;
goto out;
}
if (strlen(t_port) >= PR_APTPL_MAX_TPORT_LEN) {
if (strlen(t_port) > PR_APTPL_MAX_TPORT_LEN) {
printk(KERN_ERR "APTPL metadata target_node="
" exceeds PR_APTPL_MAX_TPORT_LEN: %d\n",
PR_APTPL_MAX_TPORT_LEN);
Expand Down Expand Up @@ -3052,7 +3052,7 @@ static struct config_group *target_core_call_addhbatotarget(
int ret;

memset(buf, 0, TARGET_CORE_NAME_MAX_LEN);
if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) {
if (strlen(name) > TARGET_CORE_NAME_MAX_LEN) {
printk(KERN_ERR "Passed *name strlen(): %d exceeds"
" TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name),
TARGET_CORE_NAME_MAX_LEN);
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/target/target_core_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int transport_get_lun_for_tmr(
&SE_NODE_ACL(se_sess)->device_list[unpacked_lun];
if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) {
se_lun = se_cmd->se_lun = se_tmr->tmr_lun = deve->se_lun;
dev = se_lun->lun_se_dev;
dev = se_tmr->tmr_dev = se_lun->lun_se_dev;
se_cmd->pr_res_key = deve->pr_res_key;
se_cmd->orig_fe_lun = unpacked_lun;
se_cmd->se_orig_obj_ptr = SE_LUN(se_cmd)->lun_se_dev;
Expand All @@ -216,7 +216,6 @@ int transport_get_lun_for_tmr(
se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
return -1;
}
se_tmr->tmr_dev = dev;

spin_lock(&dev->se_tmr_lock);
list_add_tail(&se_tmr->tmr_list, &dev->dev_tmr_list);
Expand Down Expand Up @@ -1431,7 +1430,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl(
struct se_lun_acl *lacl;
struct se_node_acl *nacl;

if (strlen(initiatorname) >= TRANSPORT_IQN_LEN) {
if (strlen(initiatorname) > TRANSPORT_IQN_LEN) {
printk(KERN_ERR "%s InitiatorName exceeds maximum size.\n",
TPG_TFO(tpg)->get_fabric_name());
*ret = -EOVERFLOW;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/target/target_core_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ static int __core_scsi3_update_aptpl_buf(
pr_reg->pr_res_mapped_lun);
}

if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
if ((len + strlen(tmp) > pr_aptpl_buf_len)) {
printk(KERN_ERR "Unable to update renaming"
" APTPL metadata\n");
spin_unlock(&T10_RES(su_dev)->registration_lock);
Expand All @@ -1934,7 +1934,7 @@ static int __core_scsi3_update_aptpl_buf(
TPG_TFO(tpg)->tpg_get_tag(tpg),
lun->lun_sep->sep_rtpi, lun->unpacked_lun, reg_count);

if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
if ((len + strlen(tmp) > pr_aptpl_buf_len)) {
printk(KERN_ERR "Unable to update renaming"
" APTPL metadata\n");
spin_unlock(&T10_RES(su_dev)->registration_lock);
Expand Down Expand Up @@ -1986,7 +1986,7 @@ static int __core_scsi3_write_aptpl_to_file(
memset(iov, 0, sizeof(struct iovec));
memset(path, 0, 512);

if (strlen(&wwn->unit_serial[0]) >= 512) {
if (strlen(&wwn->unit_serial[0]) > 512) {
printk(KERN_ERR "WWN value for struct se_device does not fit"
" into path buffer\n");
return -1;
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/target/target_core_tmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,10 @@ void core_tmr_release_req(
{
struct se_device *dev = tmr->tmr_dev;

if (!dev) {
kmem_cache_free(se_tmr_req_cache, tmr);
return;
}

spin_lock(&dev->se_tmr_lock);
list_del(&tmr->tmr_list);
spin_unlock(&dev->se_tmr_lock);

kmem_cache_free(se_tmr_req_cache, tmr);
spin_unlock(&dev->se_tmr_lock);
}

static void core_tmr_handle_tas_abort(
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,13 @@ EXPORT_SYMBOL(transport_register_session);
void transport_deregister_session_configfs(struct se_session *se_sess)
{
struct se_node_acl *se_nacl;
unsigned long flags;

/*
* Used by struct se_node_acl's under ConfigFS to locate active struct se_session
*/
se_nacl = se_sess->se_node_acl;
if ((se_nacl)) {
spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
spin_lock_irq(&se_nacl->nacl_sess_lock);
list_del(&se_sess->sess_acl_list);
/*
* If the session list is empty, then clear the pointer.
Expand All @@ -556,7 +556,7 @@ void transport_deregister_session_configfs(struct se_session *se_sess)
se_nacl->acl_sess_list.prev,
struct se_session, sess_acl_list);
}
spin_unlock_irqrestore(&se_nacl->nacl_sess_lock, flags);
spin_unlock_irq(&se_nacl->nacl_sess_lock);
}
}
EXPORT_SYMBOL(transport_deregister_session_configfs);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/target/tcm_fc/tcm_fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ enum ft_cmd_state {
*/
struct ft_cmd {
enum ft_cmd_state state;
u32 lun; /* LUN from request */
u16 lun; /* LUN from request */
struct ft_sess *sess; /* session held for cmd */
struct fc_seq *seq; /* sequence in exchange mgr */
struct se_cmd se_cmd; /* Local TCM I/O descriptor */
Expand Down
Loading

0 comments on commit 599dbdb

Please sign in to comment.